Utility · MT5

Position Sizer MT5

by Amaljeevs

This MetaTrader 5 utility calculates lot sizes based on account balance, risk percentage, and stop-loss distance.

GitHub stars2
Forks1
Last update1 year ago4 Jul 2025
LicenceApache-2.0

Overview

Position Sizer MT5 features a graphical interface with draggable lines for entry, stop-loss, and take-profit levels to assist with precise trade planning. The expert advisor includes a portfolio risk overview, commission accounting, and optional ATR-based volatility adjustments for setting exits. It supports direct trade execution from the chart, including splitting positions into multiple targets. Users can customize visual elements like label visibility, line styles, and font settings to suit their workspace.

Details

Author

Amaljeevs on GitHub

Type

Utility

Platform

MetaTrader 5 (MQL5)

Markets

Any symbol

Timeframes

Any timeframe

Risk profile

No grid, martingale or hedging logic was found in its code or README. That says nothing about how it performs: backtest it first.

Topics

expert-advisorexpertadvisor

Input parameters

Read from Position Sizer.mq5. Defaults are the author's; change them in the EA's Inputs tab.

NameTypeDefaultDescription
ShowMainLineLabelsbooltrueShowMainLineLabels: Show point distance for TP/SL near lines?
ShowAdditionalSLLabelboolfalseShowAdditionalSLLabel: Show SL $/% label?
ShowAdditionalTPLabelboolfalseShowAdditionalTPLabel: Show TP $/% + R/R label?
ShowAdditionalEntryLabelboolfalseShowAdditionalEntryLabel: Show Position Size label?
DrawTextAsBackgroundboolfalseDrawTextAsBackground: Draw label objects as background?
HideAccSizeboolfalseHideAccSize: Hide account size?
ShowPointValueboolfalseShowPointValue: Show point value?
ShowMaxPSButtonboolfalseShowMaxPSButton: Show Max Position Size button?
StartPanelMinimizedboolfalseStartPanelMinimized: Start the panel minimized?
ShowATROptionsboolfalseShowATROptions: If true, SL and TP can be set via ATR.
ShowMaxParametersOnTradingbooltrueShow max parameters on Trading tab?
ShowFusesOnTradingbooltrueShow trading "fuses" on Trading tab?
Show all 40 inputs
NameTypeDefaultDescription
ShowCheckboxesOnTradingbooltrueShow checkboxes on Trading tab?
HideEntryLineOnInstantboolfalseHide Entry line for Instant orders?
AdditionalTradeButtonsADDITIONAL_TRADE_BUTTONSADDITIONAL_TRADE_BUTTONS_NONEAdditional Trade buttons:
sl_label_font_colorcolorclrGreenSL Label Color
tp_label_font_colorcolorclrGoldenrodTP Label Color
sp_label_font_colorcolorclrPurpleStop Price Label Color
entry_label_font_colorcolorclrBlueEntry Label Font Color
font_sizeuint13Labels Font Size
font_facestringCourierLabels Font Face
entry_line_colorcolorclrBlueEntry Line Color
stoploss_line_colorcolorclrGreenStop-Loss Line Color
takeprofit_line_colorcolorclrGoldenrodTake-Profit Line Color
stopprice_line_colorcolorclrPurpleStop Price Line Color
be_line_colorcolorclrNONEBE Line Color
entry_line_styleENUM_LINE_STYLESTYLE_SOLIDEntry Line Style
stoploss_line_styleENUM_LINE_STYLESTYLE_SOLIDStop-Loss Line Style
takeprofit_line_styleENUM_LINE_STYLESTYLE_SOLIDTake-Profit Line Style
stopprice_line_styleENUM_LINE_STYLESTYLE_DOTStop Price Line Style
be_line_styleENUM_LINE_STYLESTYLE_DOTBE Line Style
entry_line_widthuint1Entry Line Width
stoploss_line_widthuint1Stop-Loss Line Width
takeprofit_line_widthuint1Take-Profit Line Width
stopprice_line_widthuint1Stop Price Line Width
be_line_widthuint1BE Line Width
DefaultTradeDirectionTRADE_DIRECTIONLongTradeDirection: Default trade direction.
DefaultSLint0SL: Default stop-loss value, in points.
DefaultTPint0TP: Default take-profit value, in points.
DefaultTakeProfitsNumberint1TakeProfitsNumber: More than 1 target to split trades.

