Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calc Freq in Strategy Script Calling an Indicator Script - Calling Script Controls?

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

    Calc Freq in Strategy Script Calling an Indicator Script - Calling Script Controls?

    I know this is in the docs because I recall reading it explicitly, but naturally now I can't find it...

    The calculation frequency of the calling script takes precedence when calling an indicator (or other external) script, correct?

    So, if I have a Strategy script where Calculate = Calculate.OnPriceChange which calls an Indicator script, the calculation frequency will be OnPriceChange (per the calling Strategy script) regardless of the hardcoded value in the Indicator script (i.e. Calculate.OnBarClose), yes?

    Thanks for confirming.

    #2
    Ah, found it: https://ninjatrader.com/support/help...tionupdate.htm

    *Follow-Up:
    I understand logically what's written in the documentation whereby the parent Strategy should have a frequency at least as high as any called child scripts. However, if the situation is reversed (i.e. parent Calculate.OnPriceChange vs. child Calculate.OnBarClose) in this case will the called child script calculate OnPriceChange or OnBarClose?

    I instantiate my indicator from within State == State.DataLoaded within my Strategy script.

    Thanks in advance!
    Last edited by TheFil; 09-09-2022, 01:16 PM.

    Comment


      #3
      Hello TheFil,

      The indicator always follows the parent calculate setting. If your indicator needs OnBarClose then you would have to either run the strategy OnBarClose or reprogram the indicator to simulate OnBarClose by using IsFirstTickOfBar to know when bars close.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      81 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      68 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      55 views
      0 likes
      Last Post CarlTrading  
      Working...
      X