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

How NinjaTrader detects (forms) BarClose event?

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

    How NinjaTrader detects (forms) BarClose event?

    lets say, we have indicator set to Calculate.OnBarClose.
    this means to catch the closing tick/update of the bar. But my question is how that happens?
    i.e. we have indicator:

    Code:
    Print(Close[0]);
    Print(Volume[0]);
    for example, we are on 1 minute chart, and incoming ticks/updates has happened in this way:

    14:47:54 (price 103.25)
    14:47:57 (price 103.55)
    14:48:04 (price 104.64)

    so, at what time would "BarClose" event triggers or when it triggers, what price would be printed?

    if that trigger happens at 14:48:04, then it will be the "first tick of bar" event, not the "last-tick of bar" update.
    if that trigger happens at ..:47:57 , then how NT knows that it would be the last tick of the bar?
    if that trigger happens at ..:48:00 (while actually there has not happened any incoming tick/update), then what would be price or volume at that moment, how NT forms that?

    I am interested how NT works with regard to this subject..

    #2
    Hi ttodua, thanks for your note.

    When a script runs on bar close it does not catch the last tick of the bar, it has no synchronicity with the incoming ticks. Only a OnEachTick script is guaranteed to be called in sync with incoming ticks. A time based bar with an OnBarClose script will just close when an internal timer ticks.
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by xiinteractive, 04-09-2024, 08:08 AM
    3 responses
    11 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by Johnny Santiago, 10-11-2019, 09:21 AM
    95 responses
    6,193 views
    0 likes
    Last Post xiinteractive  
    Started by Irukandji, Today, 09:34 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by RubenCazorla, Today, 09:07 AM
    1 response
    6 views
    0 likes
    Last Post RubenCazorla  
    Started by TraderBCL, Today, 04:38 AM
    3 responses
    26 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X