How to install it

  1. 1Download the sourceUse "Download source (.zip)" above, or clone Amaljeevs/MetaTraderPositionSizer from GitHub, and unzip it.
  2. 2Open the data folderIn MetaTrader choose File, then Open Data Folder, and go to MQL5/Experts.
  3. 3Copy the filesCopy the .mq5 file into Experts, and any .mqh files into the Include folder the code expects.
  4. 4Compile in MetaEditorOpen the file in MetaEditor and press Compile. Fix any missing includes the compiler reports.
  5. 5Test before you tradeRun it in the Strategy Tester, then attach it to a demo chart and allow algorithmic trading.
Third-party code. ForexR did not write, test or endorse this EA, and the summary above was generated automatically from its README and code. ForexR lists only repositories with readable source code and never hosts files. Read the code, backtest it and use a demo account first; automated trading can lose money quickly.

Similar expert advisors

Position Sizer

by EarnForex
594 stars

This risk management tool for MetaTrader 4 and 5 calculates optimal lot sizes based on user-defined risk parameters, account balance, and currency. It provides a graphical user interface for setting entry, stop loss, and take profit levels visually on the chart. The expert advisor accounts for commissions, swaps, and m

MT4MT5 Utility
Updated 8 days ago Apache-2.0 GitHub repository of Position Sizer

Trading Panel

by Kashu7100
64 stars

This MetaTrader 5 tool acts as a discretion helper for manual traders to simplify order execution. It automates trade entries by applying calculated risk percentages and setting predefined stop loss and take profit values in pips. The utility features integrated trailing stop functionality, allowing users to define spe

MT5 Utility
Updated 2 years ago GPL-2.0 GitHub repository of Trading Panel

AR Trading Panel

by Andrukas8
37 stars

This MetaTrader 5 utility is a comprehensive manual trading panel and risk management suite. It simplifies order execution by calculating lot sizes based on a defined risk percentage of account equity. Users can manage trades via automated break-even points, multi-mode trailing stops including Fractals, Moving Averages

MT5 Utility SMC / ICT / price actionIndicator crossoverMulti-strategy
Updated 1 year ago None stated GitHub repository of AR Trading Panel

Chart Pattern Helper

by EarnForex
34 stars

This utility for MetaTrader 4 and 5 automates trade execution based on trader-defined chart patterns. Users draw trendlines, horizontal lines, or channels, which the expert advisor monitors to place pending breakout orders. It handles trade entries, stop losses, and take profits according to specific object naming conv

MT4MT5 Utility Breakout
Updated 1 year ago Apache-2.0 GitHub repository of Chart Pattern Helper

MQL Trading Panel

by SSinist3r
28 stars

This expert advisor functions as a manual trading assistant for MetaTrader 4 and MetaTrader 5, designed to simplify discretionary order management. It provides a graphical interface on the chart, allowing users to execute trades with pre-defined risk parameters. The tool includes options for percentage-based risk calcu

MT5 Utility
Updated 5 years ago GPL-2.0 GitHub repository of MQL Trading Panel

CRT Turtle Soup EA

by n30dyn4m1c
21 stars

This MetaTrader 5 expert advisor scans over 60 financial instruments to identify Turtle Soup reversal setups based on Candle Range Theory. It monitors price action for specific three-candle patterns involving a range, a false breakout with a long wick, and a subsequent reversal. The EA operates as an alert-only utility

MT5 Utility Mean reversionSMC / ICT / price action

More utilities

Need a broker for MT5?

Compare regulated brokers that support MetaTrader, with spreads, minimum deposits and leverage side by side.

Compare brokers