Diskussion zum Artikel "Swaps (Teil I): Locking und synthetische Positionen" - Seite 2

 

Hallo,
Ich habe den Experten sowohl auf MT4 als auch auf MT5 laufen lassen. Wenn es ein PostFix gibt, wird der Experte nicht laufen und keine Ergebnisse liefern.
Können Sie herausfinden, warum oder es beheben?

Vielen Dank!

 
void FillPairsArray()// Füllen Sie das Array mit den erforderlichen Informationen über die Instrumente
   {
   int iterator=0;
   double correction;
   int TempSwapMode;
   
   for ( int i=0; i<ArraySize(Pairs); i++ )// Symbole zurücksetzen
      {
      Pairs[iterator].Name="";
      }   
   
   for ( int i=0; i<SymbolsTotal(false); i++ )// Symbole aus dem MarketWatch-Fenster prüfen
      {
      TempSwapMode=int(SymbolInfoInteger(Pairs[iterator].Name,SYMBOL_SWAP_MODE));
      if ( StringLen(SymbolName(i,false)) == 6+PrefixE+PostfixE && IsValid(SymbolName(i,false)) && SymbolInfoInteger(SymbolName(i,false),SYMBOL_TRADE_MODE) == SYMBOL_TRADE_MODE_FULL  
      && ( ( TempSwapMode  == 1 )  ||  ( ( TempSwapMode == 5 || TempSwapMode == 6 ) && CorrectedValue(Pairs[iterator].Name,correction) )) )
         {
         if ( iterator >= ArraySize(Pairs) ) break;
         Pairs[iterator].Name=SymbolName(i,false);
         Pairs[iterator].TickSize=SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_TRADE_TICK_SIZE);
         Pairs[iterator].PointX=SymbolInfoDouble(Pairs[iterator].Name, SYMBOL_POINT);
         Pairs[iterator].ContractSize=SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_TRADE_CONTRACT_SIZE);
         switch(TempSwapMode)
           {
            case  1:// in Punkten
              Pairs[iterator].SwapBuy=SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_SWAP_LONG)*Pairs[iterator].TickValue*(Pairs[iterator].PointX/Pairs[iterator].TickSize);
              Pairs[iterator].SwapSell=SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_SWAP_SHORT)*Pairs[iterator].TickValue*(Pairs[iterator].PointX/Pairs[iterator].TickSize);              
              break;
            case  5:// in Prozent
              Pairs[iterator].SwapBuy=correction*SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_SWAP_LONG)*SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_BID)*Pairs[iterator].ContractSize/(360.0*100.0);
              Pairs[iterator].SwapSell=correction*SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_SWAP_SHORT)*SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_BID)*Pairs[iterator].ContractSize/(360.0*100.0);              
              break;
            case  6:// in Prozent
              Pairs[iterator].SwapBuy=correction*SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_SWAP_LONG)*SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_BID)*Pairs[iterator].ContractSize/(360.0*100.0);
              Pairs[iterator].SwapSell=correction*SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_SWAP_SHORT)*SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_BID)*Pairs[iterator].ContractSize/(360.0*100.0);              
              break;              
           }     
         Pairs[iterator].Margin=SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_MARGIN_INITIAL);
         Pairs[iterator].TickValue=SymbolInfoDouble(Pairs[iterator].Name,SYMBOL_TRADE_TICK_VALUE);         // <= dies
         iterator++;
         }
      }
   }

Hallo,
ich habe eine Frage zur Methode FillPairsArray().

Ist in der FillPairsArray()-Methode nicht die Stelle, an der der Wert von SYMBOL_TRADE_TICK_VALUE auf Pairs[iterator].TickValue gesetzt wird, bevor SWAP berechnet wird?

Es scheint, dass er nach der SWAP-Berechnung gesetzt wird.


Ich danke Ihnen.