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

No Value

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

    No Value

    Hi

    i'm trying to write a simple indicator to highlight simple engulfing patterns ... if I do this i get both plots


    EngulfingUp.Set(0,Low[0]);
    EngulfingDn.Set(0,High[0]);

    if I do this I get nothing ?

    if (Open[0] <= Close[1] && Close[0] >= Open[1]) EngulfingUp.Set(0,Low[0]);
    else if (Open[0] >= Close[1] && Close[0] <= Open[1]) EngulfingDn.Set(0,High[0]);

    Do I need to set a value for every plot for every bar ... is there a NOVALUE constant or something ?

    Thanks

    Paul

    #2
    Hello Paul,

    Thank you for writing in.

    When you plot, you need at least two consecutive plots in a row for any 1 plot segment to show. (You need two bars next to each other to draw a segment between them)

    When one is detected, you can set the current bar and the previous bar at the same time. This would make it show.

    if (Open[0] <= Close[1] && Close[0] >= Open[1])
    {
    EngulfingUp.Set(Low[0]); <- sets the value for the plot on the current bar
    EngulfingUp.Set(1, Low[0]); < - sets the value for the plot on the previous bar
    }
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by kevinenergy, 02-17-2023, 12:42 PM
    118 responses
    2,778 views
    1 like
    Last Post kevinenergy  
    Started by briansaul, Today, 05:31 AM
    0 responses
    9 views
    0 likes
    Last Post briansaul  
    Started by fwendolynlpxz, Today, 05:19 AM
    0 responses
    5 views
    0 likes
    Last Post fwendolynlpxz  
    Started by traderqz, Yesterday, 12:06 AM
    11 responses
    28 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X