Ребят , кто силён в программировании , посмотрите этот блок , помоему здесь ошибка или чегото не хватает ? :question:
//Блок параметров:
double TP=0; //тейкпрофит
double SL=0; //стоплосс
int NewOrder(string Simbol, int Cmd, double Lot, int a_magic_0)
{
double PR=0; //Цена
while(!IsTradeAllowed()) Sleep(100);
if(Cmd==OP_BUY)
{PR=Ask;
if(TakeProfit>0) TP=Ask+TakeProfit*Point;
if(StopLoss>0) SL=Ask-StopLoss*Point;
}
if(Cmd==OP_SELL)
{PR=Bid;
if(TakeProfit>0) TP=Bid-TakeProfit*Point;
if(StopLoss>0) SL=Bid+StopLoss*Point;
}
int tic=OrderSend(Simbol,Cmd,Lot,PR,3,SL,TP,NULL,a_magic_0,0,CLR_NONE);
if(tic<0) Print("Ошибка открытия ордера: ",GetLastError());
return(tic);
}