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

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 adeelshahzad, Today, 03:54 AM
        5 responses
        32 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by stafe, 04-15-2024, 08:34 PM
        7 responses
        32 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by merzo, 06-25-2023, 02:19 AM
        10 responses
        823 views
        1 like
        Last Post NinjaTrader_ChristopherJ  
        Started by frankthearm, Today, 09:08 AM
        5 responses
        22 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        43 views
        0 likes
        Last Post jeronymite  
        Working...
        X