strategy(“50-day Moving Average Strategy”)
lookback = 50
ma = sma(close, lookback)
long_entry = crossover(close, ma)
short_entry = crossunder(close, ma)
long_exit = crossunder(close, ma)
short_exit = crossover(close, ma)
If long_entry
strategy.entry(“long”, strategy.long)...