Back

[Noob Post] MACD & 200 EMA Strategy

Hi all,

I am new to quantconnect and am looking to create my first algorithm! I am trying to create something based on the following MACD & 200 EMA strategy.

Buy a stock or currency pair when the MACD line crosses over the signal line while below zero on the histogram & while the market is above the 200 EMA (showing an uptrend). I'd like to set a profit target of 1:1.5 risk-reward, so for example on a trade I would set a stop loss at -$100 and a take profit at +$150.

I've done some manual backtesting with this strategy and seen great returns, but I'd like to use quantconnect to backtest even more and potentially to live trade.

If anyone has ideas on how to get started, source code for similar algos, thoughts on how to improve the strategy, really anything at all, I would really appreciate your input!

Thanks,

Ross
 

Update Backtest







0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Check the two algorithms below:

 

https://github.com/QuantConnect/Lean/blob/master/Algorithm.Python/MACDTrendAlgorithm.py

https://github.com/QuantConnect/Lean/blob/master/Algorithm.Python/EmaCrossUniverseSelectionAlgorithm.py

 

2

Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed