Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

weird behavior of CurrentBar & or Count

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

    weird behavior of CurrentBar & or Count

    Hi,

    This is pretty weird. I'm trying to have that indicator consider only the last 120 bars to calculate and draw it's signals.
    This doesn't seem to work... It seems to start about 1000 bars from the last bar of the chart.
    Also check out the Count and CurrentBar print out...

    Thanks
    Thomas
    Click image for larger version

Name:	2024-02-12_14-53-14.png
Views:	42
Size:	372.0 KB
ID:	1290896

    #2
    Hello Thomas,

    If this is historical, you can use the following to start processing after the last 120 bars.

    Code:
    if (State == State.Historical && CurrentBar > Count - 121)
    With the output you want to clear the output window before reloading the script and ensure that there are no other instances of that indicator or other indicators that may be printing.
    (Try creating a test script that prints the time of the bar, CurrentBar, and Count without any other code)
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    566 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    547 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X