Hello,
I just received this from a friendly soul on twitter. This works on tradingview, only intraday because of the time parameter.
Maybe this can help Nicolas?
//
=3 study(“Fiddy”, overlay=true)
t = time(“1440”, session.extended) // 1440=60*24 is the number of minutes in a whole day. You may use “0930-1600” as second session parameter
//plot(t, style=linebr) // debug is_first = na(t[1]) and not na(t) or t[1] < t
//plotshape(is_first, color=red, style=shape.arrowdown)
day_high = na day_low = na
if is_first and barstate.isnew
day_high := high
day_low := low
else day_high := day_high[1]
day_low := day_low[1]
fiddy (ATR2 daily /2)= (max(day_high, close[1]) + min(day_low, close[1]))/2
fiddy2 = (max(day_high, close[1]) – min(day_low, close[1]))*0.618 + day_low
fiddy3 = (max(day_high, close[1]) – min(day_low, close[1]))*0.382 + day_low
if high > day_high day_high := high
if low < day_low day_low := low
plot(fiddy, color=red, title=”fiddy”)
plot(fiddy2, color=orange, title=”fiddy618″)
plot(fiddy3, color=orange, title=”fiddy382″)
plot(day_high, color=lime, title=”day_high”)
plot(day_low, color=lime, title= ‘day_low’)
You can remove the lines below if you only want “Fiddy”
fiddy2 = (max(day_high, close[1]) – min(day_low, close[1]))*0.618 + day_low
fiddy3 = (max(day_high, close[1]) – min(day_low, close[1]))*0.382 + day_low