Time vs Price indicator

 

I have been searching for a long time for an indi that can show me how long the price has been above or below the halfway point of the current bar.

eg if 60min TF =100% the if the price spends 75% above and 25% below you would tend to look at going long and vice versa for sell.

Any help would be great

 

See if I understand:


time_frame = 60 minutes (configurable)

halfway_point = (High-Low)/2

total_time=60 minutes

time_above = (accounted_time_above/total_time)*100

time_below = (accounted_time_below/total_time)*100

PLOT(time_above,time_below)



I've subscribed to this topic. See if my interpretation is ok, because I want to test it, and of course I will give you the code.

 
abstract_mind wrote >>

See if I understand:

time_frame = 60 minutes (configurable)

halfway_point = (High-Low)/2

total_time=60 minutes

time_above = (accounted_time_above/total_time)*100

time_below = (accounted_time_below/total_time)*100

PLOT(time_above,time_below)

I've subscribed to this topic. See if my interpretation is ok, because I want to test it, and of course I will give you the code.

I would say yes to the above but it should be able to be applied to any time frame.

My reasoning behind this is that imho there are two constances in trading time and price.

I will look forward to seeing the indicator.

 

Just another doubt, for the indicator's value of previous bars we can account the price of the "1 minutes" time-frame to compute the time above and below the corresponding middle point, which yields nearly accurate values. For the bar that is forming, the issue is a bit challenging. For the current bar, still in formation, we can account in real-time. However, if the price makes new highs, the midle point is displaced, and a portion of time that was before considered "up time" must now be considered "down time" (and the other way around). A way to overcome this issue, is to considere a resolution of 1 minute, as for previous bars. This way we can use the stored "minute prices" for the ratios calculation, even if the middle point is continuously floating.

Examples:

you want to see the middle point for time_frame=5min, with halfway h . Following the above description, if 3 minutes price is above h and 2 minutes price is below, then you have

time_above =60%, time_below=40%, which is more or less accurate.


you want to see the middle point for time_frame=60min, with halfway h. Following the above description, if 37 minutes price is above h and 23 minutes price is below, then you have

time_above =61.666%, time_below=38.333%.


This might be ok. What do you think

 

See if this is ok, because perhaps it needs improvement. On bigger time_frames and for old bars, the indicator doesn't do the job because there is no minutes price in history.

Files:
 
abstract_mind wrote >>

See if this is ok, because perhaps it needs improvement. On bigger time_frames and for old bars, the indicator doesn't do the job because there is no minutes price in history.

It's a very prommising start i see your point with either a new high or low so your solution to have a stored minute will be a lot more accurate from the formation of a new bar