Lot calculation
-
Hello!
I have some issue regarding lot calculation.
I created an EA where it should calculate lot based on ATR. (as screenshot below)
For example: ATR: 0.85 ; Risk : 0.4%; Balance: 10000, then lot should be 0.07 lot.So far it has been working fine, however as I have a new account (with different brokers), the lot calculation didnt work properly. It didnt calculated based on ATR but rather based on risk percentage and balance account.
so like this: Risk : 0.4%; Balance: 10000, then lot was 0.04 lot.Here is the project: see the buy now/sell now block
https://fxdreema.com/shared/QYjQJeMtcI'm assuming this must be some bug, but not sure, because it worked on some account but not in another one.
So, maybe anyone could help? -
Due to different leverages??
-
@andrewfrank I can't see any problem in the logic. Apparently it's a broker's thing.
-
@andrewfrank I am not sure how you get a verified lot size as, the atr that is constantly changing is setting your stop, as your balance changes so will the lot, that's 2 factors dynamically changing your lot. On certain brokers you have things like minimum stop loss, this could also change how your lot is calculated, how are you verifying all parameters are as required to give you your lot?
-
@jstap I am assuming the lot size will be calculated as the tick goes.
@vish @l-andorrà ok thanks! I was assuming this too.