-
Don't double post! You already had this thread open.
General rules and best pratices of the Forum. - General - MQL5 programming forum #6 (2017) - Javier Santiago Gaston De Iriarte Cabrera: I have a normalized value
double Highest = iHighest(Symbol(),my_timeframe,MODE_REAL_VOLUME,shift,1); double Lowest = iLowest(Symbol(),my_timeframe,MODE_REAL_VOLUME,shift,1);
No you don't. iHighest does not return a double. Perhaps you should read the manual.
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
-
Don't double post! You already had this thread open.
General rules and best pratices of the Forum. - General - MQL5 programming forum #6 (2017) -
No you don't. iHighest does not return a double. Perhaps you should read the manual.
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
yes! Thanks.
-
Don't double post! You already had this thread open.
General rules and best pratices of the Forum. - General - MQL5 programming forum #6 (2017) -
No you don't. iHighest does not return a double. Perhaps you should read the manual.
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
Hi I modified iHigh and the rest to this:
int Highest = iHighest(Symbol(),my_timeframe,MODE_REAL_VOLUME,shift,1); int Lowest = iLowest(Symbol(),my_timeframe,MODE_REAL_VOLUME,shift,1); double Low= {iLow(Symbol(),my_timeframe,Highest)}; double High = {iHigh(Symbol(),my_timeframe,Lowest)}; double Normalizado = (((tick.last - (Low))*100)/((High) - (Low))); if(Normalizado!=-1) { Print(Normalizado); double Normalizado_val[]; ArraySetAsSeries(Normalizado_val,true); int start_pos_n=0,count_n=50; if(!iGetArray_n(Normalizado,0,start_pos_n,count_n,Normalizado_val)) return; }
but getting values over 100 and under 0, and getting an error in iGetArray_n:
2023.06.20 16:59:09.313 Core 01 2013.05.21 17:12:53 ERROR! EA: Mean Reversion Trading Strategy.mq5, FUNCTION: iGetArray_n, amount to copy: 50, copied: -1, error code 4807
why?
The most recent tick is within the range of the current candle. However, your iHighest/iLowest range does not include the current candle as it starts from the previous candle.
So, obviously, the most recent tick can easily be out of the range and break the 0 to 100 normalisation.
- 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 have a normalized value
I'm using Normalizado as handle
And making an array with this
and this:
but getting this error:
what is this and how can I fix this.
Also; not getting values normaliced to 100 ... getting values under 0, how can I fix this?
Also ... How can I print this array?