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-TimeFrame in Ver 7

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

    #16
    Hi Ryan,

    Your file was very useful.
    I think I've located the problem in my strategy being the value I assign to the currentBar test. (72000)

    Using 2000 as currentBar value allows me to get a value for 1period ATR.

    If I am using a 1minute strategy that requires at least 50 days lookback to create the ATR50 wouldn't i need at least 24*60*50 minute bars as a minimum?

    Almost there I think..

    Thanks for your patience

    Comment


      #17
      Yes, that's the general idea. You don't want to access the secondary series until enough days have developed. If you're referencing index [0], then this is really only the first days worth of 1 minute bars. In your case 1440 should do it.

      If you have calculations that require a certain number of bars to calculate for the secondary series, you can access this series' CurrentBar value directly with CurrentBars. Adding this check ensures the most accuracy as you will get values for your indicator even if the required # of bars hasn't elapsed.

      if (CurrentBar < 1441 || CurrentBars[1] < 50)
      return;
      Ryan M.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by fx.practic, 10-15-2013, 12:53 AM
      5 responses
      5,406 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by Shai Samuel, 07-02-2022, 02:46 PM
      4 responses
      98 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by DJ888, Yesterday, 10:57 PM
      0 responses
      8 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by MacDad, 02-25-2024, 11:48 PM
      7 responses
      160 views
      0 likes
      Last Post loganjarosz123  
      Started by Belfortbucks, Yesterday, 09:29 PM
      0 responses
      9 views
      0 likes
      Last Post Belfortbucks  
      Working...
      X