Hi, I have a very simple EA, i.e. open two orders at 9:00am, one buy and one sell. It works all right in backtest, but when I use it live on a demo account, the second order is always ignored (Only open the buy orders). Could anybody tell me where the mistake is?
Many thanks!
Many thanks!
Inserted Code
extern double Stoploss=0.01;
extern double RSIPeriod=14;
extern double TheHour = 9;
int DayOfTrade = -1;
int init(){return(0);}
int deinit(){return(0);}
int start()
{
double RSI1;
RSI1=iRSI(NULL,PERIOD_H1,RSIPeriod,PRICE_CLOSE,1);
if(RSI1>20 && RSI1<80 && Hour() == TheHour && Day() != DayOfTrade )
{
OrderSend(Symbol(), OP_BUY, 0.1, Ask, 3, Ask - Stoploss, Ask + 3*Stoploss);
OrderSend(Symbol(), OP_SELL, 0.1, Bid, 3, Bid + Stoploss, Bid - 3*Stoploss);
DayOfTrade = Day();
}
return(0);
}