nProfit and Loss Positions - MetaTrader 5 Library | MT5 EA Download


Plugin file for calculating total profit or loss of a trading position, filtered by type and magic number.
Calculate the total profit or loss of a position.
p_l - Calculation type : "Profit" ( profit) or "Loss" ( loss)
type_pl - position type : "all" , "buy" , "sell" , "sell"
Magic number - filter by magic number (0 = all)
Returns: Total profit/loss in deposit currency
//The total profit of all projects Double the total profit = Profit_Position( "Profit" , "All" , 0 ); // The amount of loss for the buy position of the EA transaction using magick 123 Double loss on buy = profit_position( "loss" , "buy" , 123 ); // profit amount on sell position Double selling profit = profit_position( "profit" , "sell" , 0 );
Monitor current results
Analyze the effectiveness of your strategy
Risk management among experts
Create trade reports
Implement closing conditions
Works only in MetaTrader 5
Support magic number filtering
Return deposit currency amount
Efficient location coverage
#include// used in expert code Double current profit = profit_position( "profit" , "all" , 123456);
Monitor trends in different time ranges within one time range
MetaTrader 5 trend-based grid Expert Advisor uses EMA and RSI indicators. Dynamic lot size is calculated based on the account balance with minimum and maximum lot protection. Initial trading begins when price confirms the trend direction relative to the EMA and RSI levels. Add grid order at fixed point distances using a controlled multiplier. All trades are managed as baskets and end with a stated profit target or maximum loss level. Includes optional news time pause and market close filters. No DLL or external services required.
Function to modify open positions and pending orders
Modern Time Panel for MT5 The Modern Time Panel is a stylish, minimalist custom indicator for MetaTrader 5 that helps you track time accurately. It's neatly pinned to the top right corner of the chart and displays the current broker time, local time, and a live countdown to the next candlestick (new bar). Built-in independent 1-second timer, the countdown will continue to run even if the market is slow or there are no incoming quotes. Fully customizable and suitable for dark mode, it's the perfect non-intrusive tool to ensure you never miss a candle closing.
Attachment download
📎 Profit_and_Loss_Positions.mq5 (10.45 KB)
📎 Profit_and_Loss_Positions.mqh (9.7 KB)
Source: MQL5 #68505
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •