Breakeven line buy sell
- 指标
- Sergei Ivanov
- 版本: 1.1
Welcome to the "Breakeven Line" indicator, version 1.1, developed by Sergei Ivanov in 2025. Visualize breakeven price levels for your trades with precision and ease.
Advisor Description
The "Breakeven Line" is a MetaTrader (MQL5) indicator that displays breakeven price levels for open buy and sell positions on the current symbol, factoring in commissions and swaps for accurate risk management.
Key Features:
- Dual Lines: Plots Buy Breakeven (Dark Violet) and Sell Breakeven (Deep Pink) lines, showing prices where positions reach zero profit.
- Magic Number Filter: Optionally filters positions by Magic Number (default: 0 for all positions).
- Real-Time Updates: Recalculates when open positions change, ensuring accuracy.
- Cost Adjustments: Includes swaps and commissions for realistic breakeven points.
- Responsive Display: Adjusts line positions dynamically on chart resizing or scrolling.
How It Works:
- Initializes two buffers for Buy and Sell breakeven prices, set to chart precision.
- Scans open positions for the symbol, filtering by Magic Number if set.
- Calculates breakeven prices:
- Aggregates volume-weighted open prices, adjusted for swaps and commissions.
- Buy Breakeven: Total adjusted buy price / total buy volume.
- Sell Breakeven: Total adjusted sell price / total sell volume.
- Draws persistent horizontal lines, updated on position changes or new bars.
- Adjusts line visibility via chart events (e.g., resizing).
Usage Notes:
- Best for traders with open positions to track breakeven points.
- Set Magic Number to monitor specific EA trades or use 0 for all.
- Lines remain visible across the chart, color-coded for clarity.
Technical Details:
- Type: Two DRAW_LINE plots.
- Buffers: Breakeven_Buy, Breakeven_Sell.
- Input: MagicNumber (default: 0).
- Platform: MetaTrader (MQL5).
- Version: 1.1, © Sergei Ivanov, 2025.
Limitations:
- Requires open positions to display lines.
- Assumes doubled entry commission for round-trip costs.
- Depends on valid market data.
For feedback and PARTNER PROGRAM: Facebook.
The "Breakeven Line" indicator offers traders a clear, cost-adjusted view of breakeven levels, enhancing trade and risk management.