fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    MA 2 Crossover

    Questions & Answers
    3
    11
    2154
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rosliomar last edited by

      // create an Array for several prices
      double myMovingAverageArray1[],myMovingAverageArray2[];

        // define the properties of the Moving Average1
        int movingAverageDefinition1 = iMA (_Symbol,_Period,20,0,MODE_EMA,PRICE_CLOSE);
        
              // define the properties of the Moving Average2
        int movingAverageDefinition2 = iMA (_Symbol,_Period,50,0,MODE_EMA,PRICE_CLOSE);
        
        // sort the price array1 from the current candle downwards
        ArraySetAsSeries(myMovingAverageArray1,true);
        
        // sort the price array2 from the current candle downwards
        ArraySetAsSeries(myMovingAverageArray2,true);
        
        // Defined MA1, one line,current candle,3 candles, store result 
        CopyBuffer(movingAverageDefinition1,0,0,3,myMovingAverageArray1);
        
        // Defined MA2, one line,current candle,3 candles, store result 
        CopyBuffer(movingAverageDefinition2,0,0,3,myMovingAverageArray2);
        
        // calculate MA1 for the current candle
        double myMovingAverageValue1=myMovingAverageArray1[0];
        
        // calculate MA2 for the current candle
        double myMovingAverageValue2=myMovingAverageArray2[0];
        
        if (   // Check if the 20 candle EA is above the 50 candle EA  
              (myMovingAverageArray1[0]>myMovingAverageArray2[0])
           && (myMovingAverageArray1[1]<myMovingAverageArray2[1])
           )
              {
              Comment ("BUY");
              }
      
        if (   // Check if the 50 candle EA is above the 20 candle EA          
              (myMovingAverageArray1[0]<myMovingAverageArray2[0])
           && (myMovingAverageArray1[1]>myMovingAverageArray2[1])
           )
              {
              Comment ("SELL");
              }     
      

      Why the 2 MA cross not activated Buy or Sell

      roar 1 Reply Last reply Reply Quote 0
      • l'andorrà
        l'andorrà last edited by

        Wow. This is for real programmers. Anyone nearby? 🙂

        (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

        (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

        (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

        1 Reply Last reply Reply Quote 0
        • roar
          roar @rosliomar last edited by

          @rosliomar Where did you get this code? You know, you dont need to code anything when using fxdreema.

          Your if-checks only make comments, not trading actions

          Need small help? Tag me in your post
          Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

          R 2 Replies Last reply Reply Quote 0
          • R
            rosliomar @roar last edited by

            @roar i copy from fxdreema and put in this message box and it came out like that. i tested, it running good. but on real it not work. why?

            1 Reply Last reply Reply Quote 0
            • R
              rosliomar @roar last edited by

              @roar Thank you. what should i do to make it work on real

              roar 1 Reply Last reply Reply Quote 0
              • roar
                roar @rosliomar last edited by

                @rosliomar here is what you are trying to do https://fxdreema.com/shared/sVlEMv8U

                Need small help? Tag me in your post
                Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

                R 1 Reply Last reply Reply Quote 0
                • l'andorrà
                  l'andorrà last edited by

                  Please excuse my ignorance but...where are the arrays he was asking for?

                  (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                  (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                  (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                  roar 1 Reply Last reply Reply Quote 0
                  • roar
                    roar @l'andorrà last edited by

                    @l-andorrà I don't know why he does this with arrays, he's just inserting MA values into arrays and comparing the arrays, instead of directly comparing two MAs which can be done in fxdreema. No reason to complicate it with arrays.

                    Need small help? Tag me in your post
                    Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

                    1 Reply Last reply Reply Quote 0
                    • l'andorrà
                      l'andorrà last edited by

                      Ok. Thanks. 😉

                      (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                      (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                      (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                      1 Reply Last reply Reply Quote 0
                      • R
                        rosliomar @roar last edited by

                        @roar thank you for reply. I follow your EA, when testing the MA line show on the chart. But in real the line not show. Why?. Tq

                        roar 1 Reply Last reply Reply Quote 0
                        • roar
                          roar @rosliomar last edited by

                          @rosliomar the fxdreema EAs never attach the indicators, they only work on the background. If you want to see the lines, you will have to manually add them

                          Need small help? Tag me in your post
                          Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

                          1 Reply Last reply Reply Quote 0
                          • 1 / 1
                          • First post
                            Last post

                          Online Users

                          R
                          B
                          T

                          15
                          Online

                          146.9k
                          Users

                          22.4k
                          Topics

                          122.6k
                          Posts

                          Powered by NodeBB Forums | Contributors