i'm trying to write a function for round the last digits of an asset to the TICKSIZE.
Example: Input: 1256,57 TickSize: 0.05
I want to force the input price to 1256,55 or 1256.60 Anyone can help me please?
CodePudding user response:
Divide the price by the tick size. Round your answer to a whole number, multiply this by your tick size. Easy!
Comment("Modified price is ",double(int(Bid/0.05))*0.05);