Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

macd crossover

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

    macd crossover

    hi

    How can I develop a strategy that is based on the fast crossing over the slow in a macd ?
    So far I have only been able to get rising or falling macd to work properly.
    Cant seem to pull the slow or fast out of macd for a crossover strategy.

    thanks

    shane

    #2
    Shane, you could check into the attached example from the wizard interface. It would execute Market Orders to go Long / Short on the MACD plot crossing the AVG plot of the MACD system indicator.
    Attached Files
    BertrandNinjaTrader Customer Service

    Comment


      #3
      hi

      thanks for that

      after looking at the code, I could not see how to do the one plot crossing over the other.
      But I can just save that and build off of that right ?
      It is not protected code ?
      How do you select the macd plot out of the macd indicator, or just select the avg plot ?
      I seem to only be able to select the whole indicator.

      anyway, thanks so much for the sample
      I appreciate that.

      shane

      Comment


        #4
        Shane, it's not protected in any way but done via the wizard interface. You can hit the view code button and then would see this condition used - the default MACD value is checked for a cross with the .Avg Plot value:

        if (CrossAbove(MACD(12, 26, 9), MACD(12, 26, 9).Avg, 1))
        {
        EnterLong(DefaultQuantity, "");
        }
        BertrandNinjaTrader Customer Service

        Comment


          #5
          thanks for pointing it out !
          I overlooked that.
          I appreciate your help with this.

          thanks again

          shane

          Comment


            #6
            i had been looking at the other macd sample which appears to be a rising and falling macd.

            thanks
            shane

            Comment


              #7
              No worries Shane, glad to help.
              BertrandNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by bortz, 11-06-2023, 08:04 AM
              47 responses
              1,606 views
              0 likes
              Last Post aligator  
              Started by jaybedreamin, Today, 05:56 PM
              0 responses
              9 views
              0 likes
              Last Post jaybedreamin  
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              19 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by Jon17, Today, 04:33 PM
              0 responses
              6 views
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              15 views
              0 likes
              Last Post Javierw.ok  
              Working...
              X