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

accessing indicator values

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

    accessing indicator values

    Hello i have an indicator i use and am setting this up to return some key values to be used in a strategy.

    If the indicator has values calculated within OnRender - given i will be invoking the indicator from a strategy is it advised/essential i move some of those calculations (they are not heavy calcs as i realise onrender should be light on calculation) to onbarupdate -

    ie calling the indicator from a strategy will mean the onRender portion will not be active or called?

    thanks

    #2
    Hello soulfx,

    Indicators added to a strategy will only process OnRender() if the indicator is added with AddChartIndicator().

    This can be tested with a print in an empty indicator with OnRender() overridden, and adding that indicator to a strategy with and without using AddChartIndicator() to observe the results.

    However, it is generally advised to perform these sorts of calculations in OnBarUpdate() as much as possible such that the data can be synchronized and kept up to date. Since OnRender() is calculated asynchronously to OnBarUpdate(), the values obtained from these calculations may not be guaranteed.

    Please let me know if I can be of further assistance.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by traderqz, Yesterday, 09:06 AM
    3 responses
    21 views
    0 likes
    Last Post NinjaTrader_ThomasC  
    Started by f.saeidi, Today, 10:19 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by kujista, Today, 06:23 AM
    5 responses
    17 views
    0 likes
    Last Post kujista
    by kujista
     
    Started by traderqz, Today, 12:06 AM
    3 responses
    6 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by RideMe, 04-07-2024, 04:54 PM
    5 responses
    29 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X