Hamidzaghi963

Wait 5 sec.

Hamidzaghi963Bitcoin / TetherUS PERPETUAL CONTRACTBINANCE:BTCUSDT.Phamidzaghi```pinescript //@version=5 indicator("Custom Strategy", overlay=true) length1 = input(20, title="MA Length 1") length2 = input(50, title="MA Length 2") length3 = input(100, title="MA Length 3") ma1 = ta.sma(close, length1) ma2 = ta.sma(close, length2) ma3 = ta.sma(close, length3) plot(ma1, color=color.blue, title="MA 20") plot(ma2, color=color.red, title="MA 50") plot(ma3, color=color.green, title="MA 100") longCondition = ta.crossover(ma1, ma2) or ta.crossover(ma1, ma3) shortCondition = ta.crossunder(ma1, ma2) or ta.crossunder(ma1, ma3) stochK = ta.stoch(close, high, low, 14) stochD = ta.sma(stochK, 3) longEntry = longCondition and (stochK < 20 and ta.crossover(stochK, stochD)) shortEntry = shortCondition and (stochK > 80 and ta.crossunder(stochK, stochD)) plotshape(longEntry, style=shape.labelup, location=location.belowbar, color=color.green, text="BUY") plotshape(shortEntry, style=shape.labeldown, location=location.abovebar, color=color.red, text="SELL") alertcondition(longEntry, title="Long Entry Alert", message="Long entry signal!") alertcondition(shortEntry, title="Short Entry Alert", message="Short entry signal!") ```