EMA12/26 buy spot only
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © sasinp

//@version=5
strategy("EMA12/26 buy spot only", overlay=true)

longCondition = ta.crossover(ta.ema(close, 12), ta.ema(close, 26))
if (longCondition)
    strategy.entry("buy", strategy.long)

if ta.crossunder(ta.ema(close, 12), ta.ema(close, 26))
    strategy.close("buy")
