I have built a simple EA but it's not working. I mean it hasn't opened any trade yet.
Please review it and match with my requirements [stated in previous post] and let me know what wrong I did.
*** I think the problem lies in the EarlySignal and M3_Coral_Filter defining in the EA template.
I defined them as 'bool'. But after opening the EA in the chart, I have seen that both these variables are 'False'. Can this be a problem?
*I have attached the used indicators.
My Code:
Code: Select all
#property copyright ""
#property link ""
//--- input parameters
extern double LotSize=1.0;
extern double StopLoss=30.0;
extern double TakeProfit=10.0;
extern int Slippage=5;
extern int MagicNumber=786;
extern bool EarlySignal;
extern bool M3_Coral_Filter;
int BuyOrder;
int SellOrder;
int start()
{
{
double Y1, Y2, Y3, Y4;
Y1 = iCustom(NULL,0,"FIM",EarlySignal,M3_Coral_Filter,1,0);
Y2 = iCustom(NULL,0,"MoneyFlowIndex",EarlySignal,M3_Coral_Filter,1,0);
Y3 = iCustom(NULL,0,"FIM",EarlySignal,M3_Coral_Filter,0,0);
Y4 = iCustom(NULL,0,"MoneyFlowIndex",EarlySignal,M3_Coral_Filter,2,0);
return (Y1);
return (Y2);
return (Y3);
return (Y4);
}
if (Y1==1 && Y2==1)
{
double OpenPrice=Ask;
BuyOrder=OrderSend(Symbol() , OP_BUY , LotSize,OpenPrice,Slippage ,StopLoss ,TakeProfit , "Buy Order",MagicNumber , 0,Blue);
}
if (Y3==0 && Y4==0)
{
OpenPrice=Bid;
SellOrder=OrderSend(Symbol() , OP_SELL , LotSize,OpenPrice,Slippage ,StopLoss ,TakeProfit , "Sell Order",MagicNumber , 0,Red);
}
return(0);
}