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!
See more
See less

Partner 728x90

Collapse

Major discrepancy between Strategy Analyzer & Playback

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Major discrepancy between Strategy Analyzer & Playback

    Hello,

    I'm having a problem with the Strategy Analyzer results.
    I understand Historical Fill Processing and Order Fill Resolution as explained in the help Guide. I've also seen several threads about this topic that offered solutions, but despite the changes I've made in my code, there are still major discrepancies in results.

    For more accurate execution on the Strategy Analyzer I've added the following to the strategy code:

    Code:
    if (State == State.SetDefaults)
                {
                    OrderFillResolution = OrderFillResolution.Standard;
                    Slippage = 0;
                }
    else if (State == State.Configure)
                {
                    AddDataSeries(Data.BarsPeriodType.Tick, 1);
                }
    else if (State == State.DataLoaded)
                {
                    SetProfitTarget("", CalculationMode.Ticks, Target);
                }
    protected override void OnBarUpdate()
                {
                    //Conditions
                    {EnterLong(1,Convert.ToInt32(Quantity), "");}
                }
    Attached are results from Playback and Strategy Analyzer over the same period, and clearly these additions didn't improve accuracy.

    What can I do to get results on the Strategy Analyzer that are close to Playback? Any pointers are greatly appreciated.
    Attached Files

    #2
    Hello KINGKODA,

    Thanks for your post.

    High Order Fill Resolution or submitting your orders to a single tick data series will improve the accuracy of order fills for historical processing, however these approaches will not effect order fill simulations using realtime data. The Playback Connection mimics realtime data and will simulate order fills in the same fashion as a simulated order fill using live data.

    Our help guide describes 3 different scenarios for order fills: historical, simulated realtime, and actual fills from the exchange following true market dynamics.

    The Fill Price of Orders
    • During a backtest assumptions are made on the fill price of an order is based on the OHLC of a bar and the price of the order itself. You can also have differences depending on which fill algorithm you choose.
    • During simulation using real-time market data or Playback, the fill price is based on incoming market data and volume, you may receive better or worse fill prices dependant on where the bid or ask price is and what volume is available at this market prices.
    • During real-time brokerage trading, orders are filled according to market dynamics.
    Discrepancies between historical and realtime - https://ninjatrader.com/support/help...ime_vs_bac.htm

    Because these fill processes are different, there still will be expected discrepancies between historical and playback as well as with acutal order fills.

    Please let us know if there is anything else we can do to help clarify.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by ETFVoyageur, 05-07-2024, 07:05 PM
    16 responses
    129 views
    0 likes
    Last Post bltdavid  
    Started by ETFVoyageur, Today, 10:13 PM
    1 response
    6 views
    0 likes
    Last Post ETFVoyageur  
    Started by somethingcomplex, Today, 10:36 PM
    0 responses
    5 views
    0 likes
    Last Post somethingcomplex  
    Started by sofortune, Yesterday, 10:28 AM
    5 responses
    22 views
    0 likes
    Last Post sofortune  
    Started by guyonabuffalo, Today, 10:01 PM
    0 responses
    2 views
    0 likes
    Last Post guyonabuffalo  
    Working...
    X