Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to check values in indicator

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

    how to check values in indicator

    I have 2 indicator plots which start showing values when they are above 0.
    how do I detect the change in indicator value from strategy?
    for eg. when I look at the databox, the indicator shows n/a for the values that I did not plot.
    when I plot the values, I can see the values in the databox.
    so how do I compare if prev indicator value ==n/a and current indicator value>=0 from my strategy?

    this is what I did but I don't see the logic getting executed.
    Code:
       }
    					if(PullbackBounce(20).UP[0]>=0 && !PullbackBounce(20).UP.IsValidDataPoint(1))
    					{
    						Print(Bars.GetTime(1).ToString() +   "Change in direction from short to long" );
    					}
    					
    					if(PullbackBounce(20).Down[0]<=0 && !PullbackBounce(20).Down.IsValidDataPoint(1))
    					{
    						Print(Bars.GetTime(1).ToString() +   "Change in direction from long to short" );
    					}

    #2
    Hello junkone,

    For values to appear in the DataBox, these must be set to a plot.

    Your code does not include the setting of a plot value.

    Is this code incomplete?

    Do you have plots in your script?

    Are you actually referring to the Output Window and not the DataBox?

    Using <Series>.IsValidDataPoint() will let you know if a plot or series has a value.

    Below is a publicly available link to the help guide.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    77 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X