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
Hi ,
I have a script that sends a new order with an indicator . It works like this :
if (OrdersTotal() < 20 )
{
if (Bid < iMACD(NULL,PERIOD_H1,12,26,9,PRICE_CLOSE,0,1) )
{
OrderSend(Symbol(),OP_SELL,lot,Bid,0,OrderStopLoss,OrderTakeProfit,"1010",40000,0,Orange) ;
return ;
}
}
But there is a loop and the MT4 keeps sending 20 orders with the same symbol pair . What is it possible to do to avoid the loop ?
The new system is set to send different pairs orders at the same time , but only once .
I have tried this :
if (OrdersTotal() < 20 )
{
int send01 = 0 ;
if (Bid < iMACD(NULL,PERIOD_H1,12,26,9,PRICE_CLOSE,0,1) )
{
if ( send01 == 20 ) { return ; }
OrderSend(Symbol(),OP_SELL,lot,Bid,0,OrderStopLoss,OrderTakeProfit,"1010",40000,0,Orange) ;
send01 = 20 ;
return ;
}
}
What is it possible to do for the script to check if there is one entered order with the same symbol and to stop sending new orders ?
Most appreciate a new link