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

if(historical data is reloaded)

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

    if(historical data is reloaded)

    Hello,

    Is there a way to reference if(historical data is reloaded) by either clicking on the right click relaod all data or when NT8 does it automatically e.g when reconnecting to data source?

    If i can find a way of registering the reloaded event then I want to be abe to trigger an action before onbarupdate so what state would the action sit in for it to come after the reload trigger but before onbrupdate?

    Thanks

    #2
    Hello b16_aln,

    Thank you for the post.

    For the events you mentioned you wouldn't need to monitor for that, the script will just terminate and then reload like you just applied it for the first time. Any logic that needs to run before OnBarUpdate could be placed in State.DataLoaded or as the first logic for CurrentBar 0:

    Code:
    if(CurrentBar == 0)
    { 
        // run logic once
    }
    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks but this doe snot produce the required effect. I was hoping to be able to diffrenetiate and set different actions for restarting the code and specifically when a data reload occurs (i.e when a data reload is the cause of restarting the code, do different action.

      Comment


        #4
        Hello b16_aln,

        To your script it would be unable to differentiate these actions, It also really should not perform differently for those two cases anyway as the reload is the same in the eyes of the script. In both cases the script needs to totally restart because of the change of data or manual reload request. it will start from the beginning and process the bars again.

        If you can provide more specific details on why you need to differentiate here potentially there is a different way to accomplish that task.


        Please let me know if I may be of additional assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by bmartz, 03-12-2024, 06:12 AM
        4 responses
        31 views
        0 likes
        Last Post bmartz
        by bmartz
         
        Started by Aviram Y, Today, 05:29 AM
        4 responses
        12 views
        0 likes
        Last Post Aviram Y  
        Started by algospoke, 04-17-2024, 06:40 PM
        3 responses
        28 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by gentlebenthebear, Today, 01:30 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by cls71, Today, 04:45 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X