How to create algo for MACD Intraday Trend Following strategy?
How to create algo for MACD Intraday Trend Following strategy?
In this episode , we are going to learn how to code MACD Intraday Trend Following Strategy.
Let’s get into the set-up.
Condition:
This is a slightly complicated strategy, we will be using Bollinger Band in combination with MACD to take buying, selling, shorting and short covering decisions.
Buy: When MACD line crosses signal line, with histogram above 0 and closing price of the candle is above Top Bollinger Band.
Short: When signal line crosses MACD line, with histogram below 0 and closing price of the candle is below Bottom Bollinger Band.
Sell: When we get Short signal
Cover: When we get Buy signal
Example:
Buy: When MACD line crosses signal line, with histogram above 0 and current time is within the allowable trade time of 9.30 & 3.15 and closing price of the candle is above Top Bollinger Band.
Short: When signal line crosses MACD line, with histogram below 0 and current time is within the allowable trade time of 9.30 & 3.15 and closing price of the candle is below Bottom Bollinger Band.
Sell: When we get Short signal or if time crosses 3.15
Cover: When we get Buy signal or if time crosses 3.15