ondra.novacisko.cz

Profit target area

Update.
- you can specify count of bars used to detect reversal pattern
- you can specify count of bars used to determine lowest or highest price to place support or resistance
- area between lines is filled by green - ascending, red - descending trend

To trade:
- open position using stop command on S/R
- close position using limit command on retracement line
- close position when background colour indicates trend change

(erratum: last balloon on right should say "buy limit")
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

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.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?
study("Profit target area", overlay=true)
bars =input(title="Reversial pattern length (bars)", type=integer, defval=3, minval=1)
exbars = input(title="S/R detection (bars)", type=integer, defval=10, minval=1)
descent_cnt = high <= nz(high[1])?nz(descent_cnt[1])+1:0
ascent_cnt = low >= nz(low[1])?nz(ascent_cnt[1])+1:0
descent = descent_cnt >= bars
ascent = ascent_cnt >= bars
st = ascent?true:(descent?false:nz(st[1]))

h = st[1] and not st?highest(high,exbars):nz(h[1])
l = not st[1] and st?lowest(low,exbars):nz(l[1])
f = h - l
h38 = l + f/(1-0.382)
h62 = l + f/(1-0.618)
l38 = h - f/(1-0.382)
l62 = h - f/(1-0.618)

modeline = plot(st[0]?l:h,color=white,title="invisible plot", style=cross)
ph = plot(h,color=green, title="resistance")
pl = plot(l,color=red, title="support")
p3 = plot(h38, color=#80FF80, title="38% above")
p1 = plot(h62, color=#C0FFC0, title="62% above")
p2 = plot(l62, color=#FFC0FF, title="62% below")
p4 = plot(l38, color=#FF80FF,  title="38% below")
fill(p1,p3,color=#80FF80, transp=80,  title="62% above")
fill(p3,ph,color=#00FF00, transp=80,  title="38% above")
fill(p2,p4,color=#FF80FF, transp=80,  title="62% below")
fill(p4,pl,color=#FF00FF, transp=80,  title="38% below")
fill(ph,modeline,color=green, transp=90, title="going up")
fill(pl,modeline,color=red, transp=90, title="going down")