Hi, I am adjusting an indicator for money management purposes. I wonder if anyone can help with this?
I am using the following calculation to display the number of micro lots to use for a basket system. The basic calculation is simple enough.
oner = 30 pounds in my example and is user definable hence the use of the variable. Percent in this example is 10%.
ObjectSetText ("onerequals", "1R = " + (AccountBalance()/oner/percent) + " micro lots" , 8, "Verdana", Lime);
This works fine and gives me the answer I would expect given my account balance but how can I get this calculation to return a whole number only and, crucially, to round it down to the nearest whole number? So if the return was 1.76493 it would just give me 1.
This isn't a major problem for this display but I also want to use that calculation to display the target for the basket which does rather hinge on having a whole number calculation or it throws out the calculation.
I hope this is fairly straightforward and someone can help?
Thanks
I am using the following calculation to display the number of micro lots to use for a basket system. The basic calculation is simple enough.
oner = 30 pounds in my example and is user definable hence the use of the variable. Percent in this example is 10%.
ObjectSetText ("onerequals", "1R = " + (AccountBalance()/oner/percent) + " micro lots" , 8, "Verdana", Lime);
This works fine and gives me the answer I would expect given my account balance but how can I get this calculation to return a whole number only and, crucially, to round it down to the nearest whole number? So if the return was 1.76493 it would just give me 1.
This isn't a major problem for this display but I also want to use that calculation to display the target for the basket which does rather hinge on having a whole number calculation or it throws out the calculation.
I hope this is fairly straightforward and someone can help?
Thanks