scalping 1 — Strategy by vilasbhusara0510

By version

Performance Metrics

Description

//version=5strategy("RSI + MACD Trend Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)// ===== INPUTS =====rsiLength = input.int(14, title="RSI Length")rsiOversold = input.int(40, title="RSI Buy Level")rsiOverbought = input.int(60, title="RSI Sell Level")fastEMA = input.int(50, title="Fast EMA")slowEMA = input.int(200, title="Slow EMA")macdFast = input.int(12, title="MACD Fast")macdSlow = input.int(26, title="MACD Slow")macdSignal = input.int(9, title="MACD Signal")// ===== INDICATORS =====rsi = ta.rsi(close, rsiLength)emaFast = ta.ema(close, fastEMA)emaSlow = ta.ema(close, slowEMA)[macdLine, signalLine, hist] = ta.macd(close, macdFast, macdSlow, macdSignal)// ===== CONDITIONS =====// Trend filtersupTrend = close > emaSlowdownTrend = close rsiOverbought and macdBear// ===== EXECUTION =====if longCondition strategy.entry("BUY", strategy.long)if shortCondition strategy.entry("SELL", strategy.short)// ===== EXITS =====tp = input.float(2.0, title="Take Profit %")sl = input.float(1.0, title="Stop Loss %")strategy.exit("TP/SL BUY", from_entry="BUY", profit=tp*10, loss=sl*10)strategy.exit("TP/SL SELL", from_entry="SELL", profit=tp*10, loss=sl*10)// ===== PLOTS =====plot(emaFast, color=color.orange, title="EMA 50")plot(emaSlow, color=color.blue, title="EMA 200")

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView