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

Multi-time frame odd behavior

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

    Multi-time frame odd behavior

    I'm working on multi-time frame strategy with a custom indicator that is exhibiting some strange behavior.

    It consists of a 2 brick renko time frame and a 350 tick time frame on the ES. I've coded it so I can run it from either a renko chart or a tick chart, so I can have the two charts side by side with the strategy running on each.

    The strategy has a custom indicator I've created based off of the DonchianChannel indicator that I create and with an instancefor both timeframes. It has a series called Trend that is 1 or -1 based on the trend.

    In my strategy I check the trend series of the renko version of the indicator to see if it has changed on BarUpdate for the renko bars. This is where the weird behavior comes in. Around 8:06:06 AM PST today (11/16/18) it says the trend changed from -1 to 1, and then the next bar says the very same thing. Obviously that shouldn't be possible.

    So basically what I'm seeing is when the strategy is applied to the renko chart it identifies the value change properly. But when run from the tick chart it is doing this strange behavior.

    So I guess my question is do I need to do any special code in the indicator to allow it to work on a multi-time frame strategy?

    I've attached the strategy.

    strategy.zip
    Attached Files

    #2
    Hello calebsandfort,

    Thanks for your post.

    I noticed you are adding the indicators in State.Configure depending on the data series you load. I would suggest moving this code to State.DataLoaded so the indicators are added and reference BarsArray or other information that depends on added data once all the data is loaded.

    Publicly available information on NinjaTrader states can be found here - https://ninjatrader.com/support/help...tatechange.htm

    If this does not resolve your inquiry, could you provide us some steps where we could test the code and observe a difference in behavior?

    I look forward to being of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Jim

      That fixed it. Thank you very much!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by usazencort, Today, 01:16 AM
      0 responses
      1 view
      0 likes
      Last Post usazencort  
      Started by kaywai, 09-01-2023, 08:44 PM
      5 responses
      603 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by xiinteractive, 04-09-2024, 08:08 AM
      6 responses
      23 views
      0 likes
      Last Post xiinteractive  
      Started by Pattontje, Yesterday, 02:10 PM
      2 responses
      22 views
      0 likes
      Last Post Pattontje  
      Started by flybuzz, 04-21-2024, 04:07 PM
      17 responses
      230 views
      0 likes
      Last Post TradingLoss  
      Working...
      X