OPEN-SOURCE SCRIPT
已更新 20MA_Touch_LongCandle

//version=5
indicator("MA20 Touch + Big Bull Candle (Daily)", overlay=true)
// --- Inputs
maLen = input.int(20, "MA Length", minval=1)
avgLen = input.int(20, "Avg Body Lookback", minval=5)
bigMult = input.float(2.0, "Big Candle Multiplier", step=0.1)
touchMode = input.string("Touch (low <= MA)", "MA Touch Mode", options=["Touch (low <= MA)", "Near (abs(close-MA)/MA)"])
nearPct = input.float(0.3, "Near % (if Near mode)", step=0.1) // 0.3% default
// --- MA
ma20 = ta.sma(close, maLen)
plot(ma20, "MA20", linewidth=2)
// --- Candle metrics
body = math.abs(close - open)
avgBody = ta.sma(body, avgLen)
// --- Conditions
isBull = close > open
isBig = body >= avgBody * bigMult
touchCond = switch touchMode
"Touch (low <= MA)" => low <= ma20 and high >= ma20 // '찍었다' 느낌(통과 포함)
=> math.abs(close - ma20) / ma20 * 100 <= nearPct
signal = isBull and isBig and touchCond
// --- Plot
plotshape(signal, title="Signal", style=shape.labelup, text="MA20\nBIG", location=location.belowbar, size=size.tiny)
// --- Alert
alertcondition(signal, title="MA20 Touch + Big Bull", message="MA20 Touch + Big Bull Candle detected on {{ticker}} (Daily)")
indicator("MA20 Touch + Big Bull Candle (Daily)", overlay=true)
// --- Inputs
maLen = input.int(20, "MA Length", minval=1)
avgLen = input.int(20, "Avg Body Lookback", minval=5)
bigMult = input.float(2.0, "Big Candle Multiplier", step=0.1)
touchMode = input.string("Touch (low <= MA)", "MA Touch Mode", options=["Touch (low <= MA)", "Near (abs(close-MA)/MA)"])
nearPct = input.float(0.3, "Near % (if Near mode)", step=0.1) // 0.3% default
// --- MA
ma20 = ta.sma(close, maLen)
plot(ma20, "MA20", linewidth=2)
// --- Candle metrics
body = math.abs(close - open)
avgBody = ta.sma(body, avgLen)
// --- Conditions
isBull = close > open
isBig = body >= avgBody * bigMult
touchCond = switch touchMode
"Touch (low <= MA)" => low <= ma20 and high >= ma20 // '찍었다' 느낌(통과 포함)
=> math.abs(close - ma20) / ma20 * 100 <= nearPct
signal = isBull and isBig and touchCond
// --- Plot
plotshape(signal, title="Signal", style=shape.labelup, text="MA20\nBIG", location=location.belowbar, size=size.tiny)
// --- Alert
alertcondition(signal, title="MA20 Touch + Big Bull", message="MA20 Touch + Big Bull Candle detected on {{ticker}} (Daily)")
發行說明
Searching for the 20MA long Candle開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。