Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=5
- indicator('часовой', overlay=true, shorttitle='часовой')
- res = input.timeframe(title='Time Frame', defval='60')
- //iff(low=lowest(low,5),low,iff(low[1]=lowest(low,5),low[1],iff(low[2]=lowest(low,5),low[2],iff(low[3]=lowest(low,5),low[3],iff(low[4]=lowest(low,5),low[4],0)))))
- //iff(low=lowest(low,5),low,iff(low[1]=lowest(low,5),low[1],iff(low[2]=lowest(low,5),low[2],iff(low[3]=lowest(low,5),low[3],iff(low[4]=lowest(low,5),low[4],0)))))
- boxp = input(5, 'BOX LENGTH')
- LL = ta.lowest(low, boxp)
- k1 = ta.highest(high, boxp)
- k2 = ta.highest(high, boxp - 1)
- k3 = ta.highest(high, boxp - 2)
- NH = ta.valuewhen(high > k1[1], high, 0)
- box1 = k3 < k2
- TopBox = ta.valuewhen(ta.barssince(high > k1[1]) == boxp - 2 and box1, NH, 0)
- BottomBox = ta.valuewhen(ta.barssince(high > k1[1]) == boxp - 2 and box1, LL, 0)
- TopBox1 = request.security(syminfo.tickerid, res, TopBox)
- BottomBox1 = request.security(syminfo.tickerid, res, BottomBox)
- plot(TopBox1, linewidth=1, color=color.new(color.green, 0), title='TBbox')
- plot(BottomBox1, linewidth=1, color=color.new(color.maroon, 0), title='BBbox')
Advertisement
Add Comment
Please, Sign In to add comment