Commissions are important to know for backtesting but not accessible New comment chinaski 2020.09.22 15:25 This code always returns zero for commissions void OnTradeTransaction(const MqlTradeTransaction& trans, const MqlTradeRequest& request, const MqlTradeResult& result) { if(trans.symbol == Symbol()) { if((int) trans.deal_type == (int) __order_type && trans.type == TRADE_TRANSACTION_DEAL_ADD ) { ++__trans_count; __last_entry=trans.price; double volume=trans.volume; double commissions=HistoryDealGetDouble(trans.deal,DEAL_COMMISSION); PrintFormat("entry-price=%.8f commissions=%.2f transcount=%d",__last_entry,commissions,__trans_count); } } } William Roeder 2020.09.22 17:51 #1 Don't double post! You already had another thread open. General rules and best pratices of the Forum. - General - MQL5 programming forum 2017.07.19 New comment
This code always returns zero for commissions