Calculate Net Profit Per Currency Pair
Thanks 7bit, although I have already looked at this indicator and it is not what I am looking for. I just want to simply calculate the profit as an integer on the chart per currency pair. Just a simple line of code is all im looking for.
I've got an EA that runs on multiple currency pairs and I want to display on the chart the total net profit for that respective pair that the EA has made or lost.
How would I calculate this?
for(int pos=0; pos < HistoryTotal(); pos++) if ( OrderSelect(pos, SELECT_BY_POS, MODE_HISTORY) // Only orders && OrderMagicNumber() == magic.number // w/ my magic number, && OrderSymbol() == Symbol() // and my pair. && OrderType() <= OP_SELL){ // Avoid cr/bal https://forum.mql4.com/32363 profit += OrderProfit()+OrderCommission()+OrderSwap();
I've got an EA that runs on multiple currency pairs and I want to display on the chart the total net profit for that respective pair that the EA has made or lost.
How would I calculate this?