cup with handle

Category: Indicators By: jacquesgermain Created: December 12, 2023, 10:09 AM
December 12, 2023, 10:09 AM
Indicators
0 Comments

indicator showing “cup with handle” figures, associate this indicator with its “cup with handle” screener

defparam CALCULATEONLASTBARS=300

//variable
searchzone=23

B5searchzone=searchzone//23 //nombre de bougies récentes où le plus haut est recherché
P1Price = 0
for i = 0 to B5searchzone
if high[i] > P1Price then
P1Price = high[i]
B5=i //de droite à gauche
B5index = BarIndex[i] //B5 index de bougie où le plus haut a été trouvé
endif
next
// En partant de B5 (le plus haut trouvé à l'étape précédente), trouver la bougie avec un plus haut égal ou inférieur à P1 et pour laquelle la bougie précédente (plus ancienne) a un plus haut supérieur à P1 ; soit B0 l'indice temps de cette bougie
B0price=0
for j=B5 to B5+172 DO
If high[j] <= P1Price and high[j+1] > P1Price then
B0price=high[j]
B0=j //de droite à gauche
B0index=barindex[j]
endif
next
// Soit P0 le plus bas entre B0 et B5
P0price = 10000
for k = B5 to B0
if low[k] < P0price then
P0index=barindex[K]
P0=k
P0price = low[k]
endif
next
// Noeuds du quadrillage
B0B5=abs(B0-B5)
boxheight = abs( P1price - P0price ) / 5
boxlength = round( (B0B5-0.5) / 5 )
reste=B0B5 MOD 5
B4= B5 + boxlength
B4index=B5index-boxlength
B3=B4+boxlength
B3index= B4index-boxlength
B2=B3+boxlength
B2index=B3index-boxlength
B1=B2+boxlength+reste
B1index=B2index-boxlength-reste
P1= P1price
L0= P0price
L1= P0price + boxheight
L2 = P0price + 2 * boxheight
L3 = P0price + 3 * boxheight
L4 = P0price + 4 * boxheight
flag=0
d=abs((b1-b4))+1
e=b4
deborde=highest[max(1,d)](close)[e]
//if islastbarupdate then
IF deborde<l3 THEN
flag=1
endif
//endif
flag1=0
f=abs((b2-b3))+1
deborde1=highest[max(1,f)](close)[b3]
IF deborde1<l2 THEN
flag1=1
endif
flagB0B1B4B5=0
fl=abs((b0-b1))+1
fm=abs((b4-b5))+1
lowdebordea=lowest[max(1,fl)](low)[b1]
lowdebordeb=lowest[max(1,fm)](low)[b5]
IF (lowdebordea or lowdebordeb) <(L2-(boxheight/3)) then
flagB0B1B4B5=1
endif
flagB1B2B3B4=0
fn=abs((b1-b2))+1
Fo=abs((b3-b4))+1
lowdebordec=lowest[max(1,fn)](low)[b2]
lowdeborded=lowest[max(1,fo)](low)[b4]
IF (lowdebordec or lowdeborded) <(L1-(boxheight/3)) then
flagB1B2B3B4=1
endif
lowdedans=0
lowdedans=(flagB0B1B4B5 or flagB1B2B3B4)>0
If barindex > B5index then
plusgrandL2=summation[B5](low>L2)=0
endif
trendhaussier=ExponentialAverage[4](close)[b0]>ExponentialAverage[4](close)[b0+5] or ExponentialAverage[4](close)[b0]>ExponentialAverage[4](close)[b0+10] or ExponentialAverage[4](close)[b0]>ExponentialAverage[4](close)[b0+15] or ExponentialAverage[4](close)[b0]>ExponentialAverage[4](close)[b0+20] or ExponentialAverage[4](close)[b0]>ExponentialAverage[4](close)[b0+25]
cote=high>low
lowanse=lowest[max(1,b5)](low)

condition=flag=1 and flag1=1 and lowdedans=1 and plusgrandL2=0 and b0index<b5index and B0price>L3 and lowanse>((p1price-p0price)*0.5+(p0price))

if condition then
DRAWRECTANGLE(B5INDEX,lowanse,Barindex,lowanse)coloured(192,192,192,55)FILLCOLOR(192,192,192,55)
DRAWRECTANGLE(barindex,lowanse,Barindex,P1price)coloured(192,192,192,55)FILLCOLOR(192,192,192,55)
DRAWRECTANGLE(B0INDEX,P0price,B0INDEX,P1price)coloured(192,192,192,55)FILLCOLOR(192,192,192,55)
DRAWRECTANGLE(B0INDEX, L0, B5INDEX, L0)coloured(192,192,192,55)FILLCOLOR(192,192,192,55)
DRAWRECTANGLE(B5INDEX,P0price,B5INDEX,P1price)coloured(192,192,192,55)FILLCOLOR(192,192,192,55)
if trendhaussier then
DRAWPOINT(b0index,high[b0]+0.01*high[b0],2)coloured(0,200,0)
endif
endif

return

 

Download
Filename: Cup-with-Handle.itf
Downloads: 98
jacquesgermain Senior
This author is like an anonymous function, present but not directly identifiable. More details on this code architect as soon as they exit 'incognito' mode.
Author’s Profile

Comments

Logo Logo
Loading...