PLease check this code I am using to calculate lot sizes for EURUSD:
it seems to work well because my Account Balance is in USD. So in this case, because USD is the terms currency it works well.
I use this other code for pairs like USDJPY where USD is the BASE currency:
but
what can I do to calculate lot sizes when using different pair
currencies, like EURGBP, EURJPY, CHFJPY,...where USD is not the terms
neither the base currency?
By the way, I have read all former discussions about lot sizes and couldn´t find a direct answer to this question
best regards
uupss, this is the code I am using when USD is the base currency:
double Lots=NormalizeDouble(AccountBalance()*Risk*Ask/100000/Digits/Trail_Stop/10,2);
uupss, this is the code I am using when USD is the base currency:
please replace Digits for Points at the lots calculation, I made that change some time ago but forgoted to mention it.
Please don't flooding the forum by commenting your own topic.
Check MarketInfo's MODE_MARGINREQUIRED for the cost of opening 1 lot, and any other MarketInfo's identifier (https://docs.mql4.com/constants/marketinfo)
And there are plenty in the forum anyway https://www.mql4.com/search#!keyword=lot%20calculation&module=mql4_module_forum
By the way, I have read all former discussions about lot sizes and couldn´t find a direct answer to this question
No you haven't . . .
Read this, but not just the first post: https://www.mql5.com/en/forum/123914
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
PLease check this code I am using to calculate lot sizes for EURUSD:
it seems to work well because my Account Balance is in USD. So in this case, because USD is the terms currency it works well.
I use this other code for pairs like USDJPY where USD is the BASE currency:
but what can I do to calculate lot sizes when using different pair currencies, like EURGBP, EURJPY, CHFJPY,...where USD is not the terms neither the base currency?
By the way, I have read all former discussions about lot sizes and couldn´t find a direct answer to this question
best regards