Symbol.PipValue to two decimal points

Created at 15 Sep 2020, 16:15
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
VL

vldmarton

Joined 26.08.2020

Symbol.PipValue to two decimal points
15 Sep 2020, 16:15


Hello, I'm trying to round PipValue to two decimal points and then use it in a calculation. On EURUSD, Symbol.PipValue returns 8,44872888873869E-05. The calculation goes like this:

var pips = Account.Balance * 5 / 100 / Symbol.PipValue / 20

When I do the math it on my calculator, it shows me the result ~0.294, but if I print the result to log in ctrader, it shows 29590,25 (very roughly, account balance which jumps up and down while trading). I can see that these two numbers are similar, it's just the decimal points that are a bit off. Is there any way I can make ctrader to show the proper result? In this case I would like to get the number 0.294, as that is the lot size I should use when trading.

Thanks.


@vldmarton