//@version=5 strategy("BigBasha Algo", overlay=true) // Parametrat për indikatorët bb_length = input(20, title="Bollinger Bands Length") bb_stdDev = input(1.2, title="Bollinger Bands Standard Deviation") // Ulur standard deviation për Bollinger Bands stochastic_length = input(14, title="Stochastic Length") stochastic_k = input(3, title="Stochastic %K") stochastic_d = input(3, title="Stochastic %D") rsi_length = input(14, title="RSI Length") macd_short = input(12, title="MACD Short Length") macd_long = input(26, title="MACD Long Length") macd_signal = input(9, title="MACD Signal Length") atr_length = input(14, title="ATR Length") risk_factor = input(1.0, title="ATR Risk Factor") // Risku për stop-loss reward_factor = input(2.5, title="ATR Reward Factor") // Fitimi për take-profit // Bollinger Bands basis = ta.sma(close, bb_length) upper_band = basis + bb_stdDev * ta.stdev(close, bb_length) lower_band = basis - bb_stdDev * ta.stdev(close, bb_length) // Stochastic stochastic_k_value = ta.sma(ta.stoch(close, high, low, stochastic_length), stochastic_k) stochastic_d_value = ta.sma(stochastic_k_value, stochastic_d) // RSI rsi = ta.rsi(close, rsi_length) // MACD [macdLine, signalLine, _] = ta.macd(close, macd_short, macd_long, macd_signal) // ATR atr_value = ta.atr(atr_length) // Logjikë për sinjale Blerje (Buy) buy_condition = (close < lower_band) and (stochastic_k_value < 30) and (rsi < 40) and (macdLine > signalLine) // Logjikë për sinjale Shitje (Sell) sell_condition = (close > upper_band) and (stochastic_k_value > 70) and (rsi > 60) and (macdLine < signalLine) // Kufizimi kohor për sesionet e Londrës dhe Amerikës (08:00 - 16:00 UTC për Londër dhe 13:00 - 21:00 UTC për Amerikë) london_session = (hour >= 8 and hour < 16) // Londër: 08:00 - 16:00 UTC us_session = (hour >= 13 and hour < 21) // SHBA: 13:00 - 21:00 UTC // Vizualizimi i sinjaleve vetëm gjatë sesioneve të Londrës dhe Amerikës active_session = london_session or us_session // Kushti për të mbyllur pozitat 15 minuta para mbylljes së sesionit të Amerikës close_15_min_before_us = (hour == 20 and minute >= 45) // 15 minuta para mbylljes (21:00 UTC) // Vizualizimi i sinjaleve plotshape(series=buy_condition and active_session, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Signal") plotshape(series=sell_condition and active_session, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal") // Vizualizimi i stop-loss dhe take-profit long_stoploss = close - risk_factor * atr_value long_takeprofit = close + reward_factor * atr_value short_stoploss = close + risk_factor * atr_value short_takeprofit = close - reward_factor * atr_value plot(long_stoploss, color=color.green, linewidth=1, title="Long Stop-Loss", display=display.none) // Fshi Bollinger Bands plot(long_takeprofit, color=color.green, linewidth=1, title="Long Take-Profit", display=display.none) // Fshi Bollinger Bands plot(short_stoploss, color=color.red, linewidth=1, title="Short Stop-Loss", display=display.none) // Fshi Bollinger Bands plot(short_takeprofit, color=color.red, linewidth=1, title="Short Take-Profit", display=display.none) // Fshi Bollinger Bands // Strategjia për hyrje dhe dalje vetëm gjatë sesioneve aktive strategy.entry("Buy", strategy.long, when=buy_condition and active_session) strategy.entry("Sell", strategy.short, when=sell_condition and active_session) // Mbyllja e pozitave 15 minuta para mbylljes së sesionit të Amerikës strategy.close("Buy", when=close_15_min_before_us) strategy.close("Sell", when=close_15_min_before_us) // Strategjia për take-profit dhe stop-loss strategy.exit("Take Profit/Stop Loss", "Buy", stop=long_stoploss, limit=long_takeprofit, when=buy_condition and active_session) strategy.exit("Take Profit/Stop Loss", "Sell", stop=short_stoploss, limit=short_takeprofit, when=sell_condition and active_session)