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

Does CurrentBar constantly increment in RT?

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

    Does CurrentBar constantly increment in RT?

    Hi,

    I'm using NT 6.5. I want to write an indicator that updates with each tick, looking for a particular price event to occur within the forming bar - timewise, it could happen anywhere in the bar, so I can't use calculate on bar close (this indicator is for tick and range bars). However, I do only want to process the event once per bar.

    My thought was to use CurrentBar -- update a variable with the CurrentBar value when the event occurs, and then respond to the event again only when the value of CurrentBar has changed.

    Some TA programs support a fixed number of bars loaded, so CurrentBar is always the same value! So my question is, assuming you start NT for intra-day trading, and bars of course are continually created, does CurrentBar itself always show a new, larger value with each new bar? (My feed is Zenfire).

    Thanks!

    Regards,

    Gordon

    #2
    Hello,

    Yes! Think of CurrentBar as the count of bars on the chart at any time. It starts at zero on the left and as the chart grows it increases to x number bars and is incremented each new bar...by one:
    DenNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    158 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Today, 09:29 PM
    0 responses
    6 views
    0 likes
    Last Post Belfortbucks  
    Started by zstheorist, Today, 07:52 PM
    0 responses
    7 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    151 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    6 views
    0 likes
    Last Post mattbsea  
    Working...
    X