MThomp:
What error?
Please , not sure where the error is on the code....... Thank you
void OpenBuyStop()
{
//------
while(true)
{
ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots,price,0,0,price+TakeProfit1*Point,"OpenBuyStop", MagicNumber3,expiration,clrGreenYellow);
if(ticket<0)Print("Error= ",GetLastError());
else
{
Print("ticket:",ticket);break;}
/
}
void OpenBuyStop() { //------ while(true) { while(IsTradeContextBusy())Sleep(1000); ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots,price,0,0,price+TakeProfit1*_Point,"OpenBuyStop", MagicNumber3,expiration,clrGreenYellow); if(ticket<=0)Print("Error= ",GetLastError()); else { Print("ticket:",ticket); break; } } }
Mehrdad Jeddi:
compilation error,. no error message and no output after compiling.
So the other variables would be modified and initialized on your side,No compilation error now !
void OpenBuyStop() { int ticket=-1; double Lots=MarketInfo(_Symbol,MODE_MINLOT); double price=MarketInfo(_Symbol,MODE_ASK)+500*_Point; double TakeProfit1=200; int MagicNumber3=12345; int expiration=0; //------ while(true) { while(IsTradeContextBusy())Sleep(1000); ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots,price,0,0,price+TakeProfit1*_Point,"OpenBuyStop", MagicNumber3,expiration,clrGreenYellow); if(ticket<=0)Print("Error= ",GetLastError()); else { Print("ticket:",ticket); break; } } return; }

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
Please , not sure where the error is on the code....... Thank you
void OpenBuyStop()