MACD With Bollinger Bands

We used Moving Average Convergence/Divergence (MACD) indicator to identify the direction of the market and to avoid whipsaw in a sideways market we added Bollinger Bands.

BUY : When MACD Crossed Above MACD Signal and Current High is greater than Bollinger Band Top.

SELL : When MACD Crossed Below MACD Signal and Current Low is Lower than Bollinger Band Bottom.

BUY{
SET a = MACDSignal(13,26,9,SIMPLE);
SET b = MACD(13,26,9,SIMPLE);
SET Bottom = BBB(CLOSE,12,2,SIMPLE);
SET Top = BBT(CLOSE,12,2,SIMPLE);
CROSSOVER(b,a) and HIGH>Top;}

b

SELL{
SET a = MACDSignal(13,26,9,SIMPLE);
SET b = MACD(13,26,9,SIMPLE);
SET Bottom = BBB(CLOSE,12,2,SIMPLE);
SET Top = BBT(CLOSE,12,2,SIMPLE);
CROSSOVER(a,b) and LOW<Bottom;} 

s

Advertisements

MACD Strategy

1

2

MACD : Moving Average Convergence/Divergence
RSI : Relative Strength Index

BUY : When MACD Crosses above MACD Signal Line And RSI > 60
SELL : when EMA Of Period 9 Crosses above Current High

Formula As Follows :

BUY{
set ma1 = MACDSIGNAL(13,26,9,SIMPLE);
set ma2 = MACD(13,26,9,SIMPLE);
CROSSOVER(ma2,ma1) and RSI(CLOSE,21) > 60;}

LONGEXIT{
CROSSOVER(EMA(close,9),HIGH);}