MACD IMPULSE ELDER DIVERGENCE
Forums › ProRealTime forum Français › Support ProOrder › MACD IMPULSE ELDER DIVERGENCE
- This topic has 4 replies, 2 voices, and was last updated 8 years ago by RECALL.
-
-
09/10/2016 at 3:50 PM #12923
Bonjour,
débutant en programmation je tente de déclencher un signal de vente si l’indicateur “MACD IMPULSE ELDER divergence-elder impulsebuy” regresse brutalement de plus -1 sans succes depuis plusieurs jours, auriez vous la gentillesse d’éclairer mes lanternes. je joint ici le code de l’indicateur de reference
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109// variables// pc, fast ma, 12// pl, slow ma, 26// ps, signal, 9// p, exp ma EIS, 18// set first three as histogramspc=12pl=26ps=9p=13//periodos EISaa=exponentialaverage[p](close)cc=MACD[pc,pl,ps](close)if aa > aa[1] and cc>cc[1] Thendd =cc*2elsedd=0endifif aa<aa[1] and cc < cc[1] thenee=cc*2elseee=0endifif ( aa <aa[1] and cc > cc[1]) or (aa>aa[1] and cc<cc[1]) thenff=cc*2elseff=0endifREM MACDhh=exponentialaverage[pc](close) - exponentialaverage[pl](close)REM Signalhh1=exponentialaverage[ps](hh)// DIVERGENCES ZeroLag MACD adapted from HK-LISSE RSI divergences codeEMAshort1 = exponentialaverage[pc](close)EMAshort2 = exponentialaverage[pc](EMAshort1)DifferenceShort = EMAshort1 - EMAshort2ZeroLagShort = EMAshort1 + DifferenceShortEMAlong1 = exponentialaverage[pl](close)EMAlong2 = exponentialaverage[pl](EMAlong1)DifferenceLong = EMAlong1 - EMAlong2ZeroLagLong = EMAlong1 + DifferenceLongZeroLagMACD = ZeroLagShort - ZeroLagLongsignal1=ExponentialAverage[ps](ZEROLAGMACD)signal2=ExponentialAverage[ps](signal1)DIFFERENCE2=signal1-signal2SignalMACD=signal1+DIFFERENCE2x = ZeroLagMACDy = SignalMACD// BEARISH DIVERGENCES MACDhi=max(hi,x)hico=max(hico,max(high,high[1]))if x crosses under y thensto2b=sto1bsto1b=hihi=0p3b=p1bp2b=max(p1b,hico1)p1b=max(highest[3](high),hico)if p2b=p1b thenp2b=max(p3b,p4b)endifhico=0hico1=0endifif x<y thenp4b=hico1hico1=max(hico1,high)endifif p1b>p2b and sto1b<sto2b and x crosses under y and x<x[1] thensignB= hh//-2elsesignB= 0endif// BULLISH MACD DIVERGENCESlo=min(lo,x)lowco=min(lowco,min(low,low[1]))if x CROSSES OVER y thensto2h=sto1hsto1h=lolo=100p3h=p1hp2h=min(p1h,lowco1)p1h=min(lowest[3](low),lowco)if p2h=p1h thenp2h=min(p3h,p4h)endiflowco=100000lowco1=100000endifif x>y thenp4h=lowco1lowco1=min(lowco1,low)endifif p1h<p2h and sto1h > sto2h and x crosses over y and x>x[1] thensignH= hh//2elsesignH= 0endifreturn dd*pipsize COLOURED(0,255,0) as "elder impulsebuy", ee*pipsize COLOURED(255,0,0) as "elder impulsesell", ff*pipsize coloured(0,0,255) as "elder impulsechange", hh*pipsize as "macd", hh1*pipsize as "signal macd", signH*pipsize as "Bullish MACD Divergence", signB*pipsize as "Bearish MACD Divergence" , 0 as " zero "09/10/2016 at 3:59 PM #12926Voici mon début
123456789101112131415161718// Définition des paramètres du codeDEFPARAM CumulateOrders = False // Cumul des positions désactivé// Conditions pour ouvrir une position en vente à découvertindicator1, ignored, ignored, ignored, ignored, ignored, ignored, ignored = CALL "MACD IMPULSE ELDER divergence"c1 = (indicator1 >= 3.8)indicator2, ignored, ignored, ignored, ignored, ignored, ignored, ignored = CALL "MACD IMPULSE ELDER divergence"indicator3, ignored, ignored, ignored, ignored, ignored, ignored, ignored = CALL "MACD IMPULSE ELDER divergence"c2 = (indicator2 CROSSES UNDER indicator3)IF c1 AND c2 THENSELLSHORT 1 CONTRACT AT MARKETENDIF// Stops et objectifsSET STOP pLOSS 12SET TARGET pPROFIT 209/10/2016 at 4:19 PM #12927voilà çà marche en revanche je n’arrive pas à sélectionner que les signaux très violents
1234567891011121314151617181920// Définition des paramètres du codeDEFPARAM CUMULATEORDERS = FALSEDEFPARAM FLATBEFORE = 080000DEFPARAM FLATAFTER = 220000// Conditions pour ouvrir une position en vente à découvertindicator1, ignored, ignored, ignored, ignored, ignored, ignored, ignored = CALL "MACD IMPULSE ELDER divergence"c1 = (indicator1 >= 7)indicator2, ignored, ignored, ignored, ignored, ignored, ignored, ignored = CALL "MACD IMPULSE ELDER divergence"c2 = ((indicator2-2) < indicator1)IF c1 AND c2 THENSELLSHORT 4 CONTRACT AT MARKETENDIF// Stops et objectifsSET STOP pLOSS 10SET TARGET pPROFIT 409/11/2016 at 1:49 PM #12947Merci d’utiliser le bouton d’insertion de code pour une meilleure compréhension les prochaines fois 🙂
Quels sont les signaux très violents que tu souhaiterai uniquement prendre? Une ou deux images permettrai de bien comprendre la demande, merci.
09/18/2016 at 10:28 PM #13247 -
AuthorPosts
Find exclusive trading pro-tools on