Группа: Пользователи
Сообщений: 3
Награды: 0
Статус: Оффлайн
|
Санкт' - необъявленный идентификатор test3.mq4 и 84 13 ST=NormalizeDouble(Ask-StopLoss*Point,Digits); и на той же строке возможная потеря данных из-за преобразования типов test3.mq4 подскажите как исправить
extern string TMA="Параметры"; extern int TakeProfit =100; extern int StopLoss =50; extern int Megic = 123; extern double Lots = 0.01; extern int Slippage =5; extern string TimeFrame = "current time frame"; extern int HalfLength = 56; extern int Price = PRICE_CLOSE; extern double ATRMultiplier = 2.0; extern int ATRPeriod = 100; extern bool Interpolate = true;
double PriceHigh,PriceLow,SL,TP; int ticket; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() {
if(Digits==3 || Digits==5) {
TakeProfit*=10; StopLoss*=10; Slippage*=10; }
return(INIT_SUCCEEDED);
} //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+
//---
//+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { PriceHigh=iCustom(NULL,0,"TMA_Fair",TimeFrame,HalfLength,Price,ATRMultiplier,ATRPeriod,Interpolate,1,0); PriceLow=iCustom(NULL,0,"TMA_Fair",TimeFrame,HalfLength,Price,ATRMultiplier,ATRPeriod,Interpolate,2,0);
if(CountBuy()==0 && Ask<=PriceLow)
{ ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,0,0,"tma",Megic,0,Blue); if(ticket>0) { TP=NormalizeDouble(Ask+TakeProfit*Point,Digits); ST=NormalizeDouble(Ask-StopLoss*Point,Digits);
if(OrderSelect(ticket,SELECT_BY_TICKET))
if( OrderModify(ticket,OrderOpenPrice(),ST,TP,0)) Print("Ошибка"); }
}
if(CountSell()==0 && Bid>=PriceHigh)
{ ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,0,0,"tma",Megic,0,Red); if(ticket>0) { ST=NormalizeDouble(Bid+StopLoss*Point,Digits); TP=NormalizeDouble(Bid-TakeProfit*Point,Digits);
if(OrderSelect(ticket,SELECT_BY_TICKET))
if( OrderModify(ticket,OrderOpenPrice(),ST,TP,0)) Print("Ошибка"); } } } //+------------------------------------------------------------------+ int CountSell() { int count=0; for(int trede=OrdersTotal()-1;trede>=0;trede--) { if(OrderSelect(trede,SELECT_BY_POS,MODE_TRADES)) { if(OrderSymbol()==Symbol() && OrderMagicNumber()==Megic && OrderType()==OP_SELL)
count++;
} } return(count); }
int CountBuy() { int count=0; for(int trede=OrdersTotal()-1;trede>=0;trede--) { if(OrderSelect(trede,SELECT_BY_POS,MODE_TRADES)) { if(OrderSymbol()==Symbol() && OrderMagicNumber()==Megic && OrderType()==OP_BUY)
count++;
} }
return(count); } //+------------------------------------------------------------------+
Сообщение отредактировал tchumachenkovlad - Воскресенье, 27.03.2016, 13:01
|