ABCD Pattern in 2 timeframes
Forums › ProRealTime English forum › ProScreener support › ABCD Pattern in 2 timeframes
- This topic has 7 replies, 3 voices, and was last updated 4 years ago by robertogozzi.
Tagged: ABCD pattern, mtf
-
-
01/24/2020 at 8:11 PM #117766
Can I have the code for the screener that detects ABCD according to below link’s code in 2 timeframes? I mean, if there is in 2 timeframe red-red or green-green ABCD pattern.
https://www.prorealcode.com/prorealtime-market-screeners/abcd-pattern-screener/
01/24/2020 at 8:12 PM #117767lets say in 15 Min and 1 H timeframes
01/24/2020 at 10:13 PM #117774Ok, I’ll make it soon.
01/25/2020 at 1:00 PM #117800There you go (I also attach the .ITF file), you can change TFs as you wish:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863TIMEFRAME(1 hour)////------------------------------------------------------------------------------------// Bullish pattern//------------------------------------------------------------------------------------IF BarIndex = 0 THENLmaxBars = 100LminBars = 5//Ldistance = 15 * pipsizeLpointA = highLbarA = BarIndexLpointB = lowLbarB = BarIndexLpointC = 0LbarC = 0LpointD = 0//LbarD = 0Lcount = 0//XLpointA = 0//XLbarA = 0//XLpointB = 0//XLbarB = 0//XLpointC = 0//XLbarC = 0//XLpointD = 0//XLbarD = 0ENDIF//IF Lcount > LmaxBars THEN//XLpointA = LpointA//XLbarA = LbarA//XLpointB = LpointB//XLbarB = LbarB//XLpointC = LpointC//XLbarC = LbarC//XLpointD = LpointD//XLbarD = LbarDLpointA = highLbarA = BarIndexLpointB = lowLbarB = BarIndexLpointC = 0LbarC = 0LpointD = 0//LbarD = 0Lcount = 0ENDIFLcount = Lcount + 1 //incrementare il passare delle Bars per azzerare tutto quando arriva a 100//// Determinare se il prezzo scende sotto A, in tal caso avremo una nuova A più bassa e ripartiremo daccapo con B,C e DLpointA = max(LpointA,high)IF LpointA > LpointA[1] THENLbarA = BarIndexLcount = 0LpointB = lowLbarB = BarIndexLpointC = 0LbarC = 0LpointD = 0//LbarD = 0ENDIF//// Determinare se il prezzo sale sopra B, in tal caso avremo una nuova B più alta e ripartiremo daccapo con C e DIF LpointC = 0 THENLpointB = min(LpointB,low)IF LpointB < LpointB[1] THENLbarB = BarIndexENDIFENDIF// Calcolare la differenza tra i punti A e B e le due percentuali di fibonacci da usare per la verifica di CLdiffAB = LpointA - LpointBLfibC1 = LdiffAB * 0.618LfibC2 = LdiffAB * 0.786LfibD1 = LpointC - (LfibC1 * 1.270)LfibD2 = LpointC - (LfibC2 * 1.618)IF high >= (LpointB + LfibC1) AND high <= (LpointB + LfibC2) THEN// se il MINIMO è tra 0.618 e 0.786 abbiamo trovato il Lpoint C....LpointC = highLbarC = BarIndexIF LpointC < LpointC[1] THENLpointC = LpointC[1]LbarC = LbarC[1]ENDIFELSIF close > (LpointB + LfibC2) THEN// ...altrimenti si riparte daccapo con un nuovo Lpoint A ed un nuovo Lpoint BLpointA = highLbarA = BarIndexLpointB = lowLbarB = BarIndexLpointC = 0LbarC = 0//LbarD = 0LpointD = 0Lcount = 0ENDIF//// Una volta superato il 161.8 si riparte daccapo//IF close < LfibD2 AND LpointD > 0 THEN//XLpointA= LpointA//XLbarA = LbarA//XLpointB= LpointB//XLbarB = LbarB//XLpointC= LpointC//XLbarC = LbarC//XLpointD= LpointD//XLbarD = LbarDLpointA = highLbarA = BarIndexLpointB = lowLbarB = BarIndexLpointC = 0LbarC = 0LpointD = 0//LbarD = 0Lcount = 0ENDIFIF LpointC > 0 THENIF LpointD = 0 THENIF close <= LfibD1 AND close >= LfibD2 THENLpointD = close//LbarD = BarIndexELSIF close < LfibD2 THENLpointD = LfibD2//LbarD = BarIndexENDIFELSEIF close <= LfibD1 AND close >= LfibD2 THENLpointD = closeIF LpointD < LpointD[1] THEN//LbarD = BarIndexELSELpointD = LpointD[1]ENDIFELSE//XLpointA= LpointA//XLbarA = LbarA//XLpointB= LpointB//XLbarB = LbarB//XLpointC= LpointC//XLbarC = LbarC//XLpointD= LpointD//XLbarD = LbarDLpointA = highLbarA = BarIndexLcount = 0LpointB = 0LbarB = 0LpointC = 0LbarC = 0LpointD = 0//LbarD = 0ENDIFENDIFENDIF// si stampano i punti trovati, ognuno dipendente dal precedente, si stampa A, poi B solo se A è stato stampato, poi C solo se B è stato stampato ed infine D se anche C è stato stampatoIF LpointC > 0 THENIF ((LbarC - LbarA) < LminBars ) THENLpointC = 0x = BarIndex - LbarBFOR i = x DOWNTO 0IF low[i] < LpointB THENLpointB = low[i]LbarB = BarIndex[i]ENDIFNEXTENDIFENDIF//IF LpointD > 0 THEN//IF ((LbarC - LbarA) < LminBars ) OR ((LbarD - LbarC) < LminBars ) THEN//LpointD = 0//ENDIF//ENDIFIF LpointA > 0 THENIF LpointB > 0 THENIF LpointC > 0 THENIF LpointD > 0 THEN//IF LpointD[1] = 0 THEN//XLpointA = LpointA//XLbarA = LbarA//XLpointB = LpointB//XLbarB = LbarB//XLpointC = LpointC//XLbarC = LbarC//XLpointD = LpointD//XLbarD = LbarD//ENDIF//DRAWTEXT("A",LbarA,LpointA - Ldistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("B",LbarB,LpointB + Ldistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("C",LbarC,LpointC - Ldistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("D",LbarD,LpointD + Ldistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTRIANGLE(LbarA,LpointA,LbarB,LpointB,LbarC,LpointC)coloured(50,205,50,255)//DRAWTRIANGLE(LbarC,LpointC,LbarD,LpointC,LbarD,LpointD)coloured(50,205,50,255)ENDIFENDIFENDIFENDIF//IF LpointD = 0 AND XLpointD > 0 THEN//DRAWTEXT("A",XLbarA,XLpointA - Ldistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("B",XLbarB,XLpointB + Ldistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("C",XLbarC,XLpointC - Ldistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("D",XLbarD,XLpointD + Ldistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTRIANGLE(XLbarA,XLpointA,XLbarB,XLpointB,XLbarC,XLpointC)coloured(50,205,50,255)//DRAWTRIANGLE(XLbarC,XLpointC,XLbarD,XLpointC,XLbarD,XLpointD)coloured(50,205,50,255)//ENDIF//------------------------------------------------------------------------------------// Bearish pattern//------------------------------------------------------------------------------------IF BarIndex = 0 THENSmaxBars = 100SminBars = 5//Sdistance = 10 * pipsizeSpointA = lowSbarA = BarIndexSpointB = highSbarB = BarIndexSpointC = 0SbarC = 0SpointD = 0SbarD = 0Scount = 0//XSpointA = low//XSbarA = BarIndex//XSpointB = high//XSbarB = BarIndex//XSpointC = 0//XSbarC = 0//XSpointD = 0//XSbarD = 0ENDIF//IF Scount > SmaxBars THEN//XSpointA = SpointA//XSbarA = SbarA//XSpointB = SpointB//XSbarB = SbarB//XSpointC = SpointC//XSbarC = SbarC//XSpointD = SpointD//XSbarD = SbarDSpointA = lowSbarA = BarIndexSpointB = highSbarB = BarIndexSpointC = 0SbarC = 0SpointD = 0SbarD = 0Scount = 0ENDIFScount = Scount + 1 //incrementare il passare delle Bars per azzerare tutto quando arriva a 100//// Determinare se il prezzo scende sotto A, in tal caso avremo una nuova A più bassa e ripartiremo daccapo con B,C e DSpointA = min(SpointA,low)IF SpointA < SpointA[1] THENSbarA = BarIndexScount = 0SpointB = highSbarB = BarIndexSpointC = 0SbarC = 0SpointD = 0SbarD = 0ENDIF//// Determinare se il prezzo sale sopra B, in tal caso avremo una nuova B più alta e ripartiremo daccapo con C e DIF SpointC = 0 THENSpointB = max(SpointB,high)IF SpointB > SpointB[1] THENSbarB = BarIndexENDIFENDIF// Calcolare la differenza tra i punti A e B e le due percentuali di fibonacci da usare per la verifica di CSdiffAB = SpointB - SpointASfibC1 = SdiffAB * 0.618SfibC2 = SdiffAB * 0.786SfibD1 = SpointC + (SfibC1 * 1.270)SfibD2 = SpointC + (SfibC2 * 1.618)IF low <= (SpointB - SfibC1) AND low >= (SpointB - SfibC2) THEN// se il MINIMO è tra 0.618 e 0.786 abbiamo trovato il Spoint C....SpointC = lowSbarC = BarIndexIF SpointC < SpointC[1] THENSpointC = SpointC[1]SbarC = SbarC[1]ENDIFELSIF close < (SpointB - SfibC2) THEN// ...altrimenti si riparte daccapo con un nuovo Spoint A ed un nuovo Spoint BSpointA = lowSbarA = BarIndexSpointB = highSbarB = BarIndexSpointC = 0SbarC = 0SbarD = 0SpointD = 0Scount = 0ELSIF close > SpointB THEN//SpointB = high//SbarB = BarIndex//SpointC = 0//SbarC = 0//SbarD = 0//SpointD = 0ENDIF//// Una volta superato il 161.8 si riparte daccapo//IF close > SfibD2 AND SpointD > 0 THEN//XSpointA= SpointA//XSbarA = SbarA//XSpointB= SpointB//XSbarB = SbarB//XSpointC= SpointC//XSbarC = SbarC//XSpointD= SpointD//XSbarD = SbarDSpointA = lowSpointA = lowSbarA = BarIndexSpointB = highSbarB = BarIndexSpointC = 0SbarC = 0SpointD = 0SbarD = 0Scount = 0ENDIFIF SpointC > 0 THENIF SpointD = 0 THENIF close >= SfibD1 AND close <= SfibD2 THENSpointD = closeSbarD = BarIndexELSIF close > SfibD2 THENSpointD = SfibD2SbarD = BarIndexENDIFELSEIF close >= SfibD1 AND close <= SfibD2 THENSpointD = closeIF SpointD > SpointD[1] THENSbarD = BarIndexELSESpointD = SpointD[1]ENDIFELSE//XSpointA= SpointA//XSbarA = SbarA//XSpointB= SpointB//XSbarB = SbarB//XSpointC= SpointC//XSbarC = SbarC//XSpointD= SpointD//XSbarD = SbarDSpointA = lowSbarA = BarIndexScount = 0SpointB = 0SbarB = 0SpointC = 0SbarC = 0SpointD = 0SbarD = 0ENDIFENDIFENDIF// si stampano i punti trovati, ognuno dipendente dal precedente, si stampa A, poi B solo se A è stato stampato, poi C solo se B è stato stampato ed infine D se anche C è stato stampatoIF SpointC > 0 THENIF ((SbarC - SbarA) < SminBars ) THENSpointC = 0x = BarIndex - SbarBFOR i = x DOWNTO 0IF high[i] > SpointB THENSpointB = high[i]SbarB = BarIndex[i]ENDIFNEXTENDIFENDIFIF SpointD > 0 THENIF ((SbarD - SbarC) < SminBars ) THEN//IF SpointD > 0 THEN//IF ((SbarC - SbarA) < SminBars ) OR ((SbarD - SbarC) < SminBars ) THEN//SpointD = 0//ENDIF//ENDIFSpointD = 0SbarD = 0ENDIFENDIFIF SpointA > 0 THENIF SpointB > 0 THENIF SpointC > 0 THENIF SpointD > 0 THEN//XSpointA = SpointA//XSbarA = SbarA//XSpointB = SpointB//XSbarB = SbarB//XSpointC = SpointC//XSbarC = SbarC//XSpointD = SpointD//XSbarD = SbarD//DRAWTEXT("A",SbarA,SpointA - Sdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("B",SbarB,SpointB + Sdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("C",SbarC,SpointC - Sdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("D",SbarD,SpointD + Sdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTRIANGLE(SbarA,SpointA,SbarB,SpointB,SbarC,SpointC)coloured(200,120,120,255)//DRAWTRIANGLE(SbarC,SpointC,SbarD,SpointC,SbarD,SpointD)coloured(200,120,120,255)ENDIFENDIFENDIFENDIF//IF SpointD = 0 AND XSpointD > 0 THEN//DRAWTEXT("A",XSbarA,XSpointA - Sdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("B",XSbarB,XSpointB + Sdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("C",XSbarC,XSpointC - Sdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("D",XSbarD,XSpointD + Sdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTRIANGLE(XSbarA,XSpointA,XSbarB,XSpointB,XSbarC,XSpointC)coloured(200,120,120,255)//DRAWTRIANGLE(XSbarC,XSpointC,XSbarD,XSpointC,XSbarD,XSpointD)coloured(200,120,120,255)//ENDIFx = 0IF LpointD > 0 THENx = 1ELSIF SpointD > 0 THENx = 2ENDIF//TIMEFRAME(15 Minute)////------------------------------------------------------------------------------------// Bullish pattern//------------------------------------------------------------------------------------IF BarIndex = 0 THENyLmaxBars = 100yLminBars = 5//yLdistance = 15 * pipsizeyLpointA = highyLbarA = BarIndexyLpointB = lowyLbarB = BarIndexyLpointC = 0yLbarC = 0yLpointD = 0//yLbarD = 0yLcount = 0//XyLpointA = 0//XyLbarA = 0//XyLpointB = 0//XyLbarB = 0//XyLpointC = 0//XyLbarC = 0//XyLpointD = 0//XyLbarD = 0ENDIF//IF yLcount > yLmaxBars THEN//XyLpointA = yLpointA//XyLbarA = yLbarA//XyLpointB = yLpointB//XyLbarB = yLbarB//XyLpointC = yLpointC//XyLbarC = yLbarC//XyLpointD = yLpointD//XyLbarD = yLbarDyLpointA = highyLbarA = BarIndexyLpointB = lowyLbarB = BarIndexyLpointC = 0yLbarC = 0yLpointD = 0//yLbarD = 0yLcount = 0ENDIFyLcount = yLcount + 1 //incrementare il passare delle Bars per azzerare tutto quando arriva a 100//// Determinare se il prezzo scende sotto A, in tal caso avremo una nuova A più bassa e ripartiremo daccapo con B,C e DyLpointA = max(yLpointA,high)IF yLpointA > yLpointA[1] THENyLbarA = BarIndexyLcount = 0yLpointB = lowyLbarB = BarIndexyLpointC = 0yLbarC = 0yLpointD = 0//yLbarD = 0ENDIF//// Determinare se il prezzo sale sopra B, in tal caso avremo una nuova B più alta e ripartiremo daccapo con C e DIF yLpointC = 0 THENyLpointB = min(yLpointB,low)IF yLpointB < yLpointB[1] THENyLbarB = BarIndexENDIFENDIF// Calcolare la differenza tra i punti A e B e le due percentuali di fibonacci da usare per la verifica di CyLdiffAB = yLpointA - yLpointByLfibC1 = yLdiffAB * 0.618yLfibC2 = yLdiffAB * 0.786yLfibD1 = yLpointC - (yLfibC1 * 1.270)yLfibD2 = yLpointC - (yLfibC2 * 1.618)IF high >= (yLpointB + yLfibC1) AND high <= (yLpointB + yLfibC2) THEN// se il MINIMO è tra 0.618 e 0.786 abbiamo trovato il Lpoint C....yLpointC = highyLbarC = BarIndexIF yLpointC < yLpointC[1] THENyLpointC = yLpointC[1]yLbarC = yLbarC[1]ENDIFELSIF close > (yLpointB + yLfibC2) THEN// ...altrimenti si riparte daccapo con un nuovo Lpoint A ed un nuovo Lpoint ByLpointA = highyLbarA = BarIndexyLpointB = lowyLbarB = BarIndexyLpointC = 0yLbarC = 0//yLbarD = 0yLpointD = 0yLcount = 0ENDIF//// Una volta superato il 161.8 si riparte daccapo//IF close < yLfibD2 AND yLpointD > 0 THEN//XyLpointA= yLpointA//XyLbarA = yLbarA//XyLpointB= yLpointB//XyLbarB = yLbarB//XyLpointC= yLpointC//XyLbarC = yLbarC//XyLpointD= yLpointD//XyLbarD = yLbarDyLpointA = highyLbarA = BarIndexyLpointB = lowyLbarB = BarIndexyLpointC = 0yLbarC = 0yLpointD = 0//yLbarD = 0yLcount = 0ENDIFIF yLpointC > 0 THENIF yLpointD = 0 THENIF close <= yLfibD1 AND close >= yLfibD2 THENyLpointD = close//yLbarD = BarIndexELSIF close < yLfibD2 THENyLpointD = yLfibD2//yLbarD = BarIndexENDIFELSEIF close <= yLfibD1 AND close >= yLfibD2 THENyLpointD = closeIF yLpointD < yLpointD[1] THEN//yLbarD = BarIndexELSEyLpointD = yLpointD[1]ENDIFELSE//XyLpointA= yLpointA//XyLbarA = yLbarA//XyLpointB= yLpointB//XyLbarB = yLbarB//XyLpointC= yLpointC//XyLbarC = yLbarC//XyLpointD= yLpointD//XyLbarD = yLbarDyLpointA = highyLbarA = BarIndexyLcount = 0yLpointB = 0yLbarB = 0yLpointC = 0yLbarC = 0yLpointD = 0//yLbarD = 0ENDIFENDIFENDIF// si stampano i punti trovati, ognuno dipendente dal precedente, si stampa A, poi B solo se A è stato stampato, poi C solo se B è stato stampato ed infine D se anche C è stato stampatoIF yLpointC > 0 THENIF ((yLbarC - yLbarA) < yLminBars ) THENyLpointC = 0yx = BarIndex - yLbarBFOR yi = yx DOWNTO 0IF low[yi] < yLpointB THENyLpointB = low[yi]yLbarB = BarIndex[yi]ENDIFNEXTENDIFENDIF//IF yLpointD > 0 THEN//IF ((yLbarC - yLbarA) < yLminBars ) OR ((yLbarD - yLbarC) < yLminBars ) THEN//yLpointD = 0//ENDIF//ENDIFIF yLpointA > 0 THENIF yLpointB > 0 THENIF yLpointC > 0 THENIF yLpointD > 0 THEN//IF yLpointD[1] = 0 THEN//XyLpointA = yLpointA//XyLbarA = yLbarA//XyLpointB = yLpointB//XyLbarB = yLbarB//XyLpointC = yLpointC//XyLbarC = yLbarC//XyLpointD = yLpointD//XyLbarD = yLbarD//ENDIF//DRAWTEXT("A",yLbarA,yLpointA - yLdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("B",yLbarB,yLpointB + yLdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("C",yLbarC,yLpointC - yLdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("D",yLbarD,yLpointD + yLdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTRIANGLE(yLbarA,yLpointA,yLbarB,yLpointB,yLbarC,yLpointC)coloured(50,205,50,255)//DRAWTRIANGLE(yLbarC,yLpointC,yLbarD,yLpointC,yLbarD,yLpointD)coloured(50,205,50,255)ENDIFENDIFENDIFENDIF//IF yLpointD = 0 AND XyLpointD > 0 THEN//DRAWTEXT("A",XyLbarA,XyLpointA - yLdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("B",XyLbarB,XyLpointB + yLdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("C",XyLbarC,XyLpointC - yLdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("D",XyLbarD,XyLpointD + yLdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTRIANGLE(XyLbarA,XyLpointA,XyLbarB,XyLpointB,XyLbarC,XyLpointC)coloured(50,205,50,255)//DRAWTRIANGLE(XyLbarC,XyLpointC,XyLbarD,XyLpointC,XyLbarD,XyLpointD)coloured(50,205,50,255)//ENDIF//------------------------------------------------------------------------------------// Bearish pattern//------------------------------------------------------------------------------------IF BarIndex = 0 THENySmaxBars = 100ySminBars = 5//ySdistance = 10 * pipsizeySpointA = lowySbarA = BarIndexySpointB = highySbarB = BarIndexySpointC = 0ySbarC = 0ySpointD = 0ySbarD = 0yScount = 0//XySpointA = low//XySbarA = BarIndex//XySpointB = high//XySbarB = BarIndex//XySpointC = 0//XySbarC = 0//XySpointD = 0//XySbarD = 0ENDIF//IF yScount > ySmaxBars THEN//XySpointA = ySpointA//XySbarA = ySbarA//XySpointB = ySpointB//XySbarB = ySbarB//XySpointC = ySpointC//XySbarC = ySbarC//XySpointD = ySpointD//XySbarD = ySbarDySpointA = lowySbarA = BarIndexySpointB = highySbarB = BarIndexySpointC = 0ySbarC = 0ySpointD = 0ySbarD = 0yScount = 0ENDIFyScount = yScount + 1 //incrementare il passare delle Bars per azzerare tutto quando arriva a 100//// Determinare se il prezzo scende sotto A, in tal caso avremo una nuova A più bassa e ripartiremo daccapo con B,C e DySpointA = min(ySpointA,low)IF ySpointA < ySpointA[1] THENySbarA = BarIndexyScount = 0ySpointB = highySbarB = BarIndexySpointC = 0ySbarC = 0ySpointD = 0ySbarD = 0ENDIF//// Determinare se il prezzo sale sopra B, in tal caso avremo una nuova B più alta e ripartiremo daccapo con C e DIF ySpointC = 0 THENySpointB = max(ySpointB,high)IF ySpointB > ySpointB[1] THENySbarB = BarIndexENDIFENDIF// Calcolare la differenza tra i punti A e B e le due percentuali di fibonacci da usare per la verifica di CySdiffAB = ySpointB - ySpointAySfibC1 = ySdiffAB * 0.618ySfibC2 = ySdiffAB * 0.786ySfibD1 = ySpointC + (ySfibC1 * 1.270)ySfibD2 = ySpointC + (ySfibC2 * 1.618)IF low <= (ySpointB - ySfibC1) AND low >= (ySpointB - ySfibC2) THEN// se il MINIMO è tra 0.618 e 0.786 abbiamo trovato il Spoint C....ySpointC = lowySbarC = BarIndexIF ySpointC < ySpointC[1] THENySpointC = ySpointC[1]ySbarC = ySbarC[1]ENDIFELSIF close < (ySpointB - ySfibC2) THEN// ...altrimenti si riparte daccapo con un nuovo Spoint A ed un nuovo Spoint BySpointA = lowySbarA = BarIndexySpointB = highySbarB = BarIndexySpointC = 0ySbarC = 0ySbarD = 0ySpointD = 0yScount = 0ELSIF close > ySpointB THEN//ySpointB = high//ySbarB = BarIndex//ySpointC = 0//ySbarC = 0//ySbarD = 0//ySpointD = 0ENDIF//// Una volta superato il 161.8 si riparte daccapo//IF close > ySfibD2 AND ySpointD > 0 THEN//XySpointA= ySpointA//XySbarA = ySbarA//XySpointB= ySpointB//XySbarB = ySbarB//XySpointC= ySpointC//XySbarC = ySbarC//XySpointD= ySpointD//XySbarD = ySbarDySpointA = lowySpointA = lowySbarA = BarIndexySpointB = highySbarB = BarIndexySpointC = 0ySbarC = 0ySpointD = 0ySbarD = 0yScount = 0ENDIFIF ySpointC > 0 THENIF ySpointD = 0 THENIF close >= ySfibD1 AND close <= ySfibD2 THENySpointD = closeySbarD = BarIndexELSIF close > ySfibD2 THENySpointD = ySfibD2ySbarD = BarIndexENDIFELSEIF close >= ySfibD1 AND close <= ySfibD2 THENySpointD = closeIF ySpointD > ySpointD[1] THENySbarD = BarIndexELSEySpointD = ySpointD[1]ENDIFELSE//XySpointA= ySpointA//XySbarA = ySbarA//XySpointB= ySpointB//XySbarB = ySbarB//XySpointC= ySpointC//XySbarC = ySbarC//XySpointD= ySpointD//XySbarD = ySbarDySpointA = lowySbarA = BarIndexyScount = 0ySpointB = 0ySbarB = 0ySpointC = 0ySbarC = 0ySpointD = 0ySbarD = 0ENDIFENDIFENDIF// si stampano i punti trovati, ognuno dipendente dal precedente, si stampa A, poi B solo se A è stato stampato, poi C solo se B è stato stampato ed infine D se anche C è stato stampatoIF ySpointC > 0 THENIF ((ySbarC - ySbarA) < ySminBars ) THENySpointC = 0kx = BarIndex - ySbarBFOR ki = kx DOWNTO 0IF high[ki] > ySpointB THENySpointB = high[ki]ySbarB = BarIndex[ki]ENDIFNEXTENDIFENDIFIF ySpointD > 0 THENIF ((ySbarD - ySbarC) < ySminBars ) THEN//IF ySpointD > 0 THEN//IF ((ySbarC - ySbarA) < ySminBars ) OR ((ySbarD - ySbarC) < ySminBars ) THEN//ySpointD = 0//ENDIF//ENDIFySpointD = 0ySbarD = 0ENDIFENDIFIF ySpointA > 0 THENIF ySpointB > 0 THENIF ySpointC > 0 THENIF ySpointD > 0 THEN//XySpointA = ySpointA//XySbarA = ySbarA//XySpointB = ySpointB//XySbarB = ySbarB//XySpointC = ySpointC//XySbarC = ySbarC//XySpointD = ySpointD//XySbarD = ySbarD//DRAWTEXT("A",ySbarA,ySpointA - ySdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("B",ySbarB,ySpointB + ySdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("C",ySbarC,ySpointC - ySdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("D",ySbarD,ySpointD + ySdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTRIANGLE(ySbarA,ySpointA,ySbarB,ySpointB,ySbarC,ySpointC)coloured(200,120,120,255)//DRAWTRIANGLE(ySbarC,ySpointC,ySbarD,ySpointC,ySbarD,ySpointD)coloured(200,120,120,255)ENDIFENDIFENDIFENDIF//IF ySpointD = 0 AND XySpointD > 0 THEN//DRAWTEXT("A",XySbarA,XySpointA - ySdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("B",XySbarB,XySpointB + ySdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("C",XySbarC,XySpointC - ySdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTEXT("D",XySbarD,XySpointD + ySdistance,Dialog,Bold,14) coloured(205,0,205,255)//DRAWTRIANGLE(XySbarA,XySpointA,XySbarB,XySpointB,XySbarC,XySpointC)coloured(200,120,120,255)//DRAWTRIANGLE(XySbarC,XySpointC,XySbarD,XySpointC,XySbarD,XySpointD)coloured(200,120,120,255)//ENDIFy = 0IF yLpointD > 0 THENy = 1ELSIF ySpointD > 0 THENy = 2ENDIF//TIMEFRAME(default)//z = 0IF x = 1 AND y = 1 THENz = 1ELSIF x = 2 AND y = 2 THENz = 2ENDIFSCREENER[z](z AS "1=↑, 2=↓")3 users thanked author for this post.
01/25/2020 at 5:48 PM #117819Thank you so much.
01/29/2020 at 11:00 PM #118229Amazing job, Roberto.
1 user thanked author for this post.
02/03/2020 at 7:52 AM #118514Can you please update the code for when there is either Red/Green ABCD pattern in 15 Min TF and there is same color pattern in one of the last ten bars in 1 Hour TF including current TF.
02/03/2020 at 9:45 AM #118525Replace lines 421-426 with:
123456x = 0IF summation[10](LpointD > 0) THENx = 1ELSIF summation[10](SpointD > 0) THENx = 2ENDIF1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on