I somehow concluded from the Streak that the backtesting, virtual deployment and live deployment work in 3 different times. Suppose my strategy is on 5 minutes timeframe and the entry conditions get fulfilled at 9:23:41 AM.
While doing backtesting, it takes the trade in the current candle at the start of the 5 mins timeframe (but till that time all my conditions may not have been fulfilled). The backtest transaction shows at 9:20 AM - at start of the candle.
While deployed for the virtual trade, it takes the trade as soon as the conditions get fulfilled (anytime within the 5 minutes slot). The transaction shows at 9:23.41 AM.
While deployed for live trading, it takes the trade after completion of the condition fulfilled candle. The transaction happens at 9:25 AM - at the close of the candle.
Anyone sees this issue? How Can I make all these in sync, so that the result of backtest, virtual deployment and live deployment become exactly same? Now sure if Streak is going to fix this sooner. Can I do something in my conditions itself?
Please note that Streak uses OHLC (Open, High, Low, Close) candle data to evaluate entry and exit conditions in backtesting as well as in the live market.
In backtesting, conditions are evaluated using historical candle data and are based on certain assumptions. If a 5-minute candle (for example, 9:20–9:25) satisfies the entry criteria, the trade is recorded at the candle timestamp, i.e., 9:20. This does not imply that the trade occurred at 9:20 in real time; it only indicates that the conditions were confirmed after the candle closed, and the open price of the next candle i.e. 9:25 is considered as the entry price.
In live and virtual trading, conditions are also evaluated only after the candle is completed. The difference lies in execution. In live trading, once the candle completes and conditions are met, a trigger/alert is generated on which the user must act to place the order. In virtual trading, the order is placed automatically as soon as the condition is confirmed.
Due to this, the actual entry price in live trading can vary based on several factors such as the time taken by the user to act on the alert, market liquidity, bid-ask spread, and overall market conditions. Since stop-loss and target levels are calculated based on the entry price, real-market slippage plays a significant role and cannot be ignored.
Because of these reasons, the results of backtesting, virtual deployment, and live deployment cannot be exactly the same and some slight variation between them is expected.
I understand the alert vs actual trade execution part of it in Live trading. But I fail to understand, why can’t you mention 9:25 AM in backtesting data as well, so that nobody is confused. Another thing, in Backtest result, you mention the column heading as Trigger Time, and mention 9:20 AM, whereas that is also not correct as the actual trigger time is 9:23:41 AM.
And the same for virtual trade, as you are claiming that even there, the actual trade happens at 9:25 AM? You can still keep the trigger time as 9:23:41. But the execution time can be tracked as 9:25 AM and the price accordingly.
Another issue: In my entry conditions, I have mentioned current candle open = low. Unless the candle gets complete, how can you know the low? Then how can the trigger time be 9:23:41 AM even in virtual trade?
If you do these changes, everything will be in sync, as you just claimed that all trades (including backtest and virtual trade) happen only after candle completes.