Roberts Pi Cycle Top and Bottom Indicator BTC
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © 0618crypto

//@version=4
study("Roberts Pi Cycle Top and Bottom Indicator BTC", overlay = true)

// Moving averages
ema1 = security("BTCUSD","D",sma(open, 350)*2)
ema2 = security("BTCUSD","D",sma(open, 111))
ema3 = security("BTCUSD","D",sma(open, 350))
if crossover(ema2,ema1)
    // PLOT
    // vertical indicator
    l = line.new(bar_index, high, bar_index, ema2, width = 2, color=color.yellow, style=line.style_solid)

 
// PLOT
// moving averages
plot(series=ema1, title="MA 350*2", color=color.green)
plot(series=ema2, title="MA 111", color=color.red)
plot(series=ema3, title="MA 350", color=color.white)