More than four years have passed since I’ve 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’d 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
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. - Doesn’t 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.
If you find any bugs in this MetaTrader indicator or if you have some feature suggestions, please post them using the commentary form below.
April 8th, 2012 at 10:44 pm
Hello Andrei
I have loaded this great little tool, thankyou for taking the time to build it.
I have one question, the referenece pair never changes from AUDUSD when I load the indicator on to other currency pairs. I have tried changing the label name, but to no avail.
Any help would very much appreciated
Regards
Steve
▼Reply
admin Reply:
April 9th, 2012 at 6:58 am
Are you sure it should be changing? Isn’t your account balance in Australian dollars?
▼Reply
May 10th, 2012 at 1:05 am
I have installed the position size calculator, it works well, however is there any way of using it with a fixed capital risk amount rather than % of capital
▼Reply
admin Reply:
May 10th, 2012 at 6:25 am
Currently, there is no way for that but I might add this feature soon.
▼Reply
admin Reply:
May 10th, 2012 at 12:04 pm
I’ve just added the support for a fixed capital risk to this indicator. Please re-download and make sure it’s version 1.1 (if you are using MT5).
▼Reply
May 20th, 2012 at 3:22 pm
Hi, I get the following message when attempt to use the MT4 position size calculator:
“Failed to detect a proper currency pair for pip valuation.”
Any reason why? I’m using a spread betting account with GBP as the base currency.
Thanks in advance.
▼Reply
admin Reply:
May 20th, 2012 at 7:18 pm
And what pair are you trying to attach the indicator to?
▼Reply
June 18th, 2012 at 7:02 am
hello, i have loaded the indicator to my mt4,i have a dollar account but your Mt4 position size indicator doesnt show the currency pair’s ask price that i am trading & it simply leaves a gap in between the Stop Loss Price and the Risk Percentage. Its supposed to show the ask Price pulled from the market watch window but i cannot seem to do this.Can you help
▼Reply
admin Reply:
June 18th, 2012 at 7:24 am
What currency pair are you attaching it to with your dollar account?
▼Reply
Frank Reply:
June 18th, 2012 at 9:18 am
am attaching it to the USDJPY currency pair,actually i was setting up a trade on the USDJPY. but it seems to show the same problem on all pairs! The ask price of the pair just doesnt appear on the chart. Can you tell me how to set this up properly?
▼Reply
admin Reply:
June 18th, 2012 at 10:52 am
How is USDJPY pair called in the Market Watch window of your MetaTrader?
▼Reply
June 18th, 2012 at 2:37 pm
it is called “USDJPYpro” in the Market Watch Window of my MT4 Trading Platform
▼Reply
admin Reply:
June 18th, 2012 at 6:01 pm
Please re-download and re-install the indicator. Then try again. I’ve tried to correct this bug.
▼Reply
November 2nd, 2012 at 12:03 pm
hi, i had the same problem of frank, my pairs are named **.uni and the position size calculator didnt find them. now with the version (1) you have made it works perfectly. the only thing is that the pop up alert window is still popping up telling that an error occurred but the indicator works fine.
thanks a lot
▼Reply
November 2nd, 2012 at 12:22 pm
sorry, its me again
the indicator worked fine with the pair eurgbp.uni but i tried with the eurjpy.uni and it doesnt work. i didnt try more pairs but i think something must be related to the price. the price of eurgbp is 0.8051 for example but the price of eurjpy is completely different 103.46 for example.
why is this happening? could you sort it out please?
thank you very much
▼Reply
admin Reply:
November 2nd, 2012 at 2:41 pm
I’ve tried to fix it and uploaded the new version of the indicator. Please download again and test it. Let me know if it works for you. By the way, it would really help if you could tell which version you are using – MT4 or MT5.
▼Reply
marketmaster Reply:
November 2nd, 2012 at 3:43 pm
hello admin,
i downloaded the indicator from the link you have above this page and it is still not working with the eurjpy.uni pair
im using the mt4 platform
thank you very much for your time.
▼Reply
admin Reply:
November 2nd, 2012 at 4:44 pm
What broker are you using?
▼Reply
marketmaster Reply:
November 2nd, 2012 at 4:54 pm
universal fx
▼Reply
November 2nd, 2012 at 4:56 pm
i can give you an email if you want to contact them
▼Reply
admin Reply:
November 2nd, 2012 at 5:21 pm
No need to :-).
The indicator should be working now. Try downloading and compiling it again. Do not forget to add USDJPY.uni to your Market Watch window.
▼Reply
marketmaster Reply:
November 5th, 2012 at 11:42 am
sorry admin but the indicator still doesnt work with the eurjpy.uni
could you open a demo account with universal fx and try to make work the position size calculator with those pairs like eurjpy usdjpy etc?
thank you very much
▼Reply
admin Reply:
November 5th, 2012 at 4:35 pm
I did try that before uploading the current version. It is working as seen on the screenshot:

