To start, I hired someone to automate this strategy for me. Can someone explain to me why this strategy running on the exact same settings and gave a different entry in back testing vs on live data (demo). It's clear that the issue in this example is with the 2-lines cross indicator beneath the chart. That being said if this error can occur with 1 indicator I think it's possible that it can happen with any indicator which makes me believe that I will experience this problem fairly often.
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Different entries on back testing and live demo
Collapse
X
-
Different entries on back testing and live demo
Hello,
To start, I hired someone to automate this strategy for me. Can someone explain to me why this strategy running on the exact same settings and gave a different entry in back testing vs on live data (demo). It's clear that the issue in this example is with the 2-lines cross indicator beneath the chart. That being said if this error can occur with 1 indicator I think it's possible that it can happen with any indicator which makes me believe that I will experience this problem fairly often.
Tags: None
-
Hello jfobel123,
You can expect that a strategy running real-time (live brokerage account, live market simulation, Market Replay etc...) may produce different results than the performance results generated during a backtest depending on how much resolution the script is running with. Further, this difference may be more easily seen on certain Bars types (e.g. Point and Figure, Renko) than others due to their inherent nature in bar formation.
Below is a link to the Help Guide on 'Discrepancies: Real-Time vs Backtest'.
http://ninjatrader.com/support/helpG...ime_vs_bac.htm
Adding intra-bar granularity can help with this.
Intra-bar granularity adds a second data series such as a 1 tick series so that the strategy has finer granularity in the historical data in between the OHLC of the primary series. This allows for more accurate trades by supplying the correct price at the correct time for the order to fill with.
In NinjaTrader 8, there have been two new enhancements so that programmers do not have to manually add this secondary series and code the script to for high accuracy fills (Order Fill Resolution) and for intra-bar actions (TickReplay).
Below is a link to a forum post that discusses what causes differences, how to use prints or writing to file to understand what is specifically causing differences in your script, and how to mitigate these differences.
https://ninjatrader.com/support/foru...mance?t=102504Chelsea B.NinjaTrader Customer Service
-
I believe I have intra-bar granularity enabled. I also don't think this explains the cause of my problem. The strategy is set to enter at the close of the candle where a signal is given. Maybe I'm ignorant but I would think that the closing price and therefore the indicator readings would be the same regardless.
Comment
-
Hello jfobel123,
To confirm, you are adding a 1 tick-series with AddDataSeries and you are submitting orders using the barsInProgressIndex of that 1 tick series, is this correct?
Please provide the output written to file of the conditions and data of both runs so that we may compare.Chelsea B.NinjaTrader Customer Service
Comment
-
Hello jfobel123,
May I confirm you have reviewed the forum post I have linked you in it's entirety and you have reviewed the SampleIntrabarBacktest_NT8 reference sample linked in the forum post on intra-bar granularity?
This involves adding a 1 tick series with AddDataSeries, placing orders to the barsInProgressIndex of that 1 tick series, and ensuring the logic is updating with the primary barsInProgress.
As far as writing information to file, you are doing this with StreamWriter?Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by burtoninlondon, Today, 12:38 AM
|
0 responses
10 views
0 likes
|
Last Post Today, 12:38 AM | ||
Started by AaronKoRn, Yesterday, 09:49 PM
|
0 responses
14 views
0 likes
|
Last Post
by AaronKoRn
Yesterday, 09:49 PM
|
||
Started by carnitron, Yesterday, 08:42 PM
|
0 responses
11 views
0 likes
|
Last Post
by carnitron
Yesterday, 08:42 PM
|
||
Started by strategist007, Yesterday, 07:51 PM
|
0 responses
13 views
0 likes
|
Last Post Yesterday, 07:51 PM | ||
Started by StockTrader88, 03-06-2021, 08:58 AM
|
44 responses
3,983 views
3 likes
|
Last Post
by jhudas88
Yesterday, 06:59 PM
|
Comment