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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      89 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X