• 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

Possible to rewind indicator?

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

    Possible to rewind indicator?

    Hi,

    I have a need to re-bias past values in some indicators. By that I mean say something happens at time X that requires all times before X to be shifted by a delta value.

    For some indicators it is simple to manually set prior Plot values by back-stepping. But for other indicators that maintain a running state/accumulator the problem is more difficult. Other issues come up when indicators are chained so the main question is....

    Is there any way to programmatically rewind the CurrentBar value to a specific value and reset the mode to historical thereby causing the next call to Update() to recalculate all bars from that point forward to the end? If there is no way to do this for a partial time range, is there a way to recalculate the entire indicator programmatcially (like hitting F5).

    Thanks,
    Chris

    #2
    Hello crokusek,

    Thank you for your post.

    There is no means to force CurrentBar back a number of bars, however it is possible to reload the historical bars, although liberal use of this is not recommended. It is also not recommended to use this through OnStateChange or data based methods like OnBarUpdate().

    ReloadAllHistoricalData(): https://ninjatrader.com/support/help...oricaldata.htm

    The other option is to reload the NinjaScript with 'F5' which would require SendKeys.SendWait() but this is not reliable as it interacts with all windows. We currently have a feature request open to send keys and I can add a vote for this if you would like.

    Please let me know if you have any questions.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Hi Patrick,

      Thanks for the info. It looks like that call retrieves fresh data from the server for every window that depends on the same data series so that would be too slow/overkill. I'll first try and customize the indicator to rewrite past bars rather than use the send key for now since I just need it for a few indicators.

      Thanks,
      Chris

      Comment


        #4
        Originally posted by NinjaTrader_PatrickH View Post
        Hello crokusek,

        Thank you for your post.

        There is no means to force CurrentBar back a number of bars, however it is possible to reload the historical bars, although liberal use of this is not recommended. It is also not recommended to use this through OnStateChange or data based methods like OnBarUpdate().

        ReloadAllHistoricalData(): https://ninjatrader.com/support/help...oricaldata.htm

        The other option is to reload the NinjaScript with 'F5' which would require SendKeys.SendWait() but this is not reliable as it interacts with all windows. We currently have a feature request open to send keys and I can add a vote for this if you would like.

        Please let me know if you have any questions.
        Please, add my vote too.
        fx.practic
        NinjaTrader Ecosystem Vendor - fx.practic

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Gerik, Today, 10:58 PM
        0 responses
        1 view
        0 likes
        Last Post Gerik
        by Gerik
         
        Vps by stooby
        Started by stooby, Today, 08:32 PM
        0 responses
        11 views
        0 likes
        Last Post stooby
        by stooby
         
        Started by FaaastEddy, Today, 08:25 PM
        0 responses
        3 views
        0 likes
        Last Post FaaastEddy  
        Started by YevhenShynkarenko, Yesterday, 01:22 AM
        2 responses
        39 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by testingsarasa, 05-20-2018, 02:50 PM
        11 responses
        739 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X