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

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 algospoke, Yesterday, 06:40 PM
    2 responses
    20 views
    0 likes
    Last Post algospoke  
    Started by ghoul, Today, 06:02 PM
    3 responses
    14 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by jeronymite, 04-12-2024, 04:26 PM
    3 responses
    45 views
    0 likes
    Last Post jeronymite  
    Started by Barry Milan, Yesterday, 10:35 PM
    7 responses
    21 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by AttiM, 02-14-2024, 05:20 PM
    10 responses
    181 views
    0 likes
    Last Post jeronymite  
    Working...
    X