Need a way to input commission cost and calculate swap fees before taking profit - so can be used in live market - something like this:
[send out the mql4 file and I can help you improve it]
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){
if(OrderSymbol()==Symbol()){
if(OrderMagicNumber() == MagicNumber){
double lsize = OrderLots();
//double swap = (OrderSwap()>0) ? OrderSwap() : 0;
double commision = (lsize * Commision_Cost);
realProfit = (realProfit + (OrderProfit() - commision/*+swap*/));
}
}
}
}
// users would inter commission as an input swap would be calculated auto
[send out the mql4 file and I can help you improve it]
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){
if(OrderSymbol()==Symbol()){
if(OrderMagicNumber() == MagicNumber){
double lsize = OrderLots();
//double swap = (OrderSwap()>0) ? OrderSwap() : 0;
double commision = (lsize * Commision_Cost);
realProfit = (realProfit + (OrderProfit() - commision/*+swap*/));
}
}
}
}
// users would inter commission as an input swap would be calculated auto