OPEN-SOURCE SCRIPT
Telah dikemas kini ITG Scalper + Supertrend + VWAP (Minimal v6)

IT USES TRIPE EMA ALONG WITH VWAP AND SUPERTREND AND ALSO //version=5
indicator(title="ITG Scalper + Supertrend + VWAP (Minimal v6)", shorttitle="ITG_SUPER_VWAP_MIN", overlay=true)
// === Inputs ===
temaLen = input.int(14, title="TEMA Period")
showTEMA = input.bool(true, title="Show TEMA Line?")
showSignals = input.bool(true, title="Show Buy/Sell Signals?")
macdFast = input.int(12, title="MACD Fast")
macdSlow = input.int(26, title="MACD Slow")
macdSignal = input.int(9, title="MACD Signal")
factor = input.float(3.0, title="Supertrend Factor")
atrlen = input.int(10, title="Supertrend ATR")
// === TEMA ===
ema1 = ta.ema(close, temaLen)
ema2 = ta.ema(ema1, temaLen)
ema3 = ta.ema(ema2, temaLen)
tema = 3 * (ema1 - ema2) + ema3
trendUp = tema >= tema[1]
trendDown = tema < tema[1]
// === MACD ===
[macdLine, signalLine, _] = ta.macd(close, macdFast, macdSlow, macdSignal)
macdBuy = macdLine >= signalLine
macdSell = macdLine < signalLine
// === Supertrend ===
atr_ = ta.atr(atrlen)
src = (high + low) / 2
upperBasic = src + factor * atr_
lowerBasic = src - factor * atr_
var float upperBand = na
var float lowerBand = na
var int superDir = na
upperBand := na(upperBand[1]) ? upperBasic : close[1] > upperBand[1] ? math.max(upperBasic, upperBand[1]) : upperBasic
lowerBand := na(lowerBand[1]) ? lowerBasic : close[1] < lowerBand[1] ? math.min(lowerBasic, lowerBand[1]) : lowerBasic
superDir := na(superDir[1]) ? 1 : close > lowerBand[1] ? 1 : close < upperBand[1] ? -1 : superDir[1]
superBull = superDir == 1
superBear = superDir == -1
// === VWAP ===
vwapValue = ta.vwap
// === Combo Logic (no duplicate signals) ===
var int lastSignal = na // 1 for Buy, -1 for Sell
buyCond = trendUp and macdBuy and superBull and close > vwapValue
sellCond = trendDown and macdSell and superBear and close < vwapValue
newBuy = buyCond and (na(lastSignal) or lastSignal == -1)
newSell = sellCond and (na(lastSignal) or lastSignal == 1)
if newBuy
lastSignal := 1
if newSell
lastSignal := -1
// === Plotting ===
plot(showTEMA ? tema : na, color=trendUp ? color.lime : color.red, linewidth=2)
plot(vwapValue, color=color.orange, linewidth=1)
bgcolor(superBull ? color.new(color.green,90) : superBear ? color.new(color.red,90) : na)
plotshape(showSignals and newBuy, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small, title="Buy Signal")
plotshape(showSignals and newSell, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small, title="Sell Signal")
indicator(title="ITG Scalper + Supertrend + VWAP (Minimal v6)", shorttitle="ITG_SUPER_VWAP_MIN", overlay=true)
// === Inputs ===
temaLen = input.int(14, title="TEMA Period")
showTEMA = input.bool(true, title="Show TEMA Line?")
showSignals = input.bool(true, title="Show Buy/Sell Signals?")
macdFast = input.int(12, title="MACD Fast")
macdSlow = input.int(26, title="MACD Slow")
macdSignal = input.int(9, title="MACD Signal")
factor = input.float(3.0, title="Supertrend Factor")
atrlen = input.int(10, title="Supertrend ATR")
// === TEMA ===
ema1 = ta.ema(close, temaLen)
ema2 = ta.ema(ema1, temaLen)
ema3 = ta.ema(ema2, temaLen)
tema = 3 * (ema1 - ema2) + ema3
trendUp = tema >= tema[1]
trendDown = tema < tema[1]
// === MACD ===
[macdLine, signalLine, _] = ta.macd(close, macdFast, macdSlow, macdSignal)
macdBuy = macdLine >= signalLine
macdSell = macdLine < signalLine
// === Supertrend ===
atr_ = ta.atr(atrlen)
src = (high + low) / 2
upperBasic = src + factor * atr_
lowerBasic = src - factor * atr_
var float upperBand = na
var float lowerBand = na
var int superDir = na
upperBand := na(upperBand[1]) ? upperBasic : close[1] > upperBand[1] ? math.max(upperBasic, upperBand[1]) : upperBasic
lowerBand := na(lowerBand[1]) ? lowerBasic : close[1] < lowerBand[1] ? math.min(lowerBasic, lowerBand[1]) : lowerBasic
superDir := na(superDir[1]) ? 1 : close > lowerBand[1] ? 1 : close < upperBand[1] ? -1 : superDir[1]
superBull = superDir == 1
superBear = superDir == -1
// === VWAP ===
vwapValue = ta.vwap
// === Combo Logic (no duplicate signals) ===
var int lastSignal = na // 1 for Buy, -1 for Sell
buyCond = trendUp and macdBuy and superBull and close > vwapValue
sellCond = trendDown and macdSell and superBear and close < vwapValue
newBuy = buyCond and (na(lastSignal) or lastSignal == -1)
newSell = sellCond and (na(lastSignal) or lastSignal == 1)
if newBuy
lastSignal := 1
if newSell
lastSignal := -1
// === Plotting ===
plot(showTEMA ? tema : na, color=trendUp ? color.lime : color.red, linewidth=2)
plot(vwapValue, color=color.orange, linewidth=1)
bgcolor(superBull ? color.new(color.green,90) : superBear ? color.new(color.red,90) : na)
plotshape(showSignals and newBuy, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small, title="Buy Signal")
plotshape(showSignals and newSell, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small, title="Sell Signal")
Nota Keluaran
How to Trade Using the ITG Scalper + VWAP “In-Between” System1. Setup
Apply the script to your chosen instrument (stock, index, crypto, etc.) in TradingView.
Use a timeframe that matches your trading style:
5-min or 15-min for intraday
1-hr or above for swing trading
2. What You’ll See
TEMA Line: (lime = uptrend, red = downtrend)
VWAP Line: (orange; serves as the “fair price” for the day/session)
Buy Arrow (Green, below candle): A new “Buy” signal
Sell Arrow (Red, above candle): A new “Sell” signal
3. Trade Entry Rules
A. Buy Trade
Wait for a green triangle/arrow below a candle.
This means:
TEMA shows uptrend
MACD is bullish
Price is above VWAP
Previous signal was a sell or no trade (prevents overtrading)
Buy at the close of the bar where the arrow appears, or at the open of the next candle.
B. Sell (Short) Trade
Wait for a red triangle/arrow above a candle.
This means:
TEMA shows downtrend
MACD is bearish
Price is below VWAP
Previous signal was a buy or no trade
Sell/Short at the close of the bar where the arrow appears, or at the open of the next candle.
4. Exiting Your Trade
Exit on opposite signal:
If you’re in a buy, exit when a sell arrow appears.
If you’re in a sell, exit when a buy arrow appears.
OR, use a stop-loss and target:
Stop-loss: Place below the most recent swing low (for buys) or above swing high (for sells).
Target: Fixed points (like 1x ATR), or use a risk:reward ratio (like 1:1.5 or 1:2).
5. Example Walkthrough
You see a green arrow below a 15-min candle for Nifty, price is above VWAP, and TEMA is green.
You buy at the next candle’s open.
Price moves up for 4 candles, then you get a red arrow above a candle.
You exit your buy (and could short if you want).
6. Extra Tips
Avoid signals during choppy/range-bound periods—best signals are after clear breaks above/below VWAP.
Always have a stop-loss to avoid big losses in fast moves.
Don’t take trades right into known support/resistance levels.
Paper trade or backtest to get comfortable with the system before live trading.
Nota Keluaran
How to Trade Using the ITG Scalper + VWAP “In-Between” System1. Setup
Apply the script to your chosen instrument (stock, index, crypto, etc.) in TradingView.
Use a timeframe that matches your trading style:
5-min or 15-min for intraday
1-hr or above for swing trading
2. What You’ll See
TEMA Line: (lime = uptrend, red = downtrend)
VWAP Line: (orange; serves as the “fair price” for the day/session)
Buy Arrow (Green, below candle): A new “Buy” signal
Sell Arrow (Red, above candle): A new “Sell” signal
3. Trade Entry Rules
A. Buy Trade
Wait for a green triangle/arrow below a candle.
This means:
TEMA shows uptrend
MACD is bullish
Price is above VWAP
Previous signal was a sell or no trade (prevents overtrading)
Buy at the close of the bar where the arrow appears, or at the open of the next candle.
B. Sell (Short) Trade
Wait for a red triangle/arrow above a candle.
This means:
TEMA shows downtrend
MACD is bearish
Price is below VWAP
Previous signal was a buy or no trade
Sell/Short at the close of the bar where the arrow appears, or at the open of the next candle.
4. Exiting Your Trade
Exit on opposite signal:
If you’re in a buy, exit when a sell arrow appears.
If you’re in a sell, exit when a buy arrow appears.
OR, use a stop-loss and target:
Stop-loss: Place below the most recent swing low (for buys) or above swing high (for sells).
Target: Fixed points (like 1x ATR), or use a risk:reward ratio (like 1:1.5 or 1:2).
5. Example Walkthrough
You see a green arrow below a 15-min candle for Nifty, price is above VWAP, and TEMA is green.
You buy at the next candle’s open.
Price moves up for 4 candles, then you get a red arrow above a candle.
You exit your buy (and could short if you want).
6. Extra Tips
Avoid signals during choppy/range-bound periods—best signals are after clear breaks above/below VWAP.
Always have a stop-loss to avoid big losses in fast moves.
Don’t take trades right into known support/resistance levels.
Paper trade or backtest to get comfortable with the system before live trading.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.