LeMogwai

Parabolic Stop

Parbolic Stop is a mix between the indicator Parabolic SAR, Volatility Stop and an SMA.

The goal of this indicator is to place your stop loss in an optimized spot. You can also combine the indicator switch from different timeframes to get buy or sell signal.

สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
study(title="Parabolic Stop", shorttitle="StopAR", overlay=true)
start = input(0.02)
increment = input(0.05)
maximum = input(0.2)
sar = sar(start, increment, maximum)
length = input(20)
smaclose= sma(close, 3*length)
smahigh = sma(high, 3*length)
smalow = sma(low, 3*length)
mult = input(4)
atr_ = atr(length)
max1 = max(nz(max_[1]), close)
min1 = min(nz(min_[1]), close)
is_uptrend_prev = nz(is_uptrend[1], true)
stop = is_uptrend_prev ? max1 - mult * atr_ : min1 + mult * atr_
vstop_prev = nz(vstop[1])
vstop_prev2 = nz(vstop[2])
vstop1 = is_uptrend_prev ? min(max(vstop_prev, stop), sar): max(min(vstop_prev, stop), sar)
is_uptrend = close - vstop1 >= 0
is_trend_changed = is_uptrend != is_uptrend_prev
max_ = is_trend_changed ? close : max1
min_ = is_trend_changed ? close : min1
vstop = is_trend_changed ? is_uptrend ? max(max_ - mult * atr_, sar) : min(min_ + mult * atr_, sar) : vstop1
p1 = plot(vstop, color = is_uptrend ? aqua : fuchsia, style = line, linewidth=2)
sma = is_uptrend?smaclose : smaclose
p2 = plot(sma, color = white, linewidth=2)