Super SMA 5 8 13
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © tamerbozoglu
//@version=4

// ══════════════════════════════════════════════════════════════════════════════════════════════════ //
//# * ══════════════════════════════════════════════════════════════════════════════════════════════
//# *
//# * Study       : SMA 5 8 13 Buy / Sell Signal
//# * Author      : @BozzTamer
//# * Strategist  : @xtrader_
//# * Revision History
//# * Release     : Sep 17, 2023
//# * 
//# *
//# * ══════════════════════════════════════════════════════════════════════════════════════════════
// ══════════════════════════════════════════════════════════════════════════════════════════════════ //
//
//This indicator is based on the 5 8 13 simple moving average strategy of strategist Selcuk Gonencler.
//The indicator shows buy and sell signals when favorable conditions occur.

// ══ H O W    T O    U S E ══════════════════════════════════════════════════════════════════════════ //
// Above 5-8-13 - Confirmed hold/buy
// 5 below (8-13 above) - Be careful, lose weight but don't run away.
// Below 5-8 (above 13) - Risk has begun. Don't be stubborn. 13 is your last castle.
// 5-8-13 below. Don't fight! Wait until it rises above 5-8 again.

study(title="Super SMA 5 8 13", overlay=true)

src = close
ma5 = sma(src, 5)
ma8 = sma(src, 8)
ma13 = sma(src, 13)
buy_cond = cross(ma5, ma13) and ma5 > ma13
sell_cond = cross(ma5, ma13) and ma5 < ma8 and ma5 < ma13

plot( ma5, color=color.rgb(0, 255, 8), style=plot.style_line, title="SMA 5", linewidth=2, transp = 0)
plot( ma8, color=color.rgb(255, 230, 0), style=plot.style_line, title="SMA 8", linewidth=2, transp = 0)
plot( ma13, color=color.rgb(255, 0, 0), style=plot.style_line, title="SMA 13", linewidth=2, transp = 0)

plotarrow(buy_cond ? 1 : 0, colordown=color.rgb(0, 255, 8), title="BUY SIGNAL",maxheight=50, minheight=50, transp = 0)
plotarrow(sell_cond ? -1 : 0, colorup=color.rgb(255, 0, 0), title="SELL SIGNAL",maxheight=50, minheight=50, transp = 0)

alertcondition(buy_cond, title = "Buy Condition", message = "Buy Alert!")
alertcondition(sell_cond, title = "Sell Condition", message = "Sell Alert!")