Back to Community
Simple conditional buy/sell edit to MA strategy

All,

I'd like to add an additional line of logic to my code. Basically, I'd like to include another necessary condition that must be met (along with the original conditions in the code) that BUYS when the SPY is trading above the 200 day MA and SELLS when SPY is below 200 day MA.

Can I get some help?

Clone Algorithm
14
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 56f033dd7441dc0dea7d744f
There was a runtime error.