Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

sequence of events

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

    sequence of events

    what is the sequence of events when i add a strategy to a chart? for example, if the price is drawn, then the indicator computed, then the strategy. it means that the strategy can see in the future. on the other hand, if the price, indicator and strategy are calculated bar by bar, the indicator can't see in the future.

    #2
    Hi tubular2000,

    Thanks for your note.

    When a strategy is added to a chart only the Intialize() function will be run. This is to initialize variables and set defaults. No other functions will run in the script at that time.

    For all NinjaScripts, indicator or strategy, certain functions run at certain times.

    First, the data will be received by the platform and processed. Next the bar will appear on the chart.

    The OnBarUpdate will run whenever a bar is closed (when CalculateOnBarClose is set to true) or when a tick is received (when CalculateOnBarClose is set to false).

    OnMarketData will always run whenever any data is received (such as a tick, or daily high, daily low, volume etc).

    An indicator and strategy added directly to the same chart will be asynchronous, meaning that there is no guarantee that either will run before the other. They will both depend on NinjaTrader closing a bar or receiving data independently.

    An indicator that is called from a strategy will always be run when it is called.


    Please let me know if this does not resolve your inquiry.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    18 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    1 view
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    6 views
    0 likes
    Last Post Javierw.ok  
    Started by timmbbo, Today, 08:59 AM
    2 responses
    10 views
    0 likes
    Last Post bltdavid  
    Started by alifarahani, Today, 09:40 AM
    6 responses
    41 views
    0 likes
    Last Post alifarahani  
    Working...
    X