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 andrewtrades, Today, 04:57 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by chbruno, Today, 04:10 PM
      0 responses
      5 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by josh18955, 03-25-2023, 11:16 AM
      6 responses
      436 views
      0 likes
      Last Post Delerium  
      Started by FAQtrader, Today, 03:35 PM
      0 responses
      7 views
      0 likes
      Last Post FAQtrader  
      Started by rocketman7, Today, 09:41 AM
      5 responses
      19 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X