Announcement

Collapse
No announcement yet.

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 jc.am, Today, 07:59 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_EricB  
    Started by ybhx0315, Today, 09:06 PM
    0 responses
    2 views
    0 likes
    Last Post ybhx0315  
    Started by parkinsonbr, Today, 08:23 PM
    0 responses
    3 views
    0 likes
    Last Post parkinsonbr  
    Started by i2w8am9ii2, Today, 04:36 PM
    2 responses
    13 views
    0 likes
    Last Post i2w8am9ii2  
    Started by WeyldFalcon, Today, 02:07 PM
    2 responses
    15 views
    0 likes
    Last Post WeyldFalcon  
    Working...
    X