Choose timeframe for pivots ...Play with it you can find this useful
//Coded by CapnOscar on 16.04.2015 - Say Thanks? study(title="MyTrend", shorttitle="MyTrend", overlay=true) picktf = input(title="Pick TimeFrame", type=resolution, defval="30") previous_close = security(tickerid, picktf,close[1]) previous_open = security(tickerid, picktf,open[1]) cur_open = security(tickerid, picktf,open) previous_high = security(tickerid, picktf,high[1]) previous_low = security(tickerid, picktf,low[1]) cur_high = security(tickerid, picktf,high) cur_low = security(tickerid, picktf,low) D = (cur_high - cur_low) Q = (previous_high - previous_low) P = (previous_high + previous_low + previous_close) / 3 R1 = (2*P)-previous_low S1 = (2*P)-previous_high R2 = P+(previous_high - previous_low) S2 = P-(previous_high - previous_low) rsic = close > P ? green : close < P ? red : orange pv = plot(P, color=rsic, linewidth=3) plr1 = plot(R1, color=silver) plr2 = plot(R2, color=gray) pls1 = plot(S1, color=silver) pls2 = plot(S2, color=gray)