Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarClose event?

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

    BarClose event?

    Sorry for the basic question but I'm not finding this in the NinjaScript docs.

    How can I detect when a bar closes, if I have Calculate.OnPriceChange set? Maybe I'm going about this wrong. I can't seem to find any events that seem to apply better than OnBarUpdate().

    I need the higher resolution data of the OnPriceChange for some of my calls. But other classes need to be called once and only once, after the BarClose event.

    #2
    Hello Chippy,

    Thank you for your post.

    Couple of options here:

    You can save the CurrentBar index to a variable, and then compare the saved value to the CurrentBar value on each price change. If it's different, you'll know it's the first update of the new bar.

    You can also use IsFirstTickOfBar with OnPriceChange and this will return true with the first run through OnBarUpdate of each bar:



    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Perfect, thank you. The IsFirstTickOfBar seems a little more elegant.

      I'm really loving this product.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      646 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      367 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      107 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      569 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      573 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X