How can I get my ea to read previous days price action and current day price action?
-
How can I get my ea to read previous days price action and current day price action.
I need to use the data for a fomula but 00:00 time is in between that. I need to read the data from 9pm the previous day till 3am of the current day. How do I do that using the functions and constant that I have.
-
You can use candles instead of time. You can know that candle ID of both 23:00 and 03:00 according to the timeframe the bot is ON. Then do tha calculation.
-
How would I do that though in terms of function? Do I use the once a day twice or something? I don't understand how to get it to start checking from yesterday?
-
@Yesthatguy Easy. You know that if we are on the 1H timeframe there are 4 candles between 23:00 and 03:00. That means you can do this at 04:00 every day:

Then you can do as many calculations as required.
-
Thanks so much! Do I then start doing this before or after the once a day function? I understand the logic for the most part but how do I know from when the start candle ID start?
https://fxdreema.com/shared/baQk42Vlc -
You should store that information as soon as the 'once per day' block is executed but only if that block is executed at the exact hour the 'look back period' is closed. Otherwise values would be distorted.