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 space_trader, Today, 12:52 AM
    1 response
    20 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by ybhx0315, Yesterday, 09:06 PM
    0 responses
    15 views
    0 likes
    Last Post ybhx0315  
    Started by parkinsonbr, Yesterday, 08:23 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by fxRichard, Today, 04:35 AM
    2 responses
    14 views
    0 likes
    Last Post fxRichard  
    Started by fernlicht, Today, 01:59 AM
    12 responses
    62 views
    0 likes
    Last Post NinjaTrader_Jason  
    Working...
    X