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
Strategy performance analyzer order fill standard vs high vs load on chart
Collapse
X
-
Strategy performance analyzer order fill standard vs high vs load on chart
I get wildly different results when testing the same strat on the analyzer (standard) vs analyzer (high, one second) vs just loading days on a chart, enabling same strat, and checking the results from historical data off the chart. Which method is the most representative of live trading? Any? What about throwing market reply in the mix?Tags: None
-
Hello Touch-Ups,
Thanks for your post.
High Order Fill Resolution allows you to set a secondary bar series to be used as the price data to fill your orders.
Results could be different between Standard Order Fill Resolution and High Order Fill Resolution because when using High Order Fill Resolution you are bringing in a secondary series to use as the price data to fill orders.
Please review the help guide document on the differences on real-time vs backtest (historical).
It is expected that a strategy running real-time (live brokerage account, live market simulation, Playback connection etc...) will produce different results than the performance results generated during a backtest.
When in historical data, only the Open, High, Low, and Close will be available and there will be no intra-bar data. This means actions cannot happen intra-bar, fills cannot happen intra-bar. All prices and actions come from and occur when the bar closes as this is all the information that is known.
Because of this, OnBarUpdate will only update 'On bar close' as it does not have the intra-bar information necessary for 'On price change' or 'On each tick' and the script will not have the intra-bar information to accurately fill an order at the exact price and time.
Below is a link to the help guide on Calculate.
https://ninjatrader.com/support/helpGuides/nt8/calculate.htm
For a strategy that uses Calculate.OnBarClose, you could increase backtesting results by using High Order Fill Resolution with a 1-Tick series so they more closely resemble realtime results.
For a strategy that uses Calculate.OnPriceChange or Calculate.OnEachTick, you may use Tick Replay along with an added 1-tick series to have logic processed intra-bar and have orders filled intrabar.
Tick Replay would be used to have the logic process OnEachTick or OnPriceChange with historical data, but this does not allow for intra-bar order fills. You would need to add a single tick data series and submit orders to that single tick data series for a strategy that uses Tick Replay.
High Order Fill Resolution allows for intra-bar order fills with historical processing, but is not compatible with Tick Replay.
Please reference the SampleIntrabarBacktest example and the following Help Guide links for more information.
SampleIntrabarBacktest 'Backtesting NinjaScript Strategies with an intrabar granularity' - https://ninjatrader.com/support/help...ipt_strate.htm
TickReplay — https://ninjatrader.com/support/help...ick_replay.htm
Developing for Tick Replay - https://ninjatrader.com/support/helpGuides/nt8/developing_for__tick_replay.htm?zoom_highlightsub= developing+for+tick+replay
Additional information may be found in this NinjaTrader Forum post — https://ninjatrader.com/support/foru...mance?t=102504
Brandon H.NinjaTrader Customer Service
-
Okay. I forgot to mention this in the beginning. I am only using strategy builder for strats. I am not a coder. Is there a reference that shows me exactly what to do using the strategy builder to achieve results in the strategy analyzer that will be as close to real time as possible? Can it be done with the builder? I think I tried to add an additional data series and the analyzer didn't like it? Not sure.
When you say "For a strategy that uses Calculate.OnBarClose, you could increase backtesting results by using High Order Fill Resolution with a 1-Tick series so they more closely resemble realtime results." Does that mean I can create a strat in the builder like normal (no additional data series) on bar close, and will have the same results as if I DID add an additional data series but used on price change or on each tick IF I run the analyzer on high-tick?
Comment
-
Hello Touch-Ups,
Thanks for your notes.
If you are using Calculate.OnBarClose when running your strategy you could use High Order Fill Resolution with a 1-Tick series in the Strategy Analyzer to improve the accuracy of order fills in a backtest.
If you are using Calculate.OnPriceChange or Calculate.OnEachTick then you would have to unlock the code from the Strategy Builder and manually program your strategy to add a 1-Tick secondary series and submit orders to that secondary series.
Please reference the SampleIntrabarBacktest example and the following Help Guide links for more information.
SampleIntrabarBacktest 'Backtesting NinjaScript Strategies with an intrabar granularity' - https://ninjatrader.com/support/help...ipt_strate.htm
TickReplay — https://ninjatrader.com/support/help...ick_replay.htm
Developing for Tick Replay -
https://ninjatrader.com/support/helpGuides/nt8/developing_for__tick_replay.htm?zoom_highlightsub= developing+for+tick+replay
Additional information may be found in this NinjaTrader Forum post —
Citizens of the NinjaTrader Community, A common question we hear from clients is 'why are results from backtest different from real-time or from market replay?'. Live orders are filled on an exchange with a trading partner on an agreed upon price based on market dynamics. Backtest orders are not using these market dynamics.
Brandon H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Human#102, 05-08-2024, 09:54 AM
|
3 responses
16 views
0 likes
|
Last Post
by Human#102
Today, 06:11 AM
|
||
Started by ETFVoyageur, Today, 06:11 AM
|
0 responses
4 views
0 likes
|
Last Post
by ETFVoyageur
Today, 06:11 AM
|
||
Started by cencored, 03-31-2016, 05:09 PM
|
8 responses
2,453 views
0 likes
|
Last Post
by jstaft
Today, 06:05 AM
|
||
Started by James650, 05-07-2024, 08:25 AM
|
2 responses
8 views
0 likes
|
Last Post
by James650
Today, 05:59 AM
|
||
Started by ssijbabu, 10-07-2012, 07:10 AM
|
7 responses
4,466 views
0 likes
|
Last Post
by alex@n
Today, 05:43 AM
|
Comment