커뮤니티
지표변환 부탁드립니다.
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © MisinkoMaster
//@version=6
indicator("Extreme HMA ATR Bands", "EHA Bands | MisinkoMaster", overlay =true,
behind_chart = false)
//////////////////////////////////////////////////////////////////////////////////////////////////////
//Import Libraries
import TradingView/ta/12
//////////////////////////////////////////////////////////////////////////////////////////////////////
//Get User Defined Inputs
len = input.int(33, "Length")
src = input.source(close, "Source")
atr_len = input.int(30, "ATR Length")
atr_mul = input.float(0.7, title = "ATR Multiplier", step = 0.05)
//////////////////////////////////////////////////////////////////////////////////////////////////////
//Calculations
sqrtlen = math.round(math.sqrt(len))
halflen = math.round(len/2)
hma = ta.ema(src, sqrtlen)
h = ta.highest(hma, len)
l = ta.lowest(hma, len)
hh = ta.lowest(h, halflen)
ll = ta.highest(l, halflen)
hhh = ta.lowest(hh, sqrtlen)
lll = ta.highest(ll, sqrtlen)
mid = (hh+ll)/2
atr = ta.atr(atr_len)*atr_mul
Upper = mid+atr
Lower = mid-atr
//////////////////////////////////////////////////////////////////////////////////////////////////////
//Trend Logic
var trend = 0
L = src > Upper
S = src < Lower
if L
trend := 1
if S
trend := -1
//////////////////////////////////////////////////////////////////////////////////////////////////////
//Plotting
var col = color.rgb(81, 81, 81)
var colT = color.rgb(81, 81, 81, 50)
if L
col := color.rgb(0, 217, 197)
colT := color.rgb(0, 217, 197, 50)
if S
col := color.rgb(217, 0, 197)
colT := color.rgb(217, 0, 197, 50)
up = plot(Upper, "Upper", col, 2)
lp = plot(Lower, "Lower", col, 2)
mp = plot(mid, "Base Line", color = col, linewidth = 2, linestyle = plot.linestyle_dashed)
fill(up, lp, colT)
plotcandle(open, high, low, close, color = col, wickcolor = col, bordercolor = col, display = display.pane)
답변 1
예스스탁 예스스탁 답변
2026-01-12 15:58:04