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

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 mattbsea, Today, 05:44 PM
          0 responses
          4 views
          0 likes
          Last Post mattbsea  
          Started by RideMe, 04-07-2024, 04:54 PM
          6 responses
          31 views
          0 likes
          Last Post RideMe
          by RideMe
           
          Started by tkaboris, Today, 05:13 PM
          0 responses
          2 views
          0 likes
          Last Post tkaboris  
          Started by GussJ, 03-04-2020, 03:11 PM
          16 responses
          3,282 views
          0 likes
          Last Post Leafcutter  
          Started by WHICKED, Today, 12:45 PM
          2 responses
          20 views
          0 likes
          Last Post WHICKED
          by WHICKED
           
          Working...
          X