Calculate Forex Position Size in MetaTrader

More than four years have passed since I have introduced my online position size calculator for EarnForex.com visitors. Since then it became very popular. A poll shows that about ¼ of this blog’s readers frequently use online Forex calculators, while Google Analytics shows that the current position size calculator form is the 4th most popular destination on EarnForex.com.
OK, enough with the introduction. Today, I would like to present the position size calculator for MetaTrader — an automated tool that can be added to any MT4 or MT5 chart and be used on-the-fly with minimum intervention from trader’s side. This calculator indicator will do your usual position calculation work instantly in a semi-automatic mode. The MT5 version is slightly better than the one for MT4: more obvious input parameter settings, faster recalculation on position entry/stop-loss change and better input parameter preservation in case of code change.
Some features of this MetaTrader tool:

  • Use either account balance or account equity to calculate position size.
  • Change entry/stop-loss points simply by dragging the lines on chart.
  • Does not consume much CPU resources.
  • Automatic reference pair detection rate fetching (may be buggy, especially for non-standard trading instruments).
  • Great potential for customization and enhancements.
  • You can download the code of the MT5 and MT4 versions or read more info about this handy calculator tool.
    Updated: 2013-06-08: Added optional input parameter for take-profit price to calculate reward-to-risk ration of the potential position:

    Updated: 2013-11-11: Added optional input parameter for the indicator to track entry level using current Ask/Bid rate (depending on stop-loss position):

    Updated: 2014-04-11: Reporting some new changes as per discussion in dedicated forum thread. I added more color and style customization options, reordered the output parameters and added potential profit (Reward) output in case take-profit is known:


    If you find any bugs in this MetaTrader indicator or if you have some feature suggestions, please post them using the commentary form below.

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    66 − fifty seven =