StopLoss precision digits

Created at 26 Feb 2018, 01:26
NG

nguyenbaocuong

Joined 16.09.2017

StopLoss precision digits
26 Feb 2018, 01:26


Dear cTrader,

When programing in cAlgo, I notice that with XAUUSD stoploss precision digits must be 0, and with EURUSD is 1.

How can I progam for my cAlgo code know which currency is 0, which currency is 1, and maybe 2 or more?

Thanks!


@nguyenbaocuong
Replies

PanagiotisCharalampous
26 Feb 2018, 14:38

Hi nguyenbaocuong,

You can use the following formula

Math.Log10(Symbol.PipSize / Math.Pow(10, -Symbol.Digits))

Best Regards,

Panagiotis


@PanagiotisCharalampous

nguyenbaocuong
26 Feb 2018, 16:12

Thank Panagiotis for your reply!

That's all I need.


@nguyenbaocuong