Topics

Forum Topics not found

Replies

MegaCynic
04 Mar 2022, 23:17

RE: Pip rounding

Thank you @amusleh for that code snippet. I've missed taking pipSize into account.

Do you know of any case where Symbol.TickSize is not 1/Math.Pow(10, Symbol.Digits)? The Remarks for the TickSize description makes me think it always is (which would allow us to simplify the result calculation).

 


@MegaCynic

MegaCynic
02 Mar 2022, 14:15

RE: RE: RE: precision if stopLoss or takeProfit is specified in pips

firemyst said:

Is Symbol.Digits what you're looking for? https://ctrader.com/api/reference/internals/symbol

I'm running into the same problem right now and I don't see any value that would tell me at what precision to round the StopLoss/TakeProfit values.
 Symbol.TickSize is 1/ 10^Symbol.Digits for all symbols I've checked, which is at least one off for most, but sometimes even more. The UI seems to have the information somewhere, as for a manual trade you can't enter more precision than allowed. I'd love to know what it uses.

Thanks, Rolf.


@MegaCynic