Array outside the OnTick function
What you want is already programmed may times : search and study (daily breakout) in documentation, forum and CodeBase: https://www.mql5.com/en/search#!keyword=daily%20breakout
Take one of these and change it according to your ideas. It's a lot faster and much less troublesome.
What you want is already programmed may times : search and study (daily breakout) in documentation, forum and CodeBase: https://www.mql5.com/en/search#!keyword=daily%20breakout
Take one of these and change it according to your ideas. It's a lot faster and much less troublesome.
What you want is already programmed may times : search and study (daily breakout) in documentation, forum and CodeBase: https://www.mql5.com/en/search#!keyword=daily%20breakout
Take one of these and change it according to your ideas. It's a lot faster and much less troublesome.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hey guys, got a problem here: I want my EA to do a price level calculation exactly once per day and compare it to the prize level from the day before. I also want the time the calculation happens to be a user input, as well as it working on multiple timeframes. The way i am doing this is basically with the iHighest function, with the count being a variable. the variable is calculated by the Bars() function and datetime inputs, which are calculated by TimeCurrent, then just picking the year, month and day and string them together in a datetime string form. anyways, main issue right now is, i have to somehow access the datetime from 24 hours before the current datetime. i figured, this could be done by just storing the datetime in an array, and since the calculation is only done once per day you can just assign array[1] = array[0] at the end of the function. however, the array is reset every time the calculations are made, so the array[1] loses its value. taking the array out of the onTick function gives me multiple errors, mainly "array declaration without type", which i dont really understand. no compilation errors if i put it inside the onTick function though. any ideas?