JJ Tec

Macd-Squeeze.

Category: Indicators By: JJ Tec Created: March 29, 2019, 8:22 AM
March 29, 2019, 8:22 AM
Indicators
10 Comments
Macd-Squeeze.

Hi, I leave a very practical modification of Macd and Squeeze, the MACD histogram is colored in red or green depending on whether the squeeze is active or not. Additionally, the MACD line is colored green if the RSI is oversold or red, if it is in overbought.

 

// JJP- Marzo 2019. 

// Settings
Length=20
mult=2
lenghkc=20
Multkc=1.5
Macdcorta=12
Macdlarga=26
Macdsignal=9
PeriodoRSI=14
sobreventaRSI=70
SobrecompraRSI=30

//Squeeze.
//BB
basis = average[length](close)
dev = mult * Std[length](close)
upperBB = basis + dev
lowerBB = basis - dev

//KC
ma = average[lengthKC](close)
myrange = range[lengthKC]
rangema = average[lengthKC](myrange)
upperKC = ma+rangema * multKC
lowerKC = ma-rangema * multKC

sqzOn = (lowerBB>lowerKC) AND (upperBB<upperKC)

if(sqzOn=1) then
 scolorR = 0
 scolorG = 300
else
 scolorR = 255
 scolorG = 0
ENDIF


REM MACD
myMACD=exponentialaverage[MACDCorta]-exponentialaverage[MACDLarga]
signal=exponentialaverage[MACDSignal](myMACD)

Osma=mymacd-signal


// RSI
MyRSi=rsi[PeriodRSI](close)

if MyRsi>70 then
 r=255
 g=0
 b=0
endif
if MyRSI<30 then
 r=55
 g=255
 b=55
endif

if myRSI>30 and myrsi<70 then
 R=55
 g=0
 B=255

endif



return osma coloured(scolorR,scolorg,0) style(histogram) as "Osma_Sque", mymacd coloured (r,g,b)as "macd", signal as "Signal"

Download
Filename: JJp_MACD_Squeeze.itf
Downloads: 507
JJ Tec
JJ Tec Veteran
Developer by day, aspiring writer by night. Still compiling my bio... Error 404: presentation not found.
Author’s Profile

Comments

HarryPro
2 years ago
#

Hello, Firtly there appears to be a typo on line 6 "lenghkc=20" should this be "lengthkc=20". Secondly this will not run on my auto trades -- "The trading system was stopped because an indicator received a negative or zero parameter ex:(-10). You can modify your code to to prevent negative parameters then backtest the system to check the correction." error on ProOrder. Any Help Please. Many thanks in advance Harry

Pixeldd
4 years ago
#

Ich bekomme beim einfügen des Indikators einen Fehler angezeigt. Was bitte muss ich genau ändern am Code ? Der Indikator wird kurz angezeigt und verschwindet dann wieder. Habe vom programmieren leider absolut keine Ahnung. Hilfe wäre nett.

phanz
5 years ago
#

Hi ... what are the conditions for buy signal using this indicator? Tks

JJ Tec
5 years ago
#

Hola Las condiciones de entrada / salida vienen en el libro de J. Carter Mastering the trade. Aunque imagino que podrias implementar otras señales de entrada / salida con otros osciladores de momentum

luiskohnen
5 years ago
#

Solo hay que cambiar la variable MACDSignal por otro nombre, ya que el programa reconoce a MACDSIgnal como la señal del indicador MACD disponible. (me parece)

MadBat
6 years ago
#

How do you get this to work in PRT v11 ?

JJ Tec
6 years ago
#

no te funciona el indicador?

JackD
7 years ago
#

I am getting a Syntex error when entering the code

mauro1966
7 years ago
#

BRAVO....

Juanjo
7 years ago
#

Hola, Buscando un sistema valido para operar el squeeze, he reprogramado el indicador para incorporar un oscilador y el flujo de dinero de Twiggs. El resultado es el de la imagen

ProRealCode ProRealCode
Loading...