已更新
Trend Level-Chance 6-13-5 MA10

getScore(tf) =>
float price = request.security(syminfo.tickerid, tf, close)
float ma10 = request.security(syminfo.tickerid, tf, ta.sma(close, 10))
[macdLine, signalLine, _] = request.security(syminfo.tickerid, tf, ta.macd(close, 6, 13, 5))
int score = 0
// MA10
score += price > ma10 * (1 + bandPct) ? 1 : price < ma10 * (1 - bandPct) ? -1 : 0
// MACD
float diff = macdLine - signalLine
float threshold = ta.ema(math.abs(macdLine), 100) * (bandPct * 100)
score += diff > threshold ? 2 : diff < -threshold ? -2 : 0
// Chuẩn hóa score về -3 → +3
score := math.max(-3, math.min(3, score))
float price = request.security(syminfo.tickerid, tf, close)
float ma10 = request.security(syminfo.tickerid, tf, ta.sma(close, 10))
[macdLine, signalLine, _] = request.security(syminfo.tickerid, tf, ta.macd(close, 6, 13, 5))
int score = 0
// MA10
score += price > ma10 * (1 + bandPct) ? 1 : price < ma10 * (1 - bandPct) ? -1 : 0
// MACD
float diff = macdLine - signalLine
float threshold = ta.ema(math.abs(macdLine), 100) * (bandPct * 100)
score += diff > threshold ? 2 : diff < -threshold ? -2 : 0
// Chuẩn hóa score về -3 → +3
score := math.max(-3, math.min(3, score))
發行說明
//version=5indicator("Trend Level-Chance 6-13-5", shorttitle="TLC 6-13-5", overlay=true)
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。