Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
[Noob Post] Help with a MACD & 200 EMA Strategy

Hi all,

I am new to quantopian 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 quantopian to backtest even more and potentially port the quantopian algorithim to a live trading platform.

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

1 response

@Ross

This condition:

when the MACD line crosses over the signal line while below zero on the histogram

never happened by definition of MACD Histogram:

MACD Histogram = MACD Line - Signal Line  

This and this may help.