How to find the time that price reached a certain level

 

Hello.

Is it possible to find the time that price reached a certain level? I understand that we can easily find the OHLC prices using time, but what if I want to find the time using price. Let me elaborate:

lets say:

Open=4USD.

High=10USD.

Low=2USD.

Close=8USD.


The open and the close prices depend on the timeframe so I have no problem with that. But what if, in the example above, I wanted to find the time that prices hit 6USD? or 9USD? is it possible? If so, how can I go about it?

 
it's not possible to check the time of ticks in history data.

but you can record time by new ticks.
 
may i ask how?
 
JimSingadventure: may i ask how?
datetime when=0;
double   price=0;
void reset_when(double p){ when=0; price = p; }
void add_price(double v){ if(when == 0 && v >= price) when = TimeCurrent(); }

OnTick(){ 
   add_price(Bid);

Was that so hard you couldn't even attempt it?

Murray Mbugua: in the example above, I wanted to find the time that prices hit 6USD? or 9USD? is it possible? If so, how can I go about it?

If one minute resolution is acceptable just search the M1 for the bar that hit. Depending on how the candle formed each price could be hit multiple times.

6USD could be between open to high and high to low, or just low to high or low to close, depending on which was hit first. 9USD is ambiguous, could be between open to high and high to low, or low to high and high to close.

Reason: