Login Page - Create Account

Support Board


Date/Time: Thu, 02 May 2024 20:05:11 +0000



Post From: [ACSIL] float conversions

[2013-12-18 15:46:14]
jackw - Posts: 57
You can eliminate the cumulative effect of the float inaccuracies by working with price in ticks.


int highestHigh = Round(sc.BaseData[SC_HIGH][sc.Index] / sc.TickSize);
int lowestLow = Round(sc.BaseData[SC_LOW][sc.Index] / sc.TickSize);

for(int price = lowestLow; price <= highestHigh; price++)
{
myDrawFunction((float)price * sc.TickSize);
}