Save assets symbol and volume in an array on multi currency EA

 

Hi,

I'm working to create a function to store current open position assets name and volume in multi currency pair situation. The actual value would be like this,

string CurrPortAssets[]   = {"AUDCAD", "EURUSD", "GBPJPY", "USDCAD"};
double CurrPortLotSizes[] = { 0.1,      -0.1,     0.15,     0.2    };      //+ve - LONG,  -ve - SHORT

I tried to do it like this,

string CurrPortAssets[];
double CurrPortLotSizes[];

//loop through all currency pair
for(int SymbolLoop = 0; SymbolLoop < NumberOfTradeableSymbols; SymbolLoop++)
   {
    //find existing position through counting all position on the currency pair
    for(int i=0; i<=PositionsTotal(); i++)
       {
        ulong ticket = PositionGetTicket(i);
        //if there's no open position, move to next currency pair
        if(!position.SelectByTicket(ticket))
           return false;
        else
           if(position.Symbol() == CurrentSymbol && position.Magic() == GlobalExpertID(SymbolLoop))
              {
               ArrayFill(CurrPortAssets,0,1,position.Symbol());
               
               if(position.PositionType() == POSITION_TYPE_BUY)
		  //buyVolume += position.Volume(); *
                  ArrayFill(CurrPortVolume,0,1,position.Volume());
               if(position.PositionType() == POSITION_TYPE_SELL)
                  //add minus on volume for short position
		  //sellVolume() += -position.Volume(); *
                  ArrayFill(CurrPortVolume,0,1,-position.Volume());
              }
           //totalVolume = buyVolume - sellVolume; *
	   ArrayFill(CurrPortVolume,0,1,totalVolume);
        }
   }

// * = for multi position strategy

at first, EA will loop through all symbol loop and find open position of each currency pair. If currency pair hasn't any open position then move to next currency pair, but if found that there's an open position then EA will store the assets name and assets volume on array variable.

I don't know how to fill the array because of this part of the ArrayFill() function. Since the starting index is dynamic, should I change 0 value to according to SymbolLoop?