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:	49
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 cmoran13, 04-16-2026, 01:02 PM
    0 responses
    43 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    25 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    162 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    98 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    158 views
    2 likes
    Last Post CaptainJack  
    Working...
    X