Daily SP500 with MACD
- ProRealAlgos

- Jun 21, 2022
- 1 min read
Updated: Jun 15, 2023
13 lines of code for the SP500 index on the daily timeframe.

The code
entrycondition1 = MACD[12,26,9][0] < MACD[12,26,9][1] and MACD[12,26,9][1] < MACD[12,26,9][2] and MACD[12,26,9][2] < MACD[12,26,9][3] and MACD[12,26,9][3] < MACD[12,26,9][4]
entrycondition2 = MACD[12,26,9][0] < 0 and close[0] < close[1]
entrycondition3 = (close - low) / (high - low) < 0.13
IF entrycondition1 and entrycondition2 and entrycondition3 THEN
BUY 1 CONTRACTS AT MARKET
ENDIF
exitcodition = close[0] > high[1]
If LongOnMarket AND exitcodition THEN
SELL AT MARKET
ENDIF



This is amazing --- please do the needful and if possible send me at s.karan0404@gmail.com
Please send me the python/algo code. aptsarvesh@gmail.com
Hi,
Thanks for the free Algo . hellavaday@gmail.com
Please send me the python/algo code. dtracy00@yahoo.com
I'm a python developer but new to trading. Thank You.
Thanks for sending the code for the free algo. My email: stevensona491@gmail.com