OPEN-SOURCE SCRIPT
Bộ lọc Stoch RSI + MACD + Volume + MFI

//version=6
indicator("Bộ lọc Stoch RSI + MACD + Volume + MFI", overlay=false)
// Input
lenStoch = input.int(14, "Stoch RSI Length")
lenMACD = input.int(12, "MACD Fast Length")
lenSignal = input.int(9, "MACD Signal Length")
lenMFI = input.int(14, "MFI Length")
minVol = input.int(1000000, "Khối lượng tối thiểu")
// Stochastic RSI
k = ta.stoch(close, high, low, lenStoch)
d = ta.sma(k, 3)
// MACD
macd = ta.ema(close, lenMACD) - ta.ema(close, 26)
signal = ta.ema(macd, lenSignal)
// ✅ MFI (chỉ cần volume và length)
mfi = ta.mfi(volume, lenMFI)
// Điều kiện lọc
buyCond = (k < 20 and macd > signal and volume > minVol and mfi > 60)
sellCond = (k > 80 and macd < signal and mfi < 40)
// Xuất tín hiệu
plotchar(buyCond, "BUY", "▲", location=location.bottom, color=color.green, size=size.large)
plotchar(sellCond, "SELL", "▼", location=location.top, color=color.red, size=size.large)
indicator("Bộ lọc Stoch RSI + MACD + Volume + MFI", overlay=false)
// Input
lenStoch = input.int(14, "Stoch RSI Length")
lenMACD = input.int(12, "MACD Fast Length")
lenSignal = input.int(9, "MACD Signal Length")
lenMFI = input.int(14, "MFI Length")
minVol = input.int(1000000, "Khối lượng tối thiểu")
// Stochastic RSI
k = ta.stoch(close, high, low, lenStoch)
d = ta.sma(k, 3)
// MACD
macd = ta.ema(close, lenMACD) - ta.ema(close, 26)
signal = ta.ema(macd, lenSignal)
// ✅ MFI (chỉ cần volume và length)
mfi = ta.mfi(volume, lenMFI)
// Điều kiện lọc
buyCond = (k < 20 and macd > signal and volume > minVol and mfi > 60)
sellCond = (k > 80 and macd < signal and mfi < 40)
// Xuất tín hiệu
plotchar(buyCond, "BUY", "▲", location=location.bottom, color=color.green, size=size.large)
plotchar(sellCond, "SELL", "▼", location=location.top, color=color.red, size=size.large)
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.