@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
R
Latest posts made by rosliomar
-
RE: MA 2 Crossoverposted in Questions & Answers
-
RE: MA 2 Crossoverposted in Questions & Answers
@roar Thank you. what should i do to make it work on real
-
RE: MA 2 Crossoverposted in Questions & Answers
@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?
-
MA 2 Crossoverposted in Questions & Answers
// 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