Hi I'm having an EA there are total count trades of loss and won and total trade which way of counting loss trades when the stop loss have been reached of with a small of -1.23 USD which way to count loss on the EA thanks
- Modifying a Position - Trade - MetaTrader 5 for Android
- Moving Average - Trend Indicators - Technical Indicators - Price Charts, Technical and Fundamental Analysis
- Parameters and arguments
Lungile Mbanjwa:
Hi I'm having an EA there are total count trades of loss and won and total trade which way of counting loss trades when the stop loss have been reached of with a small of -1.23 USD which way to count loss on the EA thanks
Hi I'm having an EA there are total count trades of loss and won and total trade which way of counting loss trades when the stop loss have been reached of with a small of -1.23 USD which way to count loss on the EA thanks
You should count a loss based on the deal profit
double profit = HistoryDealGetDouble(ticket, DEAL_PROFIT); if(profit < 0.0) { /* count as loss */ }If you want to ignore/exclude near‑breakeven fluctuations apply threshold if(profit < -2.00).
Lungile Mbanjwa:
Hi I'm having an EA there are total count trades of loss and won and total trade which way of counting loss trades when the stop loss have been reached of with a small of -1.23 USD which way to count loss on the EA thanks
Hi I'm having an EA there are total count trades of loss and won and total trade which way of counting loss trades when the stop loss have been reached of with a small of -1.23 USD which way to count loss on the EA thanks
Great point by Oleksandr. However, to be more precise, you should consider DEAL_PROFIT + DEAL_COMMISSION + DEAL_SWAP.
Sometimes a trade hits a small Take Profit, but after deducting commissions and swaps, the net result is negative.
If you want to count 'Economic Losses,' use the net profit. If you only care about 'Price Action' (whether the SL was hit), then checking the DEAL_PROFIT or the DEAL_REASON (to see if it was DEAL_REASON_SL ) is the way to go.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register