I want my EA to open a buy if the price rises above the highest bar´s closeing price of a 1 hour timeframe.
To find the highest closeing price I use: Highest_Bar = iHighest("EURUSD",PERIOD_H1,MODE_CLOSE,Period_Highest_Bar,1) and then Highest_Bar_Price = Close[Highest_Bar];
Now I open a 5 minute offline chart and a 1 hour offline chart and want to run a backtest with my EA. The choosen timeperiod for the backtest is 5 minutes. I always get the error "4054 - Incorrect series array using". The value of Highest_Bar is -1 and of Highest_Bar_Price 0.
What am I doing wrong? Does this not work on a backtest? I need help, please.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
To find the highest closeing price I use: Highest_Bar = iHighest("EURUSD",PERIOD_H1,MODE_CLOSE,Period_Highest_Bar,1) and then Highest_Bar_Price = Close[Highest_Bar];
Now I open a 5 minute offline chart and a 1 hour offline chart and want to run a backtest with my EA. The choosen timeperiod for the backtest is 5 minutes. I always get the error "4054 - Incorrect series array using". The value of Highest_Bar is -1 and of Highest_Bar_Price 0.
What am I doing wrong? Does this not work on a backtest? I need help, please.