• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calculate

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

    Calculate

    I was hoping you could expand a bit on the Caluclate. I just want to make sure I am understanding this correctly.

    In the NT8 Help Guide it states under tips it states

    3.Embedded scripts within a calling parent script should not use a different Calculate property since it is already utilizing the Calculate property of the parent script (i.e. the strategy your indicator is called from).
    4. Scripts that require Calculate to be set by the developer must set this property in State.Historical in its OnStateChange() in order to ensure that if this script is a child (hosted) that the parent.Calculate property which is adopted by the child is overridden again.
    So essentially, when an indicator is called from a strategy, it by default will use the Calculate.XXXX setting that the strategy is using (regardless of how the indicator is programmed), unless you specifically program in the indicator to Calculate differently on the State.Historical.

    If you have a strategy that does not run on historical data (example, you are using ATM Strategies. And you program your strategy like so.
    PHP Code:
    else if(State == State.Historical)
    {
    return

    Does the indicator/child script still run the (State == State.Historical) so it can set a different Calculate.XXXX setting or must you set the the Calculate.XXXX setting on (State == State.Realtime)

    #2
    Hello cutzpr,

    It is always recommended that the hosted child script should have the same Calculate setting as the host parent script.

    This is correct that NinjaTrader will override this if set in OnStateChange when the State is SetDefaults or Configure.

    Setting this when the State is Historical would allow the hosted script to have an independent calculate setting.


    Returning in OnBarUpdate would not affect the Calculate setting.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Ivantr, Yesterday, 05:24 PM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_Marco  
    Started by ralett, Yesterday, 06:20 PM
    3 responses
    28 views
    0 likes
    Last Post ralett
    by ralett
     
    Started by trader252, Yesterday, 08:38 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Started by grizzlytrader, Yesterday, 06:24 AM
    1 response
    24 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by andrewtrades, Yesterday, 01:43 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X