• 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

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 ksarin, Today, 12:39 PM
    3 responses
    9 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Started by ttodua, Today, 12:03 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by tomtr27, Today, 11:35 AM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Uregon, Today, 07:30 AM
    2 responses
    10 views
    0 likes
    Last Post bltdavid  
    Started by Induna, 02-20-2020, 05:38 AM
    4 responses
    26 views
    0 likes
    Last Post NinjaTrader_Kate  
    Working...
    X