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 funk10101, Today, 09:43 PM
              0 responses
              6 views
              0 likes
              Last Post funk10101  
              Started by pkefal, 04-11-2024, 07:39 AM
              11 responses
              37 views
              0 likes
              Last Post jeronymite  
              Started by bill2023, Yesterday, 08:51 AM
              8 responses
              44 views
              0 likes
              Last Post bill2023  
              Started by yertle, Today, 08:38 AM
              6 responses
              26 views
              0 likes
              Last Post ryjoga
              by ryjoga
               
              Started by algospoke, Yesterday, 06:40 PM
              2 responses
              24 views
              0 likes
              Last Post algospoke  
              Working...
              X