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 gm7_forum, Today, 05:51 PM
    0 responses
    1 view
    0 likes
    Last Post gm7_forum  
    Started by cre8able, Today, 03:20 PM
    1 response
    9 views
    0 likes
    Last Post cre8able  
    Started by fiddich, Today, 05:25 PM
    0 responses
    3 views
    0 likes
    Last Post fiddich
    by fiddich
     
    Started by gemify, 11-11-2022, 11:52 AM
    6 responses
    804 views
    2 likes
    Last Post ultls
    by ultls
     
    Started by ScottWalsh, Today, 04:52 PM
    0 responses
    4 views
    0 likes
    Last Post ScottWalsh  
    Working...
    X