Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 03:02:04 +0000



Post From: [ACSIL] float conversions

[2013-12-18 01:24:31]
mainframer - Posts: 9
Folks, I'm trying draw a bar for every price tick between the highest high and lowest low on the chart. Is there an array of all the price ticks in the graph?

At first I tried incrementing the lowest low by the sc.TickSize, but the float data types lose their accuracy when I do anything to them.


//My original solution here fails because floats lose information when added.

float highestHigh = sc.BaseData[SC_HIGH][sc.Index];
float lowestLow = sc.BaseData[SC_LOW][sc.Index];

for(float price = lowestLow;
price <= highestHigh;
price += sc.TickSize)
{
//supposed to draw line for each tick, but 'price' float gets skewed.
myDrawFunction(price);
}

Date Time Of Last Edit: 2013-12-18 01:44:46