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

Update()- When is it necessary?

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

    Update()- When is it necessary?

    I have read several posts from Josh on the Update() method but want to make sure I understand WHEN it is necessary if one is only needing to use an indicator's value itself and not an internal variable value within the indicator.


    Can someone explain under what circumstances you would need to utilize the Update() method? Specifically is there ever a case where one would need to use the Update() method to get the correct (meaning updated) indicator's value when calling it from within another indicator or strategy calculation step?
    Jim-Boulder
    NinjaTrader Ecosystem Vendor - Elephant Tracks

    #2
    Update is needed any time you are accessing a "non-dataseries" property. DataSeries syns themselves by triggering OnBarUpdate if needed. But if you want access e.g. a custom property which holds the result of some calculation triggers in onBarUpdate, then you would need to make sure OnBarUpdate is triggered by calling Update().

    Comment


      #3
      Plots and Dataseries Don't require Update() 'call'?

      Thanks Dierk,

      just to make sure I am getting it, is this correct:

      Plots and Data series values (in indicators) do NOT ever require an Update) explicitly because they update on each OnBarUpdate or during each tick (if OnBarUpdate = false).
      Jim-Boulder
      NinjaTrader Ecosystem Vendor - Elephant Tracks

      Comment


        #4
        Your understanding is correct.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rjbtrade1, 11-30-2023, 04:38 PM
        2 responses
        75 views
        0 likes
        Last Post DavidHP
        by DavidHP
         
        Started by Stanfillirenfro, Today, 07:23 AM
        3 responses
        12 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by FitSpressoHonest, Today, 09:14 AM
        0 responses
        1 view
        0 likes
        Last Post FitSpressoHonest  
        Started by Davide999, 05-18-2023, 03:55 AM
        4 responses
        557 views
        1 like
        Last Post kcwasher  
        Started by rexsole, Today, 08:39 AM
        2 responses
        8 views
        0 likes
        Last Post NinjaTrader_Erick  
        Working...
        X