I am a recent college grad working in the financial/investment industry (so im familiar with the terminology), a novice to Quantipian.com, and I have a little experience in coding/using python. I was hoping I could ask the community to help me with the example algo for MACD to achieve what it is im looking for.
I'm having some issues reading trough the sample code. from what I gather its set to buy when the MACD "Signal" is > 0 and it sells when the MACD "Signal" is < 0. Its not quite clear what the "signal" is or how that number is calculated.
From my experience MACD is a graph that is made up of two lines, one black and one red. The red line represents the 9-day exponential moving average and the black line represents the differece between the 26-day and 12-day exponential moving average, I notice the sample algo mentions this info, but im still not sure what they are using as the "signal" when they compare it to 0 to trigger an order.
I am trying to build an algo that tracks the relationship between the black line and the red line (leaving out any relevance to values crossing over/under 0 like the sample algo focuses on).
I am specifically trying to figure this algo to the s&p 500, when the black line crosses over the red line I want that to trigger a buy signal and when it crosses under the red line I want that to trigger a sell signal.
Can anyone out there give me some guidance/explain what it is the sample algo is calculating?
Thanks guys, any help is appreciated.