OPEN-SOURCE SCRIPT
indicator("MouNoOkite_InitialMove_Screener", overlay=true)

//version=5
indicator("猛の掟・初動スクリーナー(5EMA×MACD×出来高×ローソク)", overlay=true, max_labels_count=500)
// =========================
// Inputs
// =========================
emaSLen = input.int(5, "EMA Short (5)")
emaMLen = input.int(13, "EMA Mid (13)")
emaLLen = input.int(26, "EMA Long (26)")
macdFast = input.int(12, "MACD Fast")
macdSlow = input.int(26, "MACD Slow")
macdSignal = input.int(9, "MACD Signal")
volLookback = input.int(5, "出来高平均(日数)", minval=1)
volMinRatio = input.float(1.3, "出来高倍率(初動点灯)", step=0.1)
volStrong = input.float(1.5, "出来高倍率(本物初動)", step=0.1)
volMaxRatio = input.float(2.0, "出来高倍率(上限目安)", step=0.1)
wickBodyMult = input.float(2.0, "ピンバー判定: 下ヒゲ >= (実体×倍率)", step=0.1)
pivotLen = input.int(20, "直近高値/レジスタンス判定のLookback", minval=5)
pullMinPct = input.float(5.0, "押し目最小(%)", step=0.1)
pullMaxPct = input.float(15.0, "押し目最大(%)", step=0.1)
showDebug = input.bool(true, "デバッグ表示(条件チェック)")
// =========================
// EMA
// =========================
emaS = ta.ema(close, emaSLen)
emaM = ta.ema(close, emaMLen)
emaL = ta.ema(close, emaLLen)
plot(emaS, color=color.new(color.yellow, 0), title="EMA 5")
plot(emaM, color=color.new(color.blue, 0), title="EMA 13")
plot(emaL, color=color.new(color.orange, 0), title="EMA 26")
emaUpS = emaS > emaS[1]
emaUpM = emaM > emaM[1]
emaUpL = emaL > emaL[1]
// 26EMA上に2日定着
above26_2days = close > emaL and close[1] > emaL[1]
// 黄金隊列
goldenOrder = emaS > emaM and emaM > emaL
// =========================
// MACD
// =========================
[macdLine, macdSig, macdHist] = ta.macd(close, macdFast, macdSlow, macdSignal)
// ヒストグラム縮小(マイナス圏で上向きの準備)も見たい場合の例
histShrinking = math.abs(macdHist) < math.abs(macdHist[1])
histUp = macdHist > macdHist[1]
// ゼロライン上でGC(最終シグナル)
macdGCAboveZero = ta.crossover(macdLine, macdSig) and macdLine > 0 and macdSig > 0
// 参考:ゼロ直下で上昇方向(勢い準備)
macdRisingNearZero = (macdLine < 0) and (macdLine > macdLine[1]) and (math.abs(macdLine) <= math.abs(0.5))
// =========================
// Volume
// =========================
volMA = ta.sma(volume, volLookback)
volRatio = volMA > 0 ? (volume / volMA) : na
volumeOK = volRatio >= volMinRatio and volRatio <= volMaxRatio
volumeStrongOK = volRatio >= volStrong
// =========================
// Candle patterns
// =========================
body = math.abs(close - open)
upperWick = high - math.max(open, close)
lowerWick = math.min(open, close) - low
// 長い下ヒゲ(ピンバー系): 実体が小さく、下ヒゲが優位
pinbar = (lowerWick >= wickBodyMult * body) and (lowerWick > upperWick) and (close >= open)
// 陽線包み足(前日陰線を包む)
bullEngulf =
close > open and close[1] < open[1] and
close >= open[1] and open <= close[1]
// 5EMA・13EMA を貫く大陽線(勢い)
bigBull =
close > open and
open < emaM and close > emaS and
(body > ta.sma(body, 20)) // “相対的に大きい”目安
candleOK = pinbar or bullEngulf or bigBull
// =========================
// 押し目 (-5%〜-15%) & レジブレ後
// =========================
recentHigh = ta.highest(high, pivotLen)
pullbackPct = recentHigh > 0 ? (recentHigh - close) / recentHigh * 100.0 : na
pullbackOK = pullbackPct >= pullMinPct and pullbackPct <= pullMaxPct
// “レジスタンスブレイク”簡易定義:直近pivotLen高値を一度上抜いている
// → その後に押し目位置にいる(現在が押し目)
brokeResistance = ta.crossover(close, recentHigh[1]) or (close[1] > recentHigh[2])
afterBreakPull = brokeResistance[1] or brokeResistance[2] or brokeResistance[3] or brokeResistance[4] or brokeResistance[5]
breakThenPullOK = afterBreakPull and pullbackOK
// =========================
// 最終三点シグナル(ヒゲ × 出来高 × MACD)
// =========================
final3 = pinbar and macdGCAboveZero and volumeStrongOK
// =========================
// 猛の掟 8条件チェック(1つでも欠けたら「見送り」)
// =========================
// 1) 5EMA↑ 13EMA↑ 26EMA↑
cond1 = emaUpS and emaUpM and emaUpL
// 2) 5>13>26 黄金隊列
cond2 = goldenOrder
// 3) ローソク足が26EMA上に2日定着
cond3 = above26_2days
// 4) MACD(12,26,9) ゼロライン上でGC
cond4 = macdGCAboveZero
// 5) 出来高が直近5日平均の1.3〜2.0倍
cond5 = volumeOK
// 6) ピンバー or 包み足 or 大陽線
cond6 = candleOK
// 7) 押し目 -5〜15%
cond7 = pullbackOK
// 8) レジスタンスブレイク後の押し目
cond8 = breakThenPullOK
all8 = cond1 and cond2 and cond3 and cond4 and cond5 and cond6 and cond7 and cond8
// =========================
// 判定(2択のみ)
// =========================
isBuy = all8 and final3
decision = isBuy ? "買い" : "見送り"
// =========================
// 表示
// =========================
plotshape(isBuy, title="BUY", style=shape.labelup, text="買い", color=color.new(color.lime, 0), textcolor=color.black, location=location.belowbar, size=size.small)
plotshape((not isBuy) and all8, title="ALL8_OK_but_noFinal3", style=shape.labelup, text="8条件OK\n(最終3未)", color=color.new(color.yellow, 0), textcolor=color.black, location=location.belowbar, size=size.tiny)
// デバッグ(8項目チェック結果)
if showDebug and barstate.islast
var label dbg = na
label.delete(dbg)
txt =
"【8項目チェック】\n" +
"1 EMA全上向き: " + (cond1 ? "達成" : "未達") + "\n" +
"2 黄金隊列: " + (cond2 ? "達成" : "未達") + "\n" +
"3 26EMA上2日: " + (cond3 ? "達成" : "未達") + "\n" +
"4 MACDゼロ上GC: " + (cond4 ? "達成" : "未達") + "\n" +
"5 出来高1.3-2.0: "+ (cond5 ? "達成" : "未達") + "\n" +
"6 ローソク条件: " + (cond6 ? "達成" : "未達") + "\n" +
"7 押し目5-15%: " + (cond7 ? "達成" : "未達") + "\n" +
"8 ブレイク後押し目: " + (cond8 ? "達成" : "未達") + "\n\n" +
"最終三点(ヒゲ×出来高×MACD): " + (final3 ? "成立" : "未成立") + "\n" +
"判定: " + decision
dbg := label.new(bar_index, high, txt, style=label.style_label_left, textcolor=color.white, color=color.new(color.black, 0))
// アラート
alertcondition(isBuy, title="猛の掟 BUY", message="猛の掟: 買いシグナル(8条件+最終三点)")
indicator("猛の掟・初動スクリーナー(5EMA×MACD×出来高×ローソク)", overlay=true, max_labels_count=500)
// =========================
// Inputs
// =========================
emaSLen = input.int(5, "EMA Short (5)")
emaMLen = input.int(13, "EMA Mid (13)")
emaLLen = input.int(26, "EMA Long (26)")
macdFast = input.int(12, "MACD Fast")
macdSlow = input.int(26, "MACD Slow")
macdSignal = input.int(9, "MACD Signal")
volLookback = input.int(5, "出来高平均(日数)", minval=1)
volMinRatio = input.float(1.3, "出来高倍率(初動点灯)", step=0.1)
volStrong = input.float(1.5, "出来高倍率(本物初動)", step=0.1)
volMaxRatio = input.float(2.0, "出来高倍率(上限目安)", step=0.1)
wickBodyMult = input.float(2.0, "ピンバー判定: 下ヒゲ >= (実体×倍率)", step=0.1)
pivotLen = input.int(20, "直近高値/レジスタンス判定のLookback", minval=5)
pullMinPct = input.float(5.0, "押し目最小(%)", step=0.1)
pullMaxPct = input.float(15.0, "押し目最大(%)", step=0.1)
showDebug = input.bool(true, "デバッグ表示(条件チェック)")
// =========================
// EMA
// =========================
emaS = ta.ema(close, emaSLen)
emaM = ta.ema(close, emaMLen)
emaL = ta.ema(close, emaLLen)
plot(emaS, color=color.new(color.yellow, 0), title="EMA 5")
plot(emaM, color=color.new(color.blue, 0), title="EMA 13")
plot(emaL, color=color.new(color.orange, 0), title="EMA 26")
emaUpS = emaS > emaS[1]
emaUpM = emaM > emaM[1]
emaUpL = emaL > emaL[1]
// 26EMA上に2日定着
above26_2days = close > emaL and close[1] > emaL[1]
// 黄金隊列
goldenOrder = emaS > emaM and emaM > emaL
// =========================
// MACD
// =========================
[macdLine, macdSig, macdHist] = ta.macd(close, macdFast, macdSlow, macdSignal)
// ヒストグラム縮小(マイナス圏で上向きの準備)も見たい場合の例
histShrinking = math.abs(macdHist) < math.abs(macdHist[1])
histUp = macdHist > macdHist[1]
// ゼロライン上でGC(最終シグナル)
macdGCAboveZero = ta.crossover(macdLine, macdSig) and macdLine > 0 and macdSig > 0
// 参考:ゼロ直下で上昇方向(勢い準備)
macdRisingNearZero = (macdLine < 0) and (macdLine > macdLine[1]) and (math.abs(macdLine) <= math.abs(0.5))
// =========================
// Volume
// =========================
volMA = ta.sma(volume, volLookback)
volRatio = volMA > 0 ? (volume / volMA) : na
volumeOK = volRatio >= volMinRatio and volRatio <= volMaxRatio
volumeStrongOK = volRatio >= volStrong
// =========================
// Candle patterns
// =========================
body = math.abs(close - open)
upperWick = high - math.max(open, close)
lowerWick = math.min(open, close) - low
// 長い下ヒゲ(ピンバー系): 実体が小さく、下ヒゲが優位
pinbar = (lowerWick >= wickBodyMult * body) and (lowerWick > upperWick) and (close >= open)
// 陽線包み足(前日陰線を包む)
bullEngulf =
close > open and close[1] < open[1] and
close >= open[1] and open <= close[1]
// 5EMA・13EMA を貫く大陽線(勢い)
bigBull =
close > open and
open < emaM and close > emaS and
(body > ta.sma(body, 20)) // “相対的に大きい”目安
candleOK = pinbar or bullEngulf or bigBull
// =========================
// 押し目 (-5%〜-15%) & レジブレ後
// =========================
recentHigh = ta.highest(high, pivotLen)
pullbackPct = recentHigh > 0 ? (recentHigh - close) / recentHigh * 100.0 : na
pullbackOK = pullbackPct >= pullMinPct and pullbackPct <= pullMaxPct
// “レジスタンスブレイク”簡易定義:直近pivotLen高値を一度上抜いている
// → その後に押し目位置にいる(現在が押し目)
brokeResistance = ta.crossover(close, recentHigh[1]) or (close[1] > recentHigh[2])
afterBreakPull = brokeResistance[1] or brokeResistance[2] or brokeResistance[3] or brokeResistance[4] or brokeResistance[5]
breakThenPullOK = afterBreakPull and pullbackOK
// =========================
// 最終三点シグナル(ヒゲ × 出来高 × MACD)
// =========================
final3 = pinbar and macdGCAboveZero and volumeStrongOK
// =========================
// 猛の掟 8条件チェック(1つでも欠けたら「見送り」)
// =========================
// 1) 5EMA↑ 13EMA↑ 26EMA↑
cond1 = emaUpS and emaUpM and emaUpL
// 2) 5>13>26 黄金隊列
cond2 = goldenOrder
// 3) ローソク足が26EMA上に2日定着
cond3 = above26_2days
// 4) MACD(12,26,9) ゼロライン上でGC
cond4 = macdGCAboveZero
// 5) 出来高が直近5日平均の1.3〜2.0倍
cond5 = volumeOK
// 6) ピンバー or 包み足 or 大陽線
cond6 = candleOK
// 7) 押し目 -5〜15%
cond7 = pullbackOK
// 8) レジスタンスブレイク後の押し目
cond8 = breakThenPullOK
all8 = cond1 and cond2 and cond3 and cond4 and cond5 and cond6 and cond7 and cond8
// =========================
// 判定(2択のみ)
// =========================
isBuy = all8 and final3
decision = isBuy ? "買い" : "見送り"
// =========================
// 表示
// =========================
plotshape(isBuy, title="BUY", style=shape.labelup, text="買い", color=color.new(color.lime, 0), textcolor=color.black, location=location.belowbar, size=size.small)
plotshape((not isBuy) and all8, title="ALL8_OK_but_noFinal3", style=shape.labelup, text="8条件OK\n(最終3未)", color=color.new(color.yellow, 0), textcolor=color.black, location=location.belowbar, size=size.tiny)
// デバッグ(8項目チェック結果)
if showDebug and barstate.islast
var label dbg = na
label.delete(dbg)
txt =
"【8項目チェック】\n" +
"1 EMA全上向き: " + (cond1 ? "達成" : "未達") + "\n" +
"2 黄金隊列: " + (cond2 ? "達成" : "未達") + "\n" +
"3 26EMA上2日: " + (cond3 ? "達成" : "未達") + "\n" +
"4 MACDゼロ上GC: " + (cond4 ? "達成" : "未達") + "\n" +
"5 出来高1.3-2.0: "+ (cond5 ? "達成" : "未達") + "\n" +
"6 ローソク条件: " + (cond6 ? "達成" : "未達") + "\n" +
"7 押し目5-15%: " + (cond7 ? "達成" : "未達") + "\n" +
"8 ブレイク後押し目: " + (cond8 ? "達成" : "未達") + "\n\n" +
"最終三点(ヒゲ×出来高×MACD): " + (final3 ? "成立" : "未成立") + "\n" +
"判定: " + decision
dbg := label.new(bar_index, high, txt, style=label.style_label_left, textcolor=color.white, color=color.new(color.black, 0))
// アラート
alertcondition(isBuy, title="猛の掟 BUY", message="猛の掟: 買いシグナル(8条件+最終三点)")
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.