'MqlRates' - identifier already used

 

Hallo, ich kriege diese Fehlermeldung

'MqlRates' - identifier already used

Ich bin aber der Meinung, dass ich MqlRates nur einmal verwendet habe:

//+------------------------------------------------------------------+
//| Includes                                                         |
//+------------------------------------------------------------------+
#include <Trade\Trade.mqh>               CTrade _trade;                    // wird verwendet für die Positionsöffnungen
#include <Expert\Money\MoneyFixedRisk.mqh>   CMoneyFixedRisk _money;       // wird verwendet für die Lot-Größen-Berechnung
#include <Trade\AccountInfo.mqh>         CAccountInfo _account;            // wird verwendet für die Account Information Funktionen
#include <Trade\OrderInfo.mqh>           COrderInfo _order;                // wird verwendet für die Order Information Funktionen
#include <Trade\PositionInfo.mqh>        CPositionInfo _position;          // wird verwendet für die Position Information Funktionen 
#include <Trade\SymbolInfo.mqh>          CSymbolInfo _symbol;              // wird verwendet für die Symbol Information Funktionen
//+------------------------------------------------------------------+
//| Input Variablen                                                  |
//+------------------------------------------------------------------+
input group                "GENERAL"
input ENUM_APPLIED_PRICE   inpAppliedPrice            =      PRICE_CLOSE;    // type of price

input group                "Risiko";
input double               inpRisiko                  =                2;     // Risiko in Prozent vom Kapital
input double               inpKapital                 =                0;     // Kapital, 0 = full account Balance

input group                "EMA"
input ENUM_MA_METHOD       inpEMAMode                 =         MODE_EMA;    // Methode der MAs
input int                  inpFastEMAPeriod           =                8;    // Periode des schnellen EMA
input int                  inpSlowEMAPeriod           =               21;    // Periode des langsamen EMA

input ENUM_TIMEFRAMES      inpLongtermTimeframe       =        PERIOD_H1;    // Timeframe für Longterm
input ENUM_TIMEFRAMES      inpShorttermTimeframe      =        PERIOD_M5;    // Timeframe für Shortterm

input int
//+------------------------------------------------------------------+
//| Variablen                                                        |
//+------------------------------------------------------------------+
//-- Array für Preis-Daten
MqlRates rates[];
//-- EMAs
int slowEMAShorttermHandle, fastEMAShorttermHandle;
double buSlowEMAShortterm[], buFastEMAShortterm[];
int slowEMALongtermHandle, fastEMALongtermHandle;
double buSlowEMALongterm[], buFastEMALongterm[];
   
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   _symbol.Name(Symbol());
   _symbol.Refresh();
   if(!RefreshRates())
     {
      Print("Error RefreshRates. Bid=",DoubleToString(_symbol.Bid(),Digits()),
            ", Ask=",DoubleToString(_symbol.Ask(),Digits()));
      return(INIT_FAILED);
     }
//-- tuning for 3 or 5 digits
   int digits_adjust=1;
   if(_symbol.Digits()==3 || _symbol.Digits()==5)
      digits_adjust=10;
//---
   if(!_money.Init(GetPointer(_symbol),Period(),_symbol.Point()*digits_adjust))
      return(INIT_FAILED);
   _money.Percent(inpRisiko); 
//--- Array sortieren
   ArraySetAsSeries(rates,true);
   ArraySetAsSeries(buFastEMAShortterm,true);
   ArraySetAsSeries(buSlowEMAShortterm,true);
   ArraySetAsSeries(buFastEMALongterm,true);
   ArraySetAsSeries(buSlowEMALongterm,true);
   
   fastEMALongtermHandle  = iMA(_Symbol,inpLongtermTimeframe,inpFastEMAPeriod,0,inpEMAMode,inpAppliedPrice);
   slowEMALongtermHandle  = iMA(_Symbol,inpLongtermTimeframe,inpSlowEMAPeriod,0,inpEMAMode,inpAppliedPrice);
   fastEMAShorttermHandle = iMA(_Symbol,inpShorttermTimeframe,inpFastEMAPeriod,0,inpEMAMode,inpAppliedPrice);
   slowEMAShorttermHandle = iMA(_Symbol,inpShorttermTimeframe,inpSlowEMAPeriod,0,inpEMAMode,inpAppliedPrice);

   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   if(!RefreshRates())
      return;
//--- Arrays befüllen 
  }
//+------------------------------------------------------------------+
//| Kaufen                                                           |
//+------------------------------------------------------------------+
void buy(double abstand, double profitmultiplikator, string comment) {

      double sl=_symbol.Ask()-abstand;
      double check_open_long_lot=_money.CheckOpenLong(_symbol.Ask(),sl);

      if(check_open_long_lot==0.0)
         return;

      //--- check volume before OrderSend to avoid "not enough money" error (CTrade)
      double chek_volume_lot=_trade.CheckVolume(_symbol.Name(),check_open_long_lot,_symbol.Ask(),ORDER_TYPE_BUY);

      if(chek_volume_lot!=0.0) {
         if(chek_volume_lot>=check_open_long_lot)
            _trade.Buy(chek_volume_lot,NULL,_symbol.Ask(),_symbol.Ask()-abstand,_symbol.Ask()+(abstand * profitmultiplikator),comment);
      }
      else
         Print("CMoneyFixedRisk lot = ",DoubleToString(check_open_long_lot,2),
               ", CTrade lot = ",DoubleToString(chek_volume_lot,2));
      //---
}
//+------------------------------------------------------------------+
//| Verkaufen                                                        |
//+------------------------------------------------------------------+
void sell(double abstand, double profitmultiplikator, string comment) {

      double sl=_symbol.Ask()+abstand;
      double check_open_short_lot=_money.CheckOpenShort(_symbol.Bid(),sl);

      if(check_open_short_lot==0.0)
         return;

      //--- check volume before OrderSend to avoid "not enough money" error (CTrade)
      double chek_volume_lot=_trade.CheckVolume(_symbol.Name(),check_open_short_lot,_symbol.Ask(),ORDER_TYPE_BUY);

      if(chek_volume_lot!=0.0) {
         if(chek_volume_lot>=check_open_short_lot)
            _trade.Sell(chek_volume_lot,NULL,_symbol.Ask(),_symbol.Ask()+abstand,_symbol.Ask()-(abstand * profitmultiplikator),comment);
      }
      else
         Print("CMoneyFixedRisk lot = ",DoubleToString(check_open_short_lot,2),
               ", CTrade lot = ",DoubleToString(chek_volume_lot,2));
      //---
}
//+------------------------------------------------------------------+
//| Refreshes the symbol quotes data                                 |
//+------------------------------------------------------------------+
bool RefreshRates()
  {
//--- refresh rates
   if(!_symbol.RefreshRates())
      return(false);
//--- protection against the return value of "zero"
   if(_symbol.Ask()==0 || _symbol.Bid()==0)
      return(false);
//---
   return(true);
  }

Kann mir jemand sagen, woher der Fehler kommt?

 

Dies:

input int
//+------------------------------------------------------------------+
//| Variablen                                                        |
//+------------------------------------------------------------------+
//-- Array für Preis-Daten
MqlRates rates[];

lässt den Compiler dies denken:

input int MqlRates rates[];
Grund der Beschwerde: