Plug-in file for calculating the total profit or loss of trading positions with filtering by type and Magic Number.
Calculates the total profit or loss of positions.
Parameters:
p_l - calculation type: "Profit" ( profit) or "Loss" ( loss)
type_pl - type of positions: "All" , "Buy" , "Sell" , "Sell"
magicNumber - filter by magic number (0 = all)
Returns: total profit/loss in deposit currency
// Profit sum of all items double profitAll = Profit_Position("Profit", "All", 0); // The amount of loss of BUY positions of the Expert Advisor with magik 123 double lossBuy = Profit_Position("Loss", "Buy", 123); // The amount of profit of SELL positions double profitSell = Profit_Position("Profit", "Sell", 0);
Monitoring current results
Analyse the effectiveness of strategies
Riskcontrol
Riskmanagement in experts
Creating trade reports
Implementing closing conditions
Works only in MetaTrader 5
Supports Magic Number filtering
Returns amount in deposit currency
Efficient position override
#include <Profit_and_Loss_Positions.mqh> // Use in expert code double currentProfit = Profit_Position("Profit", "All", 123456);
Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/68505
WPR Monitoring MTF Trend
monitoring varous trends of timeframes in one timeframes
MASTER-WINNERFX-Asim
Trend based grid Expert Advisor for MetaTrader 5 using EMA and RSI indicators. Dynamic lot size is calculated from account balance with minimum and maximum lot protection. Initial trade opens when price confirms trend direction relative to EMA and RSI levels. Grid orders are added at fixed point distance using controlled multiplier. All trades are managed as a basket and closed at defined profit target or maximum loss level. Includes optional news hour pause and market close filter. No DLL or external services required.
nModify Orders
Function for modifying open positions and pending orders
Spread Monitor and Filter
This library provides real-time spread monitoring and statistical diagnostics for MetaTrader 5 symbols. It tracks spread evolution using a lightweight circular buffer and computes running metrics such as average, minimum, maximum, and standard deviation. The library classifies current spread conditions into informational states (low, normal, high, extreme) and offers helper methods to query spread behavior and stability. Optional notifications can be enabled to signal unfavorable market conditions. The library is purely analytical: it does not place trades, manage orders, or modify account state, and is intended to be used as a supporting tool inside Expert Advisors or indicators.