Looking at indicators a specific time in the past

 

I am working on making my EA able to look to see if a trend has already started for a currency pair (same EA is covering multiple currency pairs) when an order closes.  From what I have read from the book, searched in this forum, and google searching the only thing I can find is that we can only look at the past completed bars to get data. The closest thing I have found on the forum is this, and it is still looking in bars on the 1M scale.

The plan is to look exactly 20 minutes prior to the present time to find values of the ADX on the 15 minute timeframe.  What I seem to understand is I can only get the 20 minutes in the past by looking either the former bar, or 2 bars ago.  But either way, my wanting to see EXACTLY 20 minutes ago means that I am looking at the time frame of 15:00 to 29:59 minutes ago. Based on where the completed bar is from the present as the current bar is being created.

I have no code since I am not even sure if such a thing I am trying to do is possible to program.  Any input would be highly appreciated.

 
asham:

I am working on making my EA able to look to see if a trend has already started for a currency pair (same EA is covering multiple currency pairs) when an order closes.  From what I have read from the book, searched in this forum, and google searching the only thing I can find is that we can only look at the past completed bars to get data. The closest thing I have found on the forum is this, and it is still looking in bars on the 1M scale.

The plan is to look exactly 20 minutes prior to the present time to find values of the ADX on the 15 minute timeframe.  

Then you will get a value for each M15 bar,  you cannot get values in between M15 bars on the M15 timeframe.
 
RaptorUK:
Then you will get a value for each M15 bar,  you cannot get values in between M15 bars on the M15 timeframe.

So this means if I was wanting to look at an ADX indicator at the time of your post (19:17), I could only see the M15 ADX at times of 19:15 or 19:30?   

I had thought that the current ADX value with a 0 shift would be in a constant flux of change as it received new data from each tick while waiting to complete its bar.  Following the constant changing of the current ADX would then be able to look into the past specifically where a former ADX value was being calculated in its bar.

Apologies if this is similar to kicking a dead horse for you, I  want to thoroughly understand so I do not attempt this in the future from another perspective. Or help another programmer (if you or WHRoeder do not answer first) in the future.

 
asham: see EXACTLY 20 minutes ago means
Means you saved the current value every second for 20+ minutes (600 values)
 
asham:

So this means if I was wanting to look at an ADX indicator at the time of your post (19:17), I could only see the M15 ADX at times of 19:15 or 19:30?   

I had thought that the current ADX value with a 0 shift would be in a constant flux of change as it received new data from each tick while waiting to complete its bar.  Following the constant changing of the current ADX would then be able to look into the past specifically where a former ADX value was being calculated in its bar.

Apologies if this is similar to kicking a dead horse for you, I  want to thoroughly understand so I do not attempt this in the future from another perspective. Or help another programmer (if you or WHRoeder do not answer first) in the future.

Assuming that the iADX value for bar 0 will change from tick to tick then yes,  you are correct it will be in a state of flux.  You can if you wish save the iADX values for bar 0 for each tick but what does that show you ?  it shows you the ADX value based on x whole bar and one partial bar . . . it does not give you the ADX value for a specific point in time.  To do that you would need to build your own history data on the fly and create your own M15 bars based on the last 15 minutes and the 15 before that etc.  This is possible but is probably far more work than you would want to undertake.