Back

Moving Average crossover help

I'm looking to build a algo, but I don't really know how,

but a algo trading straedgy that involves, crossover movement.

Using Short when,9EMA crossover 12SMA, and close position, once it hits 50EMA.

also 50SMA crossing 100SMA, sell when it hits 200SMA.

can anyone help me?

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.


like I get to use

        # create a 9 period exponential moving average

        self.fast = self.EMA(self.symbol, 9);

       

        # create a 12 period simple moving average

        self.slow = self.SMA(self.symbol, 12);

as the intials part, but how I make it close position once it hit say 40SMA?


 

       

0

Hi Evil Corp ,

Could you please try to implement an algorithm that shorts SPY when EMA(9) crosses SMA(12)?
Here is the link to the documentation, with examples, to guide you.
After you do, please share the algorithm with the community and we can help you further.

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.


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