Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simple example would help me out

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

    Simple example would help me out

    OK, I'm new to Ninja and can likely figure this out eventually but this is such an easy indicator I thought someone might be able to code it in about 2 mins. I know eSignal EFS pretty well but NinjaScript seems totally different.

    Indicator puts a dot on top of a candle who’s high is greater than or equal to the 2 candles on each side of it. (and vice versa for lows) See attached.

    This code is so simple in my broker’s program:
    if High[3]>=High[4] AND High[3]>=High[5] AND High[3]>=High[2] AND High[3]>=High[1] then begin plot1(High[3], "Up", cyan);
    end
    else
    NoPlot(1);

    if Low[3]<=Low[4] AND Low[3]<=Low[5] AND Low[3]<=Low[2] AND Low[3]<=Low[1]
    then begin plot2(Low[3], "Down", cyan);
    end
    else
    NoPlot(2);

    Thanks for any assistance to shorten my learning curve!
    Attached Files

    #2
    Hello MBAGearhead,

    Thanks for the post and welcome to the NinjaTrader forum:

    I would look into the built in indicator Swing, which identifies highs and lows on both sides of the bars, according to the strength parameter.

    If you're looking for custom coding services, any of our NinjaScript consultants should be able to help:
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Just use the system "Swing" indicator. It does EXACTLY that, and you can even change the swing strength if you want to.

      Comment


        #4
        Thanks, but the "Swing" standard indicator does not work as I would like. Dots are placed in a line until a new swing is made. I just want a single dot and not a whole line. Guess I'll have to try to figure out the code for "Swing" unless someone has something that will work. That "Swing" indicator has over 300 lines of code. The OpenECry code is just a few lines for same thing. Even eSignal EFS is only a dozen lines of code. Much simpler from this Ninja newbie's perspective.

        EDIT: OK, I got it figured out. Took a couple hours but now see that NinjaScript isn't that much different than the others. It just has TONS of extra "Ninja generated" lines of code that you don't really have to do much with for a basic indicator like this.
        Last edited by MBAGearhead; 06-01-2011, 07:46 PM.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        580 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        336 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X