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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      54 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      72 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X