Comment( "Shift = " + DoubleToStr( Shift, 0 ) + "\nValue = " + DoubleToStr( iLow( NULL, 0, Shift ), 5 ) );Your print out is misleading you:
DoubleToStr( Shift, 0 ) // Equivalent to Shift since it's an int
iLow( NULL, 0, Shift ) // Wrong parameters iLow(symbol,timeframe,TYPE,COUNT,shift)
You mixed up your constants.
Applied price constants. It can be any of the following values:
Constant | Value | Description |
---|---|---|
PRICE_CLOSE | 0 | Close price. |
PRICE_OPEN | 1 | Open price. |
PRICE_HIGH | 2 | High price. |
PRICE_LOW | 3 | Low price. |
PRICE_MEDIAN | 4 | Median price, (high+low)/2. |
PRICE_TYPICAL | 5 | Typical price, (high+low+close)/3. |
PRICE_WEIGHTED | 6 | Weighted close price, (high+low+close+close)/4. |
Series array identifier used with ArrayCopySeries(), iHighest() and iLowest() functions.
It can be any of the
following values:
Constant | Value | Description |
---|---|---|
MODE_OPEN | 0 | Open price. |
MODE_LOW | 1 | Low price. |
MODE_HIGH | 2 | High price. |
MODE_CLOSE | 3 | Close price. |
MODE_VOLUME | 4 | Volume, used in iLowest() and iHighest() functions. |
MODE_TIME | 5 | Bar open time, used in ArrayCopySeries() function. |
int Shift = iLowest( NULL, 0, PRICE_OPEN, 10, 1 ); "Shift" has to be a double.
guys, he has everything right EXCEPT his constants. Maybe a redundant DoubleToStr mixed in there, but it wasn't the problem.
circlesquares:
guys, he has everything right EXCEPT his constants. Maybe a redundant DoubleToStr mixed in there, but it wasn't the problem.
guys, he has everything right EXCEPT his constants. Maybe a redundant DoubleToStr mixed in there, but it wasn't the problem.
if the price is i.e. 1.4560, how can you copy this to an integer ?
the result ist 1.
Because it returns a shift. its the shift of the lowest bar in the range he provides.
circlesquares:
Because it returns a shift. its the shift of the lowest bar in the range he provides.
Because it returns a shift. its the shift of the lowest bar in the range he provides.
ok, my error, iLow returns the value, iLowest returns the shift.
sorry...
php,perl,c++,html,css and mq4 at the same time can produce strange results while hacking ;-)

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi
I trying to use the lowest low over the previous 10 bars, but I am getting strange results from iLowest(). Do others have this problem? Am I doing something wrong?
It appears to mix up the type constants. I've tested it on M1 & M5 because they move faster.
Any suggestions would be appreciated.Cheers
Jellybean