I have been testing this EA for a while now. But it's not Performing as Expected.
My requirement was that the EA should Open trade just Once after fulfilling a trading condition.
Like if the 'Buy' condition is met, it'll Open Buy trades just Once. It wont open any more trade
if the current trades got closed somehow unless Sell condition is met. Then it'll open Sell trades.
But often this EA is opening consecutive Buy/Sell trades even after closing of existing Buy/Sell trades.
Again, it was supposed to open pre-defined number of trades like 2/3 trades at once but it's not
following that too! Often it's failing to open more than One trade at once.
Another concerning matter is, I'm running this EA on a VPS. Now the EA isn't Opening trades
often even though the Trading condition got met already. Then if I restart the Meta Trader terminal,
it opens all the Due orders instantly according to the current market condition! I searched the 'Experts' and 'Journal' tabs but haven't found
any 'Error' message about Opening trades.
So please enlighten the Flaws in this EA for which it's not performing correctly.
The opening order problem is there :
int Two_Sell_Orders(double LotSize_3,int TakeProfit_2,int TakeProfit_3,int StopLoss_1,int Slippage_1)
dTakeProfitPrice_2 = NormalizeDouble(OpenPrice - TakeProfit_2 * dPip,Digits);
dTakeProfitPrice_3 = NormalizeDouble(OpenPrice - TakeProfit_3 * dPip,Digits);
if(SellOrder_1>0) //Checking if the order was opened or not
Print("Sell Order 1 Opened");
Print("Error in opening Sell order 1");
if(SellOrder_2>0) //Checking if the order was opened or not
Print("Sell Order 2 Opened");
Print("Error in opening Sell order 2");
If someone want to open two order in a row, just put two OrderSend( )
int tick_1 = -1;
tick_1 = OrderSend ( );
if( tick_1 > 0 )
int tick_2 = -1;
tick_2 = OrderSend( )
if(tick_2 >0 ) => exit
Not sure whether you are Kidding or not but there are those lines:
if (Fast_MA>Slow_MA && !Buy_Once)
if (MA_Difference_1>=Value_Diff && iOpenOrders_Buy ==0)
Yes you are right, there is some command orders I have not see.
This EA is poorly coded, one would have to code it all again to make it work,
You can find lots of cross MA EA coded properly on the Net, it would be faster