xmd79

часовой

Jan 11th, 2022
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. //@version=5
  2.  
  3. indicator('часовой', overlay=true, shorttitle='часовой')
  4. res = input.timeframe(title='Time Frame', defval='60')
  5. //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)))))
  6. //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)))))
  7. boxp = input(5, 'BOX LENGTH')
  8.  
  9. LL = ta.lowest(low, boxp)
  10. k1 = ta.highest(high, boxp)
  11. k2 = ta.highest(high, boxp - 1)
  12. k3 = ta.highest(high, boxp - 2)
  13.  
  14. NH = ta.valuewhen(high > k1[1], high, 0)
  15. box1 = k3 < k2
  16. TopBox = ta.valuewhen(ta.barssince(high > k1[1]) == boxp - 2 and box1, NH, 0)
  17. BottomBox = ta.valuewhen(ta.barssince(high > k1[1]) == boxp - 2 and box1, LL, 0)
  18. TopBox1 = request.security(syminfo.tickerid, res, TopBox)
  19. BottomBox1 = request.security(syminfo.tickerid, res, BottomBox)
  20. plot(TopBox1, linewidth=1, color=color.new(color.green, 0), title='TBbox')
  21. plot(BottomBox1, linewidth=1, color=color.new(color.maroon, 0), title='BBbox')
  22.  
  23.  
Advertisement
Add Comment
Please, Sign In to add comment