This is my first EA. This contains two "ordersend" one after other. If I run Ea in debug mode step by step all is ok. If I run EA in debug mode via F5 EA seize up on the second "ordersend". If I run Ea in normal mode it seize up on second "ordersend". There is someone that can help me? Tanks for every help.
This is the code of my two ordersend:
if(Ticket_Buy == -1)
{
gest_errore();
} else
{
Alert ("Opened order Buy ",Ticket_Buy);
}
if(Fine == true)
{
break;
}
Alert("The request was sent to the server. Waiting for reply..");
Alert("Sleep prima");
Sleep(2000);
Alert("Sleep dopo");
Ticket_Sell=OrderSend(Symb, 5, Lot, prezzo_sell, 2, SL_sell, TP_sell); // invio ordine al server
if(Ticket_Sell == -1)
{
gest_errore();
} else
{
Alert ("Opened order Sell ",Ticket_Sell);
}
if(Fine == true)
{
break;
}
Tanks for all Help.
What bool fine do???
break use within loop sentence.
use return instead of break if you don't use loop
show us the full of the function code
if you don't use Fine to do something your code must be like this
If(ticket >0)
{
Alert("done");
return; // return ticket if you use int function
}
Else{
Alert(GetLastError());
. }
What bool fine do???
break use within loop sentence.
use return instead of break if you don't use loop
show us the full of the function code
if you don't use Fine to do something your code must be like this
If(ticket >0)
{
Alert("done");
return; // return ticket if you use int function
}
Else{
Alert(GetLastError());
. }

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
This is my first EA. This contains two "ordersend" one after other. If I run Ea in debug mode step by step all is ok. If I run EA in debug mode via F5 EA seize up on the second "ordersend". If I run Ea in normal mode it seize up on second "ordersend". There is someone that can help me? Tanks for every help.
This is the code of my two ordersend:
if(Ticket_Buy == -1)
{
gest_errore();
} else
{
Alert ("Opened order Buy ",Ticket_Buy);
}
if(Fine == true)
{
break;
}
Alert("The request was sent to the server. Waiting for reply..");
Alert("Sleep prima");
Sleep(2000);
Alert("Sleep dopo");
Ticket_Sell=OrderSend(Symb, 5, Lot, prezzo_sell, 2, SL_sell, TP_sell); // invio ordine al server
if(Ticket_Sell == -1)
{
gest_errore();
} else
{
Alert ("Opened order Sell ",Ticket_Sell);
}
if(Fine == true)
{
break;
}
Tanks for all Help.