Was trying to find the highest high over a number of minutes when attached to any timeframe chart ....
This code appeared to give wrong values...
mHigh = High[iHighest(NULL, 1, MODE_HIGH, mTimeMins, 0)];
mLow = Low[iLowest(NULL, 1, MODE_LOW, mTimeMins, 0)];
Whereas this appeared to work ....
for(int i = 0; i < mTimeMins;, i++)
{
mHigh = MathMax(mHigh, iHigh(NULL, 1, i));
mLow = MathMin(mLow, iLow(NULL, 1, i));
}
Any explanation would be much appreciated.
TIA
This code appeared to give wrong values...
mHigh = High[iHighest(NULL, 1, MODE_HIGH, mTimeMins, 0)];
mLow = Low[iLowest(NULL, 1, MODE_LOW, mTimeMins, 0)];
Whereas this appeared to work ....
for(int i = 0; i < mTimeMins;, i++)
{
mHigh = MathMax(mHigh, iHigh(NULL, 1, i));
mLow = MathMin(mLow, iLow(NULL, 1, i));
}
Any explanation would be much appreciated.
TIA
If you think I'm mad, I must be mad