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 samish18, Yesterday, 08:31 AM
    2 responses
    8 views
    0 likes
    Last Post elirion
    by elirion
     
    Started by Mestor, 03-10-2023, 01:50 AM
    16 responses
    389 views
    0 likes
    Last Post z.franck  
    Started by rtwave, 04-12-2024, 09:30 AM
    4 responses
    31 views
    0 likes
    Last Post rtwave
    by rtwave
     
    Started by yertle, Yesterday, 08:38 AM
    7 responses
    29 views
    0 likes
    Last Post yertle
    by yertle
     
    Started by bmartz, 03-12-2024, 06:12 AM
    2 responses
    23 views
    0 likes
    Last Post bmartz
    by bmartz
     
    Working...
    X