Note: The order must be previously selected by the OrderSelect() function.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Dear all
I want to send two orders that meet the same rule in different day
below is my code
int p=20;
int a,aa;
double vol3=0.1;
double open,type;
datetime b;
if((Ask-Open[0]>=1000*Point || Ask-Open[1]>=1000*Point) && Ask >= iMA(NULL,0,p,0,MODE_SMA,PRICE_HIGH,1)+500*Point && OrdersTotal() == 0 )
{
a=OrderSend(Symbol(),OP_BUY,vol3,Ask,5,Ask-2000*Point,Ask+3000*Point,"LONG",2,0,Blue);
b=OrderOpenTime();
}
if(TimeDayOfYear(TimeCurrent())==TimeDayOfYear(b)+1)
{
if((Ask-Open[0]>=1000*Point || Ask-Open[1]>=1000*Point) && Ask >= iMA(NULL,0,p,0,MODE_SMA,PRICE_HIGH,1)+500*Point&& OrdersTotal() ==1 )
{
a=OrderSend(Symbol(),OP_BUY,vol3,Ask,5,Ask-2000*Point,Ask+3000*Point,"LONG",2,0,Blue);
}
}
but the two orders were sent at the same time,is there anybody knows how to solve the problem...?