Check the documentation of iLowest/iHighest and what value is returned.
ah so it is an integer, why then would it be set to 2?
ah so it is an integer, why then would it be set to 2?
Why not ? :-)
how can iLowest/Highest be 2 when the data for highest and lowest is always a double of considerably less value than 2..
ah so it is an integer
It is indeed an integer. A very common misconception is that iHighest and iLowest return the highest and lowest values respectively. They don't. They return the bar index that contains the highest/lowest values.
If the highest value is 1.10045 and it occurred on the previous bar, iHighest returns 1 (not 1.10045)
- Do you know what a fractal is? Two lower highs on the left (bars 3 and 4,) two lower highs on the right (bars 0 and 1,) highest high in the middle (bar 2.)
Being very, very pedantic... the built-in MT4 definition is very slightly different. It allows one or more equal highs with two lower highs before and after. A valid fractal is therefore not necessarily a 5-bar sequence.
For example, there is a six-bar fractal sequence at 13:31/13:32 today on EURUSD M1 in the MetaQuotes demo server price feed; equal highs at 1.06689. Screenshot attached.
Being very, very pedantic... the built-in MT4 definition is very slightly different. It allows one or more equal highs with two lower highs before and after. A valid fractal is therefore not necessarily a 5-bar sequence.
For example, there is a six-bar fractal sequence at 13:31/13:32 today on EURUSD M1 in the MetaQuotes demo server price feed; equal highs at 1.06689. Screenshot attached.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi I'm going through an old EA I found on a post from some years back, I've come to this and don't understand what logic is behind it.
extern string entrylogics="Entry Logics";
extern int timeframe=0;
extern int period=5;
extern int shift=2; // bar in the past to take in consideration for the signal
{
if(reversesignals)sell=true;else buy=true;
}
if(iLowest(NULL,timeframe,MODE_LOW,period,0)==shift)
{
if(reversesignals)buy=true;else sell=true;
}
I don't understand why == shift is used.. as shift is 2 how can iLowest/Highest be 2 when the data for highest and lowest is always a double of considerably less value than 2..
It's probably me missing something but anyone who can explain this to me will be appreciated!