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 junkone, Today, 11:37 AM
    2 responses
    12 views
    0 likes
    Last Post junkone
    by junkone
     
    Started by frankthearm, Yesterday, 09:08 AM
    12 responses
    43 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by quantismo, 04-17-2024, 05:13 PM
    5 responses
    35 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by proptrade13, Today, 11:06 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by love2code2trade, 04-17-2024, 01:45 PM
    4 responses
    35 views
    0 likes
    Last Post love2code2trade  
    Working...
    X