Wierd return for priceHigh and priceLow

Posted By: RTG

Wierd return for priceHigh and priceLow - 08/19/22 00:18

So I'm trying to determine the range of the previous candle using priceHigh(1)-priceLow(1). I also figured I'd query the priceHigh(1) and priceLow(1) functions themselves. This is a sample of what I get for the AUD/USD pair on 5 min bars.

PreviousCandleRange 0
PreviousCandleHigh -1073741824
PreviousCandleLow 1073741824
PreviousCandleRange 0
PreviousCandleHigh -1073741824
PreviousCandleLow -2147483648
PreviousCandleRange 0

Now I'd expect a range of say 10 pips and priceHigh to be something like .7000 and priceLow to be something like .6990, not the massive numbers listed here.
Posted By: AndrewAMD

Re: Wierd return for priceHigh and priceLow - 08/19/22 00:31

Not enough information. Can you post your code?
Posted By: RTG

Re: Wierd return for priceHigh and priceLow - 08/19/22 00:36

printf("\nPreviousCandleHigh %1d", priceHigh(1));
printf("\nPreviousCandleLow %1d", priceLow(1));
printf("\nPreviousCandleRange %1d", (priceHigh(1)) - (priceLow(1)));

Dammit now I can see the problem. Use "f" not "d"
© 2024 lite-C Forums