You could use MarketInfo(Symbol(), MODE_TICKSIZE) and MODE_TICKVALUE
Thanks, but I mean calculate the maximum lotsize, which will cause stopout, if 130 pips lost.
StopoutLevel =100 means you get stopped out when 100% of your balance is used up as margin and/or as losses, i.e. when Balance = margin + losses
Assuming you have only 1 order, and no other orders are open:
one_point = value of one point change for 1 lot.... often this is MODE_TICKVALUE
one_margin = margin size for one lot... this is MODE_MARGINREQUIRED
Lots = number of lots in the order
Balance = Lots * one_margin + Lots * 1300 * one_point
--> Balance = Lots * ( one_margin + 1300 * one_point )
--> Lots = Balance / ( one_margin + 1300 * one_point )
Note: I haven't checked this.. just maths.
PS of course, if your broker charges commission, you need to put that in the equation too, Also the 1300 points includes the spread
PPS apologies! I always think in points not pips, so I edit the post, 130 pips usually = 1300 points on 5 digits brokers
Thanks, but I mean calculate the maximum lotsize, which will cause stopout, if 130 pips lost.
Yes, you use
MarketInfo(Symbol(), MODE_TICKSIZE) and MODE_TICKVALUE
to calculate how much 1 tick is valued, usually multiply this by 10, (but in not all cases) to find 1 pip value for 1 lot.
Multiply by 130
You then know how much you would lose with a 130 pip loss for 1 lot.
Divide the amount that you can lose by this figure and you have your lotsize.
Of course make sure that it is a valid size using MODE_LOTSTEP and MODE_MINLOT
Yes, you use
MarketInfo(Symbol(), MODE_TICKSIZE) and MODE_TICKVALUE
to calculate how much 1 tick is valued, usually multiply this by 10, (but in not all cases) to find 1 pip value for 1 lot.
Multiply by 130
ticksize and tickvalue is in points not pips.
I realise that my post wasn't that well written, but neither ticksize or tickvalue are expressed in points.
Ticksize is the smallest possible move in the instrument.
Tickvalue is the monetary value of the smallest possible move (for 1 lot) expressed in the deposit currency.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
Given that:
AccountStopoutMode()=0,
AccountStopoutLevel()=100,
leverage=400,
maximum pips retracement which will cause stopout = 130 pips.
How do I calculate the lotsize?
Any idea would be appreciated.
Thanks.