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

when is onreder called with added dataseries

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

    when is onreder called with added dataseries

    I have an indicator that adds in a dataseries

    The added data-series is a smaller periodicity than the base data-series

    I categorize data based on the creation of a new base bar, but I gather data on all of the added data-series bars

    I want to limit rendering based on the number of base bars, for example I want to render based on the previous 100 base bars. But as time goes on, this previous 100 bars moves forward - I want to render based on a moving last 100 bars range.

    I also want to limit the lower granularity data gathering, which done at the added dataseries periodcity. I only want to summat the lower granularity data that is within this moving last 100 bars range.

    My current thought is to do a forcerender() on each new basebar which would seemingly setup the required logical processing I am looking for. This may be CPU heavy.

    I also think I may be able to do this in onrender() which leads to my question.

    Given a base dataseries and an added dataseries, what drives invovations of onrender() ?

    Does every tick of either dataseries invoke onrender() ?

    #2
    Hello,

    Thank you for the post.

    For limiting the lookback, you would likely need to use the From and To index values. You could subtract 100 bars from the last bar painted index as one example. The Pivots indicator uses this type of logic to render for the visible bars on the chart.

    Please see the following item:


    For the finer granularity items, because you want to know only a range of data you would likely need to use logic to compare Times. As I am not sure of your overall logic it would be difficult to give an example here, you would likely need to form some logic to lookback over the last 100 base bars and get a start time to know the range. You could use a start time and end time to compare a region of data on the other series.

    To locate the reasons OnRender is called, please see both the OnRender documentation notes and the ForceRefresh notes. These pages outline why OnRender gets called and reasons that would cause the chart to be flagged for rendering.




    I could only suggest using ForceRefresh if you need to, in the case you see that the charts OnRender does not have updated data due to some out of event driven logic you may need to call this.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by RaddiFX, Today, 01:25 PM
    2 responses
    5 views
    0 likes
    Last Post RaddiFX
    by RaddiFX
     
    Started by Dennys Vera, Today, 01:00 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by dtl-saw, 12-29-2022, 09:12 AM
    50 responses
    3,505 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by RichardSobe, Today, 01:00 PM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by forrestang, Today, 11:17 AM
    5 responses
    14 views
    0 likes
    Last Post forrestang  
    Working...
    X