The usual delay methods don't have the effect I want. The delay I'm looking for should follow the red line of her level. But the usual delay just moves forward by one bar.
Offset, Changing the timeframe didn't help either. The desired result in practice in the figure. As a result, the white line means where the green line should move exactly at the same level as shown in the figure.
//@version=2
study("MTF", overlay=true)
tim=input('5')
tim1=input('5')
out1 = security(tickerid, tim, open)
out2 = security(tickerid, tim1, out1)
plot(out1,color=red,linewidth = 4, transp = 0)
plot(out2,color=green, linewidth = 4, transp = 0)
//@version=5
indicator('MTF', overlay=true)
tim = input('5')
tim1 = input('5')
out1 = request.security(syminfo.tickerid, tim, open)
out2 = request.security(syminfo.tickerid, tim1, out1)
plot(out1, color=color.new(color.red, 0), linewidth=4)
plot(out2, color=color.new(color.green, 0), linewidth=4)