Account.Balance /1000
29 Dec 2016, 05:24
Hey guys
I would like to divide current account balance by 1000, round it up so that it's an integer (whole number like "2" instead of 2.34566)
and store it in a variable so that I can use it as a multiplier later to multiply the initialVolume in the ExecuteMarketOrder
How do I do that?
Cheers

flannery
09 Jan 2017, 00:52
Hi irmscher9
This is what I use.
double accBalance; int Volume; public void beregn_volume() { accBalance = Account.Balance; Volume = Convert.ToInt32(Math.Round(accBalance / 1000.0, 0)); Print("Volume: " + Volume); }Best Regards
Flannery
@flannery