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 bigc0220, 09-18-2018, 09:16 AM
    6 responses
    2,579 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by lorem, 04-25-2024, 09:18 AM
    18 responses
    76 views
    0 likes
    Last Post lorem
    by lorem
     
    Started by joselube001, 05-10-2024, 12:17 PM
    4 responses
    20 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by DawnTreader, 05-08-2024, 05:58 PM
    21 responses
    81 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by doihaveto13, Today, 12:46 PM
    2 responses
    4 views
    0 likes
    Last Post doihaveto13  
    Working...
    X