I am trying to backtest a breakout strategy (which enters long or short on the high and low of a certain bar) with ninjatrader; I have minute and tick historical data. unfortunately, they both do not work. The minute historical executes trades on the following bar (not on the actual bar where the entry condition becomes true) therefore the entire strategy becomes useless. On the other hand tick historical does not seem to executes trades the right way and sometimes gaps appear which create unrealistic stop exits. Has anybody encountered my problems and found a way to solve them?
Many other backtesting platforms have the option of executing in the same bar. The fact that it executes on the following bar makes testing impossible for intraday strategies because all the entries and exits are modified!!! Is there any way to create 1 minute bar objects and then use one to check for the breakout condition and the other to execute the order on the same bar instead of the following one?
I think you are making a conceptual error. NT executes the trades too early and not too late.
There is no such thing as bar close! If you trade on 1 min bars and you are on a 10:01 bar, when will it close?
When your PC clock strikes 10:01 or the exchange clock or the atomic clock strike 10:01? No, you will get the close only after you get the first tick (trade) for a new bar, and even if your clock shows 10:15!
So first you receive a tick for a new bar and then NT says OH! the previous tick was the last tick of 10:01 bar.
So NT opens a new bar and then and only then it can close the previous bar.
Only then the execution of the strategy is triggered, so your order goes to the broker after first tick of a new bar and if it is really really quick it will land at the exchange before other traders issued their orders.
OK I know that usually one tick (trade) shouldn't move the market, but obviously in real trading you can't issue your trade on the bar close!
I used eSignal before NT and there you were able to peek into the future (see the next bar) in backtesting, unfortunately I was not able to get the same feature in live trading.
In my experience is isn´t really possible to adequatly emulate real world live order execution as there are simply to many things to consider.
If you´re doing you´re backtesting just look at how execution dependant your strategy is by substracting a decent amount of slippage from each trade or try a slightly delayed execution algo.
I'm backtesting in Ninjatrader. And there is something seriously wrong on all strategies that involves stop och target. Every trade gets stopped out immadietely only one point above the entry price (FDAX). Even though both the stop och the target are 15-30 points away from the entry price.
This problem does not only occur using my own strategies, but also to the pre-built strategies in the software (e.g. "SampleMultiInstrument"). The same thing happens when I test the strategies on other futures/forex.
What is wrong and how to fix it?
Thanks in advance!
Last edited by Gabriel123; August 27th, 2015 at 05:30 PM.
The same problem has happened to me several times now.
Suddenly every trade in my strategy gets stopped out immadietely only one point from the entry price. I am backtesting on FDAX and using 30 points stop loss (and 15 points profittarget).
This problem occured a couple of days ago, then suddenly it worked correct (meaning all the transactions ended 30 points at the stop or 15 points away at the limit) and then today this problem happened again. I have not changed anything relevant in the settings in the strategy during this period of time.