// Strategy if bullish_cross strategy.entry("long", strategy.long)
if bearish_cross strategy.entry("short", strategy.short)
strategy.close("long", when = bearish_cross or bullish_cross) strategy.close("short", when = bullish_cross)
// Colors bartrendcolor = close > movingaverage_fast and close > movingaverage_slow and change(movingaverage_slow) > 0 ? color.green : close < movingaverage_fast and close < movingaverage_slow and change(movingaverage_slow) < 0 ? color.red : color.blue barcolor(switch1 ? bartrendcolor : na)
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.