Retreiving swap fees with CFD on Indices?

 

Dear all,

I have been able to retreive the swap fees from a closed deal using this little code:

void  OnTradeTransaction(
   const MqlTradeTransaction&    trans,
   const MqlTradeRequest&        request,
   const MqlTradeResult&         result
)
  {
   ulong dealTicket = trans.deal;

   if(dealTicket != 0)
     {
      ulong position = trans.position;
      bool positionSelected = HistorySelectByPosition(position);
      long entry = HistoryDealGetInteger(dealTicket, DEAL_ENTRY);
      if(entry == DEAL_ENTRY_OUT)
        {
        double swap = HistoryDealGetDouble(dealTicket, DEAL_SWAP);
        }
     }
}


When backtesting, I get the swap fees when dealing with currencies but I get 0 fee when trading with CFD on Indices. However, fees actually apply when trading with CFD on Indices manually. What happens?

 

I see a difference when performing:

SymbolInfoInteger(_Symbol, SYMBOL_SWAP_MODE);

For currency I get: SYMBOL_SWAP_MODE_POINTS

For CFD on Indice I get: SYMBOL_SWAP_MODE_INTEREST_CURRENT

But I still don't understand why it shows 0 fee with CFD on Indice when the deal closes.