Announcement

Collapse
No announcement yet.

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 Polufson, Today, 01:37 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Kate  
    Started by mohsemian, Today, 01:36 PM
    2 responses
    9 views
    0 likes
    Last Post mohsemian  
    Started by Derjan, Today, 01:18 PM
    2 responses
    17 views
    0 likes
    Last Post NinjaTrader_Kate  
    Started by Cicero, Today, 09:41 AM
    3 responses
    20 views
    0 likes
    Last Post NinjaTrader_Kate  
    Started by johnnymustard, Today, 12:01 PM
    2 responses
    12 views
    0 likes
    Last Post johnnymustard  
    Working...
    X