getting "next" order size
getting "next" order size
20 Aug 2018, 16:26
is there a way to get the number of shares Lot size or index units calculated properly based on margin or balance ?
i use a multiplocator as a setting
and apply this code
int x = System.Convert.ToInt32(System.Math.Floor((Account.Balance * VMulti))); int result = x % 1000 >= 500 ? x + 1000 - x % 1000 : x - x % 1000;
however this is very premature, not acurate enough and does not include the cost of the assets trades.
is there a way to get the margin requirement per asset and calculate it to a buyable size ?
to give an example, i calculate the initial position size based on the avaiable balance
as example 80.000 account balance multiplicator (VMulti) is 5 results in a 400k (4 lot) position
butthis is only acurate on a USD based Forex pair, and will fail on a index or a stock.