I've run into a few issues with strategies.
They run differently in back testing than in realtime. It appears in back testing that the strategy gets called at the end of each bar while in realtime it get's called more often. Backtesting and realtime need to act the same.
If I place a stop order to enter into a trade, I also want to enter a stoploss after the orignal order hits. If I get called on everytick, I can monitor the price action and decide that the stop took and place a protective stop. In backtesting mode, I cannot because I am being called at the end of the bar.
I have'nt found a way to tell what price a market order when in for (So I can set a protective stop).
I have noticed that upon loading a strategy to a chart, all the back bars react properly when orders are issued using market orders and then testing with strategy.isLong() for example. But moving forward, it no longer detects issued orders (strategy.isLong()). Again, realtime and backtesting needs to be the same.
If anyone has ideas around these problems please reply
Thanks
They run differently in back testing than in realtime. It appears in back testing that the strategy gets called at the end of each bar while in realtime it get's called more often. Backtesting and realtime need to act the same.
If I place a stop order to enter into a trade, I also want to enter a stoploss after the orignal order hits. If I get called on everytick, I can monitor the price action and decide that the stop took and place a protective stop. In backtesting mode, I cannot because I am being called at the end of the bar.
I have'nt found a way to tell what price a market order when in for (So I can set a protective stop).
I have noticed that upon loading a strategy to a chart, all the back bars react properly when orders are issued using market orders and then testing with strategy.isLong() for example. But moving forward, it no longer detects issued orders (strategy.isLong()). Again, realtime and backtesting needs to be the same.
If anyone has ideas around these problems please reply
Thanks
Comment