Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Slight Error in Condtional Statement Indicator, need help, Ninja trader 7

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

    Slight Error in Condtional Statement Indicator, need help, Ninja trader 7

    I have a slight error in my conditional statement indicator that I am inputting. The goal is to plot a Black Diamond above the price bars where all of the conditions are true, and have the diamonnd flash on and off of the screen as the conditions are being met on a tick by tick basis.

    So far I have a black diamond appearing over every single price bar....my basic conditions are these: High of current bar >= High of 3 bars ago and Close of current bar < Close of 3 bars ago.

    Here is the ninja script I am using:

    if(CurrentBar<2)return;if((High[0]>=High[-3])&&(Close[0]<Close[-3])); DrawDiamond("tag1" + CurrentBar,true,0,High[0]+(TickSize+.10),Color.Black);
    }

    Any help is much appreciated...for some reason the diamond is being plotted on every bar, so I guess my conditional statements are not being recognized.

    #2
    Originally posted by vern13 View Post
    I have a slight error in my conditional statement indicator that I am inputting. The goal is to plot a Black Diamond above the price bars where all of the conditions are true, and have the diamonnd flash on and off of the screen as the conditions are being met on a tick by tick basis.

    So far I have a black diamond appearing over every single price bar....my basic conditions are these: High of current bar >= High of 3 bars ago and Close of current bar < Close of 3 bars ago.

    Here is the ninja script I am using:

    if(CurrentBar<2)return;if((High[0]>=High[-3])&&(Close[0]<Close[-3])); DrawDiamond("tag1" + CurrentBar,true,0,High[0]+(TickSize+.10),Color.Black);
    }

    Any help is much appreciated...for some reason the diamond is being plotted on every bar, so I guess my conditional statements are not being recognized.
    Correct is:

    Code:
    if(CurrentBar<3) return;
    if((High[0]>=High[3])&&(Close[0]<Close[3])) DrawDiamond("tag1" + CurrentBar.ToString(),true,0,High[0]+(TickSize+.10),Color.Black);
    Your code has a semi-colon terminating the second if statement, turning it into a null statement, so your drawing code would be called on every bar.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    571 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    548 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    549 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X