//@version=3
study("Top Bottom ",overlay=true)

per=input(14)
loc= low<lowest(low,per) and low<=lowest(low,per)
bottom=barssince(loc)

per2=input(14)
loc2= high>highest(high,per2) and high>=highest(high,per2)
top=barssince(loc2)

/////BUY-SELL/////
buy=top<bottom and top>bottom
sell=top>bottom and top<bottom
plotshape(buy, title= "Buy", location=location.belowbar, color=green, style=shape.arrowup, text="Buy")
plotshape(sell, title= "Sell",color=red, style=shape.arrowdown, text="Sell")

background = top < bottom ? blue : top > bottom ? red :
na
bgcolor(color=background, transp=85)
Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.