Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Calculate profit loss on LinePrice - MetaTrader 4 Expert - MT4/MT5 Resources

author EAcpu | 2 reads | 0 comments |

Calc Profit Loss on LinePrice - expert for MetaTrader 4

Based on code from Igor V. Kim aka KimIV. The code has been improved as requested by many traders.

This Expert Advisor calculates the profit or loss of the deposited currency of all market orders opened on the current chart at the desired price of the symbol. The calculation is performed using the horizontal lines placed by the trader and specifying the "LP" name in the parameters.

Create a line and rename it "LP". When the line is moved, the profit/loss will be recalculated, showing the profit/loss at the price where the line is.

If a MagicNumber is specified, only orders with that magic will be considered in the calculation. At MagicNumber -1, any order of the current symbol will be used for calculation.

Calc Profit Loss on LinePrice - expert for MetaTrader 4


Attachment download

📎 calc_profit_loss_on_lineprice.mq4 (4.83 KB)

Source: MQL5 #13330

Verification code Refresh