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 Waxavi, Today, 02:10 AM
    0 responses
    1 view
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by TradeForge, Today, 02:09 AM
    0 responses
    2 views
    0 likes
    Last Post TradeForge  
    Started by Waxavi, Today, 02:00 AM
    0 responses
    2 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by elirion, Today, 01:36 AM
    0 responses
    4 views
    0 likes
    Last Post elirion
    by elirion
     
    Started by gentlebenthebear, Today, 01:30 AM
    0 responses
    4 views
    0 likes
    Last Post gentlebenthebear  
    Working...
    X