fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. rosliomar
    R
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 4
    • Best 0
    • Controversial 0
    • Groups 0

    rosliomar

    @rosliomar

    0
    Reputation
    241
    Profile views
    4
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    rosliomar Unfollow Follow

    Latest posts made by rosliomar

    • RE: MA 2 Crossover

      @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

      posted in Questions & Answers
      R
      rosliomar
    • RE: MA 2 Crossover

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

      posted in Questions & Answers
      R
      rosliomar
    • RE: MA 2 Crossover

      @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?

      posted in Questions & Answers
      R
      rosliomar
    • MA 2 Crossover

      // 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

      posted in Questions & Answers
      R
      rosliomar