What happens when you try to do attach it to your EUR/JPY chart?
▼Reply
marketmaster Reply:
November 5th, 2012 at 5:15 pm
im trying to add a screen shot too but i dont know how.
basically the position size calculator is alway 0.00 for me meanwhile you have 0.08 on your screen shot and the pop up window comes up with two messages:
…. failed to detect a proper currency pair for pip valuation
…. Try adding all the available currency pairs to market watch
i dont know if im dowloading the indicator from an older link or im doing something wrong when setting it up
thanks you are being very kind
▼Reply
admin Reply:
November 5th, 2012 at 5:23 pm
Please make sure of the following:
1. You download it from here:
http://www.earnforex.com/mt4-forex-indicators/PositionSizeCalculator.mq4
2. Its size is exactly 10809 bytes.
3. If you are adding it to EURJPY.uni, you also need USDJPY.uni in the Market Watch window.
PS: Is your trading account in USD or some other currency?
▼Reply
marketmaster Reply:
November 5th, 2012 at 5:37 pm
finally it is working,
thanks a lot. my account is currently in euros but i tried with USD GBP and EUR.
It probably was that i was downloading the indicator from a non updated link.
thanks again, now i will tell my broker to convert my euros in GBP to try the indicator with a gbp account and i think i wont have any problems
admin Reply:
November 5th, 2012 at 5:46 pm
Good.
When you’ll have a GBP account, you’ll be needing GBPJPY.uni in Market Watch to be able to use the calculator on EURJPY.uni.
January 11th, 2013 at 10:49 pm
Does your MT 4 position sizing work for Gold and Silver as i always get 0.0. Thanks
▼Reply
admin Reply:
January 12th, 2013 at 6:54 am
That depends on how your Gold and Silver symbols are called in your broker.
▼Reply
April 28th, 2013 at 7:28 am
Sorry to hash up an old post as I can see this was last touched almost 4 months ago but I have been using your calculator for quite some time and have just installed the indicator. It seems I am unable to change the reference price the calculator is using.
When I add the indicator to a chart (and pair) I only see the following fields:
Entry level
Stop loss
Risk
Account balance
Risk money
Position size
(There is no open space as described in a previous comment so it looks like it should be working)
However I have found that depending on what pair I am trading the position size it gives me can be wildly out from what I get if I use the online calculator which is telling me that it is not picking up the correct exchange rate for the pair I am on.
I am using a USD account but am trading multiple majors.
Any assistance you could give would be greatly appreciated as I am hoping to incorperate teh outputs from this indicator into my EA.
Regards
Ryan
▼Reply
admin Reply:
April 28th, 2013 at 8:14 am
It would really help if you could provide some examples of its calculations that you believe are incorrect. Please also let me know what platform you are using it in – MT4 or MT5?
▼Reply
ryan4all Reply:
April 28th, 2013 at 1:52 pm
I have just run some more tests manually and it looks like the issue is not with your indicator but rather with my EA that is not updating the chart properly so your indicator is still showing old lot size data.
I will confirm this when the market opens tomorrow but I think this is the issue.
Sorry about that and by the way this is an amazing indicator.
▼Reply
admin Reply:
April 28th, 2013 at 2:31 pm
No problem. Did you mean to say “MT4″ in place of “EA”? If so, then the cause is that the markets are currently closed and even if you drag the lines on chart there is no tick event to recalculate the values.
▼Reply