• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 Johnny Santiago, Today, 06:18 PM
    1 response
    4 views
    0 likes
    Last Post Johnny Santiago  
    Started by EnveousColnago, Today, 05:43 PM
    0 responses
    4 views
    0 likes
    Last Post EnveousColnago  
    Started by Zigfried, Today, 02:30 PM
    2 responses
    8 views
    0 likes
    Last Post Zigfried  
    Started by lunardiplomacy, Today, 11:35 AM
    4 responses
    17 views
    0 likes
    Last Post lunardiplomacy  
    Started by silverm3170, Today, 11:24 AM
    3 responses
    10 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X