Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with Creating Indicator

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

    Help with Creating Indicator

    Hi,

    I have downloaded the Demo Version (love it) and would like to convert a code I developed in Metastock into a NinjaTrader indicator so I can overlay on a chart.

    I've spent 3 days trying to figure it out and have given up in frustration.

    I would appreciate it if anyone can convert the following;

    I'll explain the code in simple terms:

    If CLOSE - OPEN > 0 then OPEN - LOW > 2*(HIGH-LOW)/3.8
    else CLOSE-LOW > 2*(HIGH-LOW)/3.25)



    AND the current 55 weighted moving average is greater than the 55 WMA of 5 bars ago.



    AND the Low of the current bar is lower than the lowest low of the last 7 bars.


    AND the current bar Close < the highest high value close of 5 bars ago



    AND Close < the highest high close of 30 bars ago MINUS -1.5*ATR(15 periods)


    AND the ATR(1 period) > ATR(3 period) or this can be substitued as the current bar range is greater than the average of the past 3 bars range.




    Hope this isn't too difficult.



    Thanks in advance.


    Once I get the hang of NinjaTrader I'll be purchasing it outright to trade FX linked with IB.



    Cheers

    #2
    Hello,

    Post what you have and I can give you pointers. I am sorry we can't code your entire indicator. Maybe a fellow trader will though.

    If you are stumped on how to convert a particular portion of the MT code post the portion you have a question on and I will assist. I know MQL (MT4) as well.
    DenNinjaTrader Customer Service

    Comment


      #3
      OK, the major part I'm having a problem with is the following:

      If CLOSE - OPEN > 0 then OPEN - LOW > 2*(HIGH-LOW)/3.8
      else CLOSE-LOW > 2*(HIGH-LOW)/3.25)

      this is what I have come up with but I get errors but don't know what it needs?
      {
      if(Close[0] - Open[0] > 0);

      (Open[0] - Low[0]) > (2 * (High[0] - Low[0])/3.8);

      else

      (High[0] - Low[0]) > (2 * (High[0] - Low[0])/3.25);
      }

      I've attached a screen shot which only shows the above code and not the rest.


      Thanks
      Attached Files

      Comment


        #4
        Hello,

        OK there are a few things wrong here.

        1- your syntax should should look like this:

        if(...criteria here...)
        {

        //do something

        }
        else if(...criteria here...)
        {

        //do something

        }

        Or you may want:

        if(...criteria here... || ...criteria here...)
        {

        //do something

        }

        Note: || means "or". Play with that and see where it goes. The two above will yield very different results and it will matter what you are trying to do. Also, note that there are no ";" anywhere above. They would only appear in the //do something statements...at the end.
        DenNinjaTrader Customer Service

        Comment


          #5
          Thanks I'll give it a try.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          576 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 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
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X