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

Question on strategies, market reply, and UniRenko bars

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

    Question on strategies, market reply, and UniRenko bars

    Hi NT8,

    I am using UniRenko bars with a strategy, which prints different opens/closes than the actual price at that time (similar to Heiken Ashi bars). What settings/code do I need to use so that the Market Replay functions the same to how the strategy would in live market? I ask because I have tested the strategy in market reply and then live, and they seem to function a bit differently. In short, the replay seems to enter at my EnterLongLimit(...GetCurrentBid(0)...) more frequently in the market replay than it does in the live market, and I need help so I can test more often than live markets.

    Thank you!

    #2
    Posting the relevant code that I think needs help. Do I need to change the OnBarUpdate?

    Attached Files

    Comment


      #3
      Hello Austiner87,

      Thanks for your post.

      Standard Renko bars can be challenging for backtesting as the barstypes use functionality to remove the last bar in the data series and replace the bar with a new Open price.This is done with reversals and cannot be simulated historically, because the bars are already built. Testing may be done with the Playback Connection to fully simulate standard Renko bars with accurate reversals and order fills.

      Some custom Renko bars aim to work around this limitation and often substitute a "fake" open price in the bar. This will result in Standard Order Fill Resolution estimating fill prices using OHLC values that are not 100% reflective of actual price action which can create discrepancies with results. High Order Fill Resolution should be used in cases like this, or the strategy should be written to submit orders to a single tick data series.

      Similarly to custom Renko bars which use a "fake" open price, HeikenAshi bars alter the OHLC values of the data series to use the HeikenAshi moving average values. Since these are not real prices, it would be best to consider the same workarounds as noted above, or to use a HeikenAshi indicator.

      See the help guide documentation below for more information. The SampleIntrabarBacktest reference sample demonstrates submitting orders to an added secondary single tick data series.

      Order Fill Resolution: https://ninjatrader.com/support/help...resolution.htm

      SampleIntrabarBacktest 'Backtesting NinjaScript Strategies with an intrabar granularity' - https://ninjatrader.com/support/helpGuides/nt8/backtesting_ninjascript_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

      Discrepancies between realtime and historical data — https://ninjatrader.com/support/help...ime_vs_bac.htm

      Let us know if we may assist further.
      Brandon H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Segwin, 05-07-2018, 02:15 PM
      14 responses
      1,788 views
      0 likes
      Last Post aligator  
      Started by Jimmyk, 01-26-2018, 05:19 AM
      6 responses
      837 views
      0 likes
      Last Post emuns
      by emuns
       
      Started by jxs_xrj, 01-12-2020, 09:49 AM
      6 responses
      3,293 views
      1 like
      Last Post jgualdronc  
      Started by Touch-Ups, Today, 10:36 AM
      0 responses
      12 views
      0 likes
      Last Post Touch-Ups  
      Started by geddyisodin, 04-25-2024, 05:20 AM
      11 responses
      62 views
      0 likes
      Last Post halgo_boulder  
      Working...
      X