Hi, there,
I want to open 2 trades everyday. Unfortunately the following code is not working. After the first 2 trades in the first day, the global variable "DayofTrade" keeps to be 0 instead of becoming back to -1. Could anyone here give me some help?
Many thanks in advance!
I want to open 2 trades everyday. Unfortunately the following code is not working. After the first 2 trades in the first day, the global variable "DayofTrade" keeps to be 0 instead of becoming back to -1. Could anyone here give me some help?
Many thanks in advance!
Inserted Code
int DayofTrade = -1;
int init(){return(0);}
int deinit(){return(0);}
int start()
{
int MagicNumber=10;
if(Hour()==0 && DayofTrade == -1)
{
OrderSend(Symbol(), OP_BUY, 1, Ask, 3, 0, 0,"my comment",MagicNumber);
OrderSend(Symbol(), OP_SELL, 1, Bid, 3, 0, 0,"my comment",MagicNumber);
DayofTrade=0;
}
return(0);
}