Einzelnen Beitrag anzeigen
  #3 (permalink)  
Alt 20.04.13
Racki Racki ist offline
Mitglied
 
Registriert seit: Apr 2011
Ort: Osnabrück
Beiträge: 103
Racki befindet sich auf einem aufstrebenden Ast
Standard

Du meinst sowas?

PHP-Code:
//+------------------------------------------------------------------+
//| Anzahl der Longpositionen                                        |
//+------------------------------------------------------------------+
int CountLong(string countLongSymbolint countLongMagic)
{
   
int CountLongReturn 0;
   if (
OrdersTotal() > )
   {
       for(
int counterCountLong 0counterCountLong OrdersTotal(); counterCountLong++)
       {
           
OrderSelect(counterCountLongSELECT_BY_POSMODE_TRADES);
           if(
OrderSymbol() == countLongSymbol && OrderMagicNumber() == countLongMagic)
           {
              if(
OrderType() == OP_BUY)
                 {
                    
CountLongReturn++;
                 }
           }
       }
   }
   return (
CountLongReturn);
}
//+------------------------------------------------------------------+
//| Anzahl der Shortpositionen                                       |
//+------------------------------------------------------------------+
int CountShort(string countShortSymbolint countShortMagic)
{
   
int CountShortReturn 0;
   if (
OrdersTotal() > )
   {
       for(
int counterCountShort 0counterCountShort OrdersTotal(); counterCountShort++)
       {
           
OrderSelect(counterCountShortSELECT_BY_POSMODE_TRADES);
           if(
OrderSymbol() == countShortSymbol && OrderMagicNumber() == countShortMagic)
           {
              if(
OrderType() == OP_SELL)
                 {
                    
CountShortReturn++;
                 }
           }
       }
   }
   return (
CountShortReturn);

So bekommst du mit
PHP-Code:
int AnzahlLong CountLong(Symbol(),Magic);
int AnzahlShort CountShort(Symbol(),Magic); 
die jeweilige Anzahl der offenen Typen.