This strategy is adapted from TradingView strategy Super Scalper 5min by VinayKumarKV.
Strategy Description: Uses ATR, EMA, RSI. Specifically for 5min TF.
Potential ROI Monthly (in sideway/bullish): 5%
Recommended Settings:
Pair: BTCUSDT
Time frame: 5mins
Initial Capital: 50
Base Currency: Default
Order Size: 11 USDT
Pyramiding: 4 orders
Commission: 0.1 %
Take Profit: High + ATR * 5
Stop Loss: Low - ATR * 2
//@version=5
strategy("Scalper5min[capayam.com]", overlay=true)
source = close
atrlen = input.int(7, "ATR Period")
mult = input.float(2, "ATR Multi", step=0.1)
smoothing = input.string(title="ATR Smoothing", defval="WMA", options=["RMA", "SMA", "EMA", "WMA"])
ma_function(source, atrlen) =>
if smoothing == "RMA"
ta.rma(source, atrlen)
else
if smoothing == "SMA"
ta.sma(source, atrlen)
else
if smoothing == "EMA"
ta.ema(source, atrlen)
else
ta.wma(source, atrlen)
atr_slen = ma_function(ta.tr(true), atrlen)
upper_band = atr_slen * mult + close
lower_band = close - atr_slen * mult
// Create Indicator's
ShortEMAlen = input.int(20, "Fast EMA")
LongEMAlen = input.int(100, "Slow EMA")
shortSMA = ta.ema(close, ShortEMAlen)
longSMA = ta.ema(close, LongEMAlen)
RSILen1 = input.int(33, "Fast RSI Length")
RSILen2 = input.int(200, "Slow RSI Length")
rsi1 = ta.rsi(close, RSILen1)
rsi2 = ta.rsi(close, RSILen2)
atr = ta.atr(atrlen)
//RSI Cross condition
RSILong = rsi1 > rsi2
RSIShort = rsi1 < rsi2
// Specify conditions
longCondition = open < lower_band
shortCondition = open > upper_band
GoldenLong = ta.crossover(shortSMA,longSMA)
Goldenshort = ta.crossover(longSMA,shortSMA)
plotshape(shortCondition, title="Sell Label", text="Sell", location=location.abovebar, style=shape.labeldown, size=size.tiny, color=color.red, textcolor=color.white, transp=0)
plotshape(longCondition, title="Buy Label", text="Buy", location=location.belowbar, style=shape.labelup, size=size.tiny, color=color.green, textcolor=color.white, transp=0)
plotshape(Goldenshort, title="Golden Sell Label", text="Golden Crossover Short", location=location.abovebar, style=shape.labeldown, size=size.tiny, color=color.blue, textcolor=color.white, transp=0)
plotshape(GoldenLong, title="Golden Buy Label", text="Golden Crossover Long", location=location.belowbar, style=shape.labelup, size=size.tiny, color=color.yellow, textcolor=color.white, transp=0)
// Execute trade if condition is True
if (longCondition)
stopLoss = low - atr * 2
takeProfit = high + atr * 5
strategy.entry("long", strategy.long, when = RSILong)
if (shortCondition)
stopLoss = high + atr * 2
takeProfit = low - atr * 5
strategy.entry("short", strategy.short, when = RSIShort)
// Plot ATR bands to chart
////ATR Up/Low Bands
plot(upper_band)
plot(lower_band)
// Plot Moving Averages
plot(shortSMA, color = color.red)
plot(longSMA, color = color.yellow)
Comments
Post a Comment