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

restarting onbarupdate

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

    restarting onbarupdate

    Hi

    Is there a way to restart indicator when the last historical bar is reached. I want to do the first run for calculating one parameter, then the second run to calculate another parameter and only then apply the indicator. For now I have to save all intermediate parameters to the file and restart the indicator manually changing input parameters to reflect the order of run.

    Also is there a way to find out the CurrentBar number of the last historical bar before the next (live) tick arrives?

    Thank you.

    #2
    Hello BoyPlunger,

    It is not supported to programmatically restart an indicator. If you would only like to do some calculations historically you can do something like:

    Code:
    if (Historical)
    {
        //Do something
    }
    http://www.ninjatrader.com/support/h...historical.htm

    To find the Bar of the last historical you would have to calculate manually, or inside if (Historical) set the CurrentBar to a variable so you once if (Historical) is not running that variable will contain the last Bar of the Historical processing.

    Let us know if we can be of further assistance.
    JCNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by GussJ, 03-04-2020, 03:11 PM
    11 responses
    3,229 views
    0 likes
    Last Post xiinteractive  
    Started by andrewtrades, Today, 04:57 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    7 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by josh18955, 03-25-2023, 11:16 AM
    6 responses
    440 views
    0 likes
    Last Post Delerium  
    Started by FAQtrader, Today, 03:35 PM
    0 responses
    12 views
    0 likes
    Last Post FAQtrader  
    Working...
    X