Support Board
Date/Time: Sun, 09 Mar 2025 20:21:18 +0000
[Programming Help] - [Automate Trading][Replay] How to make a good bot backtesting
View Count: 1521
[2022-03-06 00:11:45] |
noaah - Posts: 32 |
Hey there! I recently and with your help (I got to thanks you all) achieve making my trading strategy automated with Spreadsheet. I got here two questions: How to be sure my bot Buy Exit and Sell Exit when I want ? Because on the chart I got arrows at the candles where the bot enter in the market but I dont have arrow where it exit the market. No matter got the exact value of the exit point if that is too complicated, but if I at least can get like the arrow pointing the entry candle for the exit candle it would help me a looot for quickly visualize wich trades I win in detail, just by looking the chart. My Buy Exit formula: =OR(AND($J$8 > 0, ID0.SG4@$3 <= $J$9-2), AND($J$8 > 0, ID0.SG4@$3 >= $J$9+2))
My Sell Exit forumla: =OR(AND($J$8 < 0, ID0.SG4@$3 >= $J$9+2), AND($J$8 < 0, ID0.SG4@$3 <= $J$9-2))
I here want to instant exit when I got 2 points or -2 points. Are my formulas seems corrects for you ? My second (or third) question: How to be sure making good bot backtesting ? Before launching my bot for real trading Im doing a lot of backtest with it on simulated mode combinated with the Replay tool offer by Sierra Chart. After reading lot of documentation here on Sierrachart and testing a lot of things im blocked at this point: Depending the Replay mode I set I got differents results in term of DPL (showed in my DOM that is also replayed combinated with my Chart replay (they got the same Link Number). I got Standard Replay, Calculate Same as Real Time, Accurate Trading System Backtest Mode and Calculate at every tick/trade options. I already read the documentation but I dont know what is here the best setup to replay the days I want to test with my strat and verify if it works. I want to make tests where the result will be the same that if I was in real time mode. Depending the setup I got a 20 points gap, that's huge ! With the experience of those who already got spreadsheet bots and, I think, backtest these before launching these in real time market, do you got an ideal configuration to work with during replay backtests ? Thanks a lot if you read me ! Have a good day ! |
[2022-03-06 16:09:01] |
Sawtooth - Posts: 4181 |
Re: Your first question: Suggestion: - Don't use columns L,N for exits; check the Trade Window's 'Use Attached Orders'. - Use J80/J81 to set your Attached Orders target/stop offsets. (These are in points, not ticks.) - To see your entry and exits after a backtest, go to Trade >> Show Order Fills. Re: Your second question: IMO, the most accurate backtest is the Replay Chart, using Accurate Trading System Back Test Mode, at a speed that doesn't lag your video card. The slowest speed will be the most accurate. |
[2022-03-06 23:45:13] |
noaah - Posts: 32 |
Okay thanks I do all of that ! :) Another question is: I force to Buy Enter OR Sell Enter only one at time (it can enter into the market if it is already on a trade), but if it start a trade on a candle and exit in this same candle it will start a new trade on this same candle. How to force only max one trade per candle ? |
[2022-03-07 03:25:22] |
Sawtooth - Posts: 4181 |
How to force only max one trade per candle ?
This would only be a problem if your entries are intrabar, IOW, Signal Only On Bar Close (K,M) is No.If it's a second entry order in the same direction, you can limit it to one per bar with 'Signal Only Once Per Bar' set to yes. However, there is no setting to limit a second entry order in the opposite direction in the same bar, because each column/subgraph has its own separate ability to 'signal'. Spreadsheet Systems, Alerts and Automated Trading: Alert/Signal Only Once per Bar Since your chart is a 1 min chart, you should be able to compare J42 with J41, and only allow an entry if the difference is greater than 60 sec: $J$41-$J$42>60/86400 Spreadsheet Example Formulas and Usage: Formula Equivalents of Serial Date Time Values |
To post a message in this thread, you need to log in with your Sierra Chart account: