Hi,
I was wondering if anyone can help with this indicator, we have some code, but it does not work.
It is required for breakout with a squeeze, GCTrader1 has this running IG/CMC charting software, but we would like this coded for MT4 if possible.
This is the code and from this thread:
If anything is required, then please do advise and I will help/provide where I can.
http://www.forexfactory.com/showthread.php?t=57426
Thanks,
Guess
trigger = undefined
rem This is the buy setup which detects when the bollinger bandwidth(with number of periods equal to B) has made a new low followed by an increase in bandwidth below the trigger line(L) and the MACD is trending up.
if (round((BollingerBandWidth[b](close))*10000)-((BollingerBandWidth[b](close[1]))*10000))>=1 and BollingerBandWidth[b](close[1])<L and round((MACDline[5,13,1](close)))>round((MACDline[5,13,1](close[1]))) then
trigger =1
endif
rem This is the exit setup which detects a turnaround in the MACD histogram. The turnaround threshold is determined by A
if abs((round(MACDline[5,13,1](close[1])))) - abs((round(MACDline[5,13,1](close))))>=A then
trigger = 0
endif
rem This is the short sell setup which detects when the bollinger bandwidth has made a new low followed by an increase in bandwidth below the trigger line and the MACD is trending down.
if (round((BollingerBandWidth[b](close))*10000)-((BollingerBandWidth[b](close[1]))*10000))>=1 and BollingerBandWidth[b](close[1])<L and round((MACDline[5,13,1](close)))<round((MACDline[5,13,1](close[1]))) then
trigger =-1
endif
rem This is the exit setup which detects a turnaround in the MACD histogram. The turnaround threshold is determined by A
if abs((round(MACDline[5,13,1](close[1])))) - abs((round(MACDline[5,13,1](close)))) >= A then
trigger = 0
endif
PP = (DHIGH(1) +DCLOSE(1) + DLOW(1))/3
rtwo=(pP+dhigh(1)-dlow(1))
rone=(pP*2)-dlow(1)
sone=(pP*2)-dhigh(1)
stwo=pP-dhigh(1)+dlow(1)
rem P is the pivot point deviation
PIVOT = P
if TRIGGER = 1 and ((medianprice<(PP + PIVOT) AND medianprice>(PP - PIVOT)) OR (medianprice<(SONE + PIVOT) AND medianprice>(SONE - PIVOT)) OR (medianprice<(STWO + PIVOT) AND medianprice>(STWO - PIVOT))) THEN
BUY 1 SHARES AT MARKET REALTIME
ENDIF
IF TRIGGER = 0 THEN
SELL 1 SHARES AT MARKET
ENDIF
if TRIGGER = -1 and ((medianprice<(PP + PIVOT) AND medianprice>(PP - PIVOT)) OR (medianprice<(RONE + PIVOT) AND medianprice>(RONE - PIVOT)) OR (medianprice<(RTWO + PIVOT) AND medianprice>(RTWO - PIVOT))) THEN
SELLSHORT 1 SHARES AT MARKET REALTIME
ENDIF
IF TRIGGER = 0 THEN
EXITSHORT 1 SHARES AT MARKET
ENDIF
I was wondering if anyone can help with this indicator, we have some code, but it does not work.
It is required for breakout with a squeeze, GCTrader1 has this running IG/CMC charting software, but we would like this coded for MT4 if possible.
This is the code and from this thread:
If anything is required, then please do advise and I will help/provide where I can.
http://www.forexfactory.com/showthread.php?t=57426
Thanks,
Guess
trigger = undefined
rem This is the buy setup which detects when the bollinger bandwidth(with number of periods equal to B) has made a new low followed by an increase in bandwidth below the trigger line(L) and the MACD is trending up.
if (round((BollingerBandWidth[b](close))*10000)-((BollingerBandWidth[b](close[1]))*10000))>=1 and BollingerBandWidth[b](close[1])<L and round((MACDline[5,13,1](close)))>round((MACDline[5,13,1](close[1]))) then
trigger =1
endif
rem This is the exit setup which detects a turnaround in the MACD histogram. The turnaround threshold is determined by A
if abs((round(MACDline[5,13,1](close[1])))) - abs((round(MACDline[5,13,1](close))))>=A then
trigger = 0
endif
rem This is the short sell setup which detects when the bollinger bandwidth has made a new low followed by an increase in bandwidth below the trigger line and the MACD is trending down.
if (round((BollingerBandWidth[b](close))*10000)-((BollingerBandWidth[b](close[1]))*10000))>=1 and BollingerBandWidth[b](close[1])<L and round((MACDline[5,13,1](close)))<round((MACDline[5,13,1](close[1]))) then
trigger =-1
endif
rem This is the exit setup which detects a turnaround in the MACD histogram. The turnaround threshold is determined by A
if abs((round(MACDline[5,13,1](close[1])))) - abs((round(MACDline[5,13,1](close)))) >= A then
trigger = 0
endif
PP = (DHIGH(1) +DCLOSE(1) + DLOW(1))/3
rtwo=(pP+dhigh(1)-dlow(1))
rone=(pP*2)-dlow(1)
sone=(pP*2)-dhigh(1)
stwo=pP-dhigh(1)+dlow(1)
rem P is the pivot point deviation
PIVOT = P
if TRIGGER = 1 and ((medianprice<(PP + PIVOT) AND medianprice>(PP - PIVOT)) OR (medianprice<(SONE + PIVOT) AND medianprice>(SONE - PIVOT)) OR (medianprice<(STWO + PIVOT) AND medianprice>(STWO - PIVOT))) THEN
BUY 1 SHARES AT MARKET REALTIME
ENDIF
IF TRIGGER = 0 THEN
SELL 1 SHARES AT MARKET
ENDIF
if TRIGGER = -1 and ((medianprice<(PP + PIVOT) AND medianprice>(PP - PIVOT)) OR (medianprice<(RONE + PIVOT) AND medianprice>(RONE - PIVOT)) OR (medianprice<(RTWO + PIVOT) AND medianprice>(RTWO - PIVOT))) THEN
SELLSHORT 1 SHARES AT MARKET REALTIME
ENDIF
IF TRIGGER = 0 THEN
EXITSHORT 1 SHARES AT MARKET
ENDIF