Basket Break-Even Levels: Buy, Sell, and Net with Target Price

Basket Break-Even Levels: Buy, Sell, and Net with Target Price
Download ALL MT5 indicators (5917)
YouTube Video Thumbnail



Similar MetaTrader Tools

Basket Break-Even Levels: Buy, Sell, and Net with Target Price

Info

The Basket Break-Even Levels: Buy, Sell, and Net with Target Price is a Indicator for MetaTrader 5 that with grid, averaging, or hedging strategies, multiple positions on a single symbol are common, each at a different price. While the terminal displays individual position profits, it doesn't directly show the price at which the entire group of positions breaks even.

Usage

This tool is typically used for enhancing chart analysis and decision making.

Platform

This Indicator works exclusively on MetaTrader 5 (both build 600+ and newer versions).

Setup

Place the downloaded file in MQL5/Indicators folder via File ? Open Data Folder in MetaTrader 5.


How to Install and Use Basket Break-Even Levels: Buy, Sell, and Net with Target Price

1. Installation: Place your file in the MQL/Indicators folder via "Open Data Folder" and restart your terminal.

2. Loading: Find the indicator in the Navigator, drag it onto your chart, and configure the input parameters in the popup window.

3. Customization: Press Ctrl+I to open the indicator list, select your tool, and click "Properties" to change colors, levels, or visual styles.

4. Updating: Replace the old file in the Indicators folder with the new version and restart the platform to apply changes.

Frequently Asked Questions

Q: Why is my indicator not showing? A: Verify the file is in the MQL/Indicators folder, or try right-clicking the "Indicators" tree in the Navigator and clicking "Refresh."

Q: Do custom indicators slow down the platform? A: Too many complex indicators can impact performance; remove unused ones via the "Indicator List" (Ctrl+I).

Q: Can I use MT4 indicators on MT5? A: No, MQL4 and MQL5 are distinct languages; ensure the indicator is compiled specifically for your platform version.

What this tool does

With grid, averaging, or hedging strategies, multiple positions on a single symbol are common, each at a different price.

Typical Use Case

This Indicator excels in automated trading and technical analysis on MetaTrader 5.

Compatible Platform & Setup

This Indicator works on MetaTrader 5. Place the file in the MQL5/Indicators folder and restart the terminal.

Description & Settings

Related: basket viewer-view statistics on groups of long and short pairs - another powerful indicator for MetaTrader 5 traders.

With grid, averaging, or hedging strategies, multiple positions on a single symbol are common, each at a different price. While the terminal displays individual position profits, it doesn't directly show the price at which the entire group of positions breaks even. This indicator addresses that by drawing and continuously updating the break-even price for your position basket on every tick.

Also recommended: Color PEMA Envelopes Digit HTF - similar indicator with strong performance on MetaTrader 5.


Key Levels Calculated:

- Buy Break-Even (BE): The price at which all open buy positions collectively reach zero profit.
- Sell Break-Even (BE): The price at which all open sell positions collectively reach zero profit.
- Net Break-Even (BE): The price at which all buy and sell positions combined break even. This line is displayed only when both buy and sell positions are active.
- Target Price: The price at which the entire position basket achieves a specified profit, denominated in your account currency.

An information panel in the lower-left corner provides a summary, including the total volume of buy and sell positions, the current floating profit/loss, and the calculated basket break-even levels.

Calculation Methodology

The profit of a position basket is determined by the formula: result(P) = k × ((buy lots − sell lots) × P − (Σ buy lots × open price − Σ sell lots × open price)) + swap. Here, 'k' represents the monetary value of a one-lot move (tick value / tick size), and 'P' is the current price. By setting the result to zero (for break-even) or to a target profit, we can derive each corresponding price level. The 'swap' can be optionally included in the calculation. Break-even levels are exact when swap is excluded. The swap component and target profit calculations utilize the current tick value. For symbols where the profit currency differs from the account currency, these values are close approximations. Spread and commission costs are not factored into these calculations. Buys are closed at the Bid price, and sells at the Ask price, meaning the Buy BE level is a Bid price, and the Sell BE level is an Ask price.

When the volume of buy and sell positions is equal, the basket is fully hedged. In this state, the basket's profit is independent of price fluctuations, and a Net BE level is not applicable. The information panel will indicate this condition instead of displaying a potentially misleading line.

Planned Positions Input

To forecast break-even levels before entering new trades, you can input planned entries. For example: B 0.10 1.0850; B 0.10 1.0820; S 0.05 1.0900. These planned positions are incorporated into the calculations solely for analysis and do not result in actual trades.

Indicator Inputs:

- Only this magic number: Use -1 to consider all positions on the chart's symbol, or specify a magic number to filter positions.
- Include swap: Set to true to include swap costs in calculations; false otherwise.
- Target profit line: Enter the desired profit in account currency. Set to 0 to disable the target profit line.
- Planned positions: Enter planned trades in the format 'B or S, lots, price', separated by semicolons (e.g., B 0.10 1.0850; S 0.05 1.0900). Leave empty to disable.
- Buy / Sell / Net break-even line: Set to true to show or hide each respective break-even line.
- Colours, line style and width: Customizable options designed for readability on both dark and light chart backgrounds.
- Info block, colour and font size: Configure the display of the information panel in the lower-left corner.

Please note: This indicator solely reads and displays position data. It does not open, modify, or close any trades.

You may also like: custom fractals - excellent alternative for indicator users on MetaTrader 5.

Source Code

#property copyright "RobotFX"
#property link "https://robotfx.org"
#property version     "1.00"
#property description "This code is educational. Feel free to use, modify and upgrade as you wish. Visit ROBOTFX.ORG for professional trading tools"
#property indicator_chart_window
#property indicator_buffers 0
#property indicator_plots   0
input long            InpMagic       = -1;
input bool            InpIncludeSwap = true;
input double          InpTarget      = 0.0;

.......

Leave your opinion, ask a question, share some knowledge

⚠ Limitations & Risk Warning

  • This tool is provided for educational and testing purposes only.
  • Past performance does not guarantee future results.
  • Trading involves substantial risk of loss. Use on a demo account first.
  • Results may vary depending on market conditions, broker, and settings.
  • We recommend thorough backtesting and forward testing before using with real funds.
© ROBOTFX Free educational tools by RobotFX. Use entirely at your own risk; we are not liable for any financial losses incurred.