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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
// 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" |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :
Filename : download the ITF files
How to import ITF files into ProRealTime platform?
PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
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
BRAVO….
I am getting a Syntex error when entering the code
How do you get this to work in PRT v11 ?
no te funciona el indicador?
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)
Hi … what are the conditions for buy signal using this indicator? Tks
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
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.
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