Login Page - Create Account

Support Board


Date/Time: Tue, 04 Mar 2025 17:05:32 +0000



Post From: rounding my target calculation to the next valid tick price

[2021-12-17 12:38:52]
User61576 - Posts: 445
i am calculating my target price using this line:
target1Price = mktPrice + (tPriceInput.GetInt() * ATR_calc);
tPriceInput.GetInt() = getting a user input for multiplier
ATR_calc = getting the ATR in that bar
the results is that sometimes i will submit a price like "15765.050003" (trading NQ) so correct price should be 15765.00

is there any function to round to the next valid tick size so this will work for both ES or NQ etc.?

thanks