Home Full Advanced Gains Algo Strategy Full Advanced Gains Algo Strategy Full Advanced Gains Algo Strategy Software Technique Web Technique All Computer Language and Computer Language Practice Computer Educa July 25, 2025 0 Comments Share: Facebook Twitter Google+ Pinterest Whatsapp TREDING //@version=5 strategy("📈 Gains Algo Full Pro v1.0", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100) // === INPUTS === emaFastLen = input.int(9, title="EMA Fast") emaSlowLen = input.int(21, title="EMA Slow") rsiLen = input.int(14, title="RSI Period") rsiBuy = input.int(50, title="RSI Buy Threshold") rsiSell = input.int(50, title="RSI Sell Threshold") macdFast = input.int(12, title="MACD Fast") macdSlow = input.int(26, title="MACD Slow") macdSignal = input.int(9, title="MACD Signal") atrPeriod = input.int(10, title="Supertrend ATR Period") atrMultiplier = input.float(3.0, title="Supertrend Multiplier") stopLossPercent = input.float(1.5, title="Stop Loss (%)") // e.g. 1.5% takeProfitPercent = input.float(3.0, title="Take Profit (%)") // e.g. 3% // === INDICATORS === emaFast = ta.ema(close, emaFastLen) emaSlow = ta.ema(close, emaSlowLen) rsi = ta.rsi(close, rsiLen) [macdLine, macdSignalLine, _] = ta.macd(close, macdFast, macdSlow, macdSignal) [supertrend, supertrendDir] = ta.supertrend(atrMultiplier, atrPeriod) // === CONDITIONS === bullish = close > supertrend and emaFast > emaSlow and macdLine > macdSignalLine and rsi > rsiBuy bearish = close < supertrend and emaFast < emaSlow and macdLine < macdSignalLine and rsi < rsiSell // === STRATEGY ENTRIES & EXITS === longSL = close * (1 - stopLossPercent / 100) longTP = close * (1 + takeProfitPercent / 100) shortSL = close * (1 + stopLossPercent / 100) shortTP = close * (1 - takeProfitPercent / 100) if bullish strategy.entry("Long", strategy.long) strategy.exit("Exit Long", from_entry="Long", stop=longSL, limit=longTP) if bearish strategy.entry("Short", strategy.short) strategy.exit("Exit Short", from_entry="Short", stop=shortSL, limit=shortTP) // === PLOTS === plotshape(bullish, title="BUY Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY") plotshape(bearish, title="SELL Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL") plot(emaFast, title="EMA Fast", color=color.orange) plot(emaSlow, title="EMA Slow", color=color.blue) // === ALERTS === alertcondition(bullish, title="Buy Alert", message="Gains Algo: BUY Signal!") alertcondition(bearish, title="Sell Alert", message="Gains Algo: SELL Signal!") Copy Copied Text:
No comments