ProRealCode - Trading & Coding with ProRealTime™
Bonjour à tous,
Je suis bloqué sur mon programme.
En effet je voulais récupérer les deux derniers antérieurs 1 et 2, et regarder dans le passé ce qu’il se passé par la suite.
Seulement le programme que j’ai fait ne prend pas en compte l’antérieur 2..
Auriez-vous une idée pour que je puisse résoudre ce problème ?
Il faut regarder à partir de la ligne 893
Merci par avance
timeFrame(default)
COMPTAGE=A+A1+A2+B+B1+B2+Q+Q1+Q2+W+W1+W2
MAGICSTO=COMPTAGE
///////////////////////////////////////////////////////////////// PAST FINDER
If Islastbarupdate Then
Once P2=MAGICSTO[2]
Once P1=MAGICSTO[1]
Once countA=0
Once countB=0
Once countC=0
For j=1 to DONNEES
If MAGICSTO[j+1]=P1 and MAGICSTO[j+2]=P2 Then
DRAWPOINT(barindex-(J+1), MAGICSTO[j+1],2) coloured(0,255,255)
If MAGICSTO[j]>MAGICSTO[j+1] Then
DeltaA=1
Else
DeltaA=0
Endif
If MAGICSTO[j]<MAGICSTO[j+1] Then
DeltaB=1
Else
DeltaB=0
Endif
If MAGICSTO[j]=MAGICSTO[j+1] Then
DeltaC=1
Else
DeltaC=0
Endif
countA=countA+DELTAA
countB=countB+DELTAB
countC=countC+DELTAC
Endif
Next
//NOMBRE DE FOIS
NBFOISNV=(countA+countB+countC)
//RATIO NV
RATIOH=round((countA*100)/NBFOISNV)
RATIOB=round((countB*100)/NBFOISNV)
RATIOHN=round(((countA+countC)*100)/NBFOISNV)
RATIOBN=round(((countB+countC)*100)/NBFOISNV)
SEGMENTH=RATIOH/20
SEGMENTB=RATIOB/20
SEGMENTHN=RATIOHN/20
SEGMENTBN=RATIOBN/20
RRH = max(0,50+(200-((RATIOH-10)-50)*12))
GGH = max(0,50+(200+((RATIOH-10)-50)*12))
RRB = max(0,50+(200-((RATIOB-10)-50)*12))
GGB = max(0,50+(200+((RATIOB-10)-50)*12))
RRHN = max(0,50+(200-((RATIOHN-10)-50)*12))
GGHN = max(0,50+(200+((RATIOHN-10)-50)*12))
RRBN = max(0,50+(200-((RATIOBN-10)-50)*12))
GGBN = max(0,50+(200+((RATIOBN-10)-50)*12))
If P1>0 Then
DRAWTRIANGLE(barindex-1, P1, barindex, P1, barindex, P1+SEGMENTHN)coloured((min(RRHN,255)),(min(GGHN,255)),0,70)bordercolor((min(RRHN,255)),(min(GGHN,255)),0,0)
DRAWTRIANGLE(barindex-1, P1, barindex, P1, barindex, P1-SEGMENTB)coloured((min(RRB,255)),(min(GGB,255)),0,70)bordercolor((min(RRB,255)),(min(GGB,255)),0,0)
DRAWTEXT("#countA#/ #countC#",Barindex+4,P1+SEGMENTHN,sansserif,bold,10)coloured(min(RRHN,255),min(GGHN,255),0)
DRAWTEXT("#countB#",Barindex+4,P1-SEGMENTB,sansserif,bold,10)coloured(min(RRB,255),min(GGB,255),0)
DRAWTEXT("#RATIOHN#%",Barindex+2,P1+SEGMENTHN,sansserif,bold,10)coloured(min(RRHN,255),min(GGHN,255),0)
DRAWTEXT("#RATIOB#%",Barindex+2,P1-SEGMENTB,sansserif,bold,10)coloured(min(RRB,255),min(GGB,255),0)
Endif
If P1<0 Then
DRAWTRIANGLE(barindex-1, P1, barindex, P1, barindex, P1+SEGMENTH)coloured((min(RRH,255)),(min(GGH,255)),0,70)bordercolor((min(RRH,255)),(min(GGH,255)),0,0)
DRAWTRIANGLE(barindex-1, P1, barindex, P1, barindex, P1-SEGMENTBN)coloured((min(RRBN,255)),(min(GGBN,255)),0,70)bordercolor((min(RRBN,255)),(min(GGBN,255)),0,0)
DRAWTEXT("#countB#/ #countC#",Barindex+4,P1-SEGMENTBN,sansserif,bold,10)coloured(min(RRBN,255),min(GGBN,255),0)
DRAWTEXT("#countA#",Barindex+4,P1+SEGMENTH,sansserif,bold,10)coloured(min(RRH,255),min(GGH,255),0)
DRAWTEXT("#RATIOBN#%",Barindex+2,P1-SEGMENTBN,sansserif,bold,10)coloured(min(RRBN,255),min(GGBN,255),0)
DRAWTEXT("#RATIOH#%",Barindex+2,P1+SEGMENTH,sansserif,bold,10)coloured(min(RRH,255),min(GGH,255),0)
Endif
If DataLigne Then
DRAWSEGMENT(barindex, 0, barindex-DONNEES, 0)coloured(0,255,255)
DRAWSEGMENT(barindex-DONNEES,-12, barindex-DONNEES, 12)coloured(0,255,255)
Endif
Endif
Return MAGICSTO as "MAGIC STO-PAST FINDER"
Désolé je ne vois pas de ligne 893 😆
Je n’ai pas bien compris le but du code, une explication peut être ?
L’instruction ONCE permet d’affecter une valeur 1 seule fois à une variable, donc je ne sais pas si cela est bien compris et utile dans le reste de ton code ?
DEFPARAM DRAWONLASTBARONLY=true
TIMEFRAME(1 HOUR)
K4a=Stochastic[PERIODEK,VITESSEK](close)
D4a=average[PERIODED](K4a)
K4a1=Stochastic[PERIODEK1,VITESSEK1](close)
D4a1=average[PERIODED1](K4a1)
K4a2=Stochastic[PERIODEK2,VITESSEK2](close)
D4a2=average[PERIODED2](K4a2)
/////////////////////////////////////////////////////
If K4a[0]<50 Then
BaisseA=1
Else
BaisseA=0
Endif
If K4a[0]>50 Then
HausseA=1
Else
HausseA=0
Endif
///rouge
IF ( D4a[0]<65 AND D4a[0]<D4a[1] and K4a[0]<D4a[0] and K4a[0]<30 and K4a[0]<K4a[1]) THEN
X1A=-1
Else
X1A=0
endif
IF (D4a[0]<55 and K4a[0]<D4a[0] and D4a[0]<D4a[1]) THEN
X2A=-1
Else
X2A=0
endif
IF (D4a[0]<20) THEN
X3A=-1
Else
X3A=0
endif
////vert
IF (D4a[0]>35 AND D4a[0]>D4a[1] and K4a[0]>D4a[0] and K4a[0]>70 and K4a[0]>K4a[1]) THEN
X4A=1
Else
X4A=0
endif
IF (D4a[0]>55 and K4a[0]>D4a[0] and D4a[0]>D4a[1]) THEN
X5A=1
Else
X5A=0
endif
IF (D4a[0]>80) THEN
X6A=1
Else
X6A=0
endif
////////////////////////Si Baisse
IF (X1A+X2A+X3A)<0 Then
A=-1
Endif
////////////////////////Si Hausse
IF (X4A+X5A+X6A)>0 Then
A=1
Endif
/////////////////////////Si neutre dans de la baisse
IF (X1A+X2A+X3A)=0 and BaisseA=1 Then
A=0
Endif
/////////////////////////Si neutre dans de la hausse
IF (X4A+X5A+X6A)=0 and HausseA=1 Then
A=0
Endif
///////////////////////////////////////////////////////////////////////////////////////////////////////
If K4a1[0]<50 Then
Baisse1A=1
Else
Baisse1A=0
Endif
If K4a1[0]>50 Then
Hausse1A=1
Else
Hausse1A=0
Endif
///rouge
IF ( D4a1[0]<65 AND D4a1[0]<D4a1[1] and K4a1[0]<D4a1[0] and K4a1[0]<30 and K4a1[0]<K4a1[1]) THEN
X11A=-1
Else
X11A=0
endif
IF (D4a1[0]<55 and K4a1[0]<D4a1[0] and D4a1[0]<D4a1[1]) THEN
X21A=-1
Else
X21A=0
endif
IF (D4a1[0]<20) THEN
X31A=-1
Else
X31A=0
endif
////vert
IF (D4a1[0]>35 AND D4a1[0]>D4a1[1] and K4a1[0]>D4a1[0] and K4a1[0]>70 and K4a1[0]>K4a1[1]) THEN
X41A=1
Else
X41A=0
endif
IF (D4a1[0]>55 and K4a1[0]>D4a1[0] and D4a1[0]>D4a1[1]) THEN
X51A=1
Else
X51A=0
endif
IF (D4a1[0]>80) THEN
X61A=1
Else
X61A=0
endif
////////////////////////Si Baisse
IF (X11A+X21A+X31A)<0 Then
A1=-1
Endif
////////////////////////Si Hausse
IF (X41A+X51A+X61A)>0 Then
A1=1
Endif
/////////////////////////Si neutre dans de la baisse
IF (X11A+X21A+X31A)=0 and Baisse1A=1 Then
A1=0
Endif
/////////////////////////Si neutre dans de la hausse
IF (X41A+X51A+X61A)=0 and Hausse1A=1 Then
A1=0
Endif
////////////////////////////////////////////////////////////////////////////////////
If K4a2[0]<50 Then
Baisse2A=1
Else
Baisse2A=0
Endif
If K4a2[0]>50 Then
Hausse2A=1
Else
Hausse2A=0
Endif
///rouge
IF ( D4a2[0]<65 AND D4a2[0]<D4a2[1] and K4a2[0]<D4a2[0] and K4a2[0]<30 and K4a2[0]<K4a2[1]) THEN
X12A=-1
Else
X12A=0
endif
IF (D4a2[0]<55 and K4a2[0]<D4a2[0] and D4a2[0]<D4a2[1]) THEN
X22A=-1
Else
X22A=0
endif
IF (D4a2[0]<20) THEN
X32A=-1
Else
X32A=0
endif
////vert
IF (D4a2[0]>35 AND D4a2[0]>D4a2[1] and K4a2[0]>D4a2[0] and K4a2[0]>70 and K4a2[0]>K4a2[1]) THEN
X42A=1
Else
X42A=0
endif
IF (D4a2[0]>55 and K4a2[0]>D4a2[0] and D4a2[0]>D4a2[1]) THEN
X52A=1
Else
X52A=0
endif
IF (D4a2[0]>80) THEN
X62A=1
Else
X62A=0
endif
////////////////////////Si Baisse
IF (X12A+X22A+X32A)<0 Then
A2=-1
Endif
////////////////////////Si Hausse
IF (X42A+X52A+X62A)>0 Then
A2=1
Endif
/////////////////////////Si neutre dans de la baisse
IF (X12A+X22A+X32A)=0 and Baisse2A=1 Then
A2=0
Endif
/////////////////////////Si neutre dans de la hausse
IF (X42A+X52A+X62A)=0 and Hausse2A=1 Then
A2=0
Endif
TIMEFRAME(2 HOUR)
K4b=Stochastic[PERIODEK,VITESSEK](close)
D4b=average[PERIODED](K4b)
K4b1=Stochastic[PERIODEK1,VITESSEK1](close)
D4b1=average[PERIODED1](K4b1)
K4b2=Stochastic[PERIODEK2,VITESSEK2](close)
D4b2=average[PERIODED2](K4b2)
/////////////////////////////////////////////////////
If K4B[0]<50 Then
BaisseB=1
Else
BaisseB=0
Endif
If K4B[0]>50 Then
HausseB=1
Else
HausseB=0
Endif
///rouge
IF ( D4b[0]<65 AND D4b[0]<D4b[1] and K4b[0]<D4b[0] and K4b[0]<30 and K4b[0]<K4b[1]) THEN
X1B=-1
Else
X1B=0
endif
IF (D4b[0]<55 and K4b[0]<D4b[0] and D4b[0]<D4b[1]) THEN
X2B=-1
Else
X2B=0
endif
IF (D4b[0]<20) THEN
X3B=-1
Else
X3B=0
endif
////vert
IF (D4b[0]>35 AND D4b[0]>D4b[1] and K4b[0]>D4b[0] and K4b[0]>70 and K4b[0]>K4b[1]) THEN
X4B=1
Else
X4B=0
endif
IF (D4b[0]>55 and K4b[0]>D4b[0] and D4b[0]>D4b[1]) THEN
X5B=1
Else
X5B=0
endif
IF (D4b[0]>80) THEN
X6B=1
Else
X6B=0
endif
////////////////////////Si Baisse
IF (X1B+X2B+X3B)<0 Then
B=-1
Endif
////////////////////////Si Hausse
IF (X4B+X5B+X6B)>0 Then
B=1
Endif
/////////////////////////Si neutre dans de la baisse
IF (X1B+X2B+X3B)=0 and BaisseB=1 Then
B=0
Endif
/////////////////////////Si neutre dans de la hausse
IF (X4B+X5B+X6B)=0 and HausseB=1 Then
B=0
Endif
///////////////////////////////////////////////////////////////////////////////////////////////////////
If K4b1[0]<50 Then
Baisse1B=1
Else
Baisse1B=0
Endif
If K4b1[0]>50 Then
Hausse1B=1
Else
Hausse1B=0
Endif
///rouge
IF ( D4b1[0]<65 AND D4b1[0]<D4b1[1] and K4b1[0]<D4b1[0] and K4b1[0]<30 and K4b1[0]<K4b1[1]) THEN
X11B=-1
Else
X11B=0
endif
IF (D4b1[0]<55 and K4b1[0]<D4b1[0] and D4b1[0]<D4b1[1]) THEN
X21B=-1
Else
X21B=0
endif
IF (D4b1[0]<20) THEN
X31B=-1
Else
X31B=0
endif
////vert
IF (D4b1[0]>35 AND D4b1[0]>D4b1[1] and K4b1[0]>D4b1[0] and K4b1[0]>70 and K4b1[0]>K4b1[1]) THEN
X41B=1
Else
X41B=0
endif
IF (D4b1[0]>55 and K4b1[0]>D4b1[0] and D4b1[0]>D4b1[1]) THEN
X51B=1
Else
X51B=0
endif
IF (D4b1[0]>80) THEN
X61B=1
Else
X61B=0
endif
////////////////////////Si Baisse
IF (X11B+X21B+X31B)<0 Then
B1=-1
Endif
////////////////////////Si Hausse
IF (X41B+X51B+X61B)>0 Then
B1=1
Endif
/////////////////////////Si neutre dans de la baisse
IF (X11B+X21B+X31B)=0 and Baisse1B=1 Then
B1=0
Endif
/////////////////////////Si neutre dans de la hausse
IF (X41B+X51B+X61B)=0 and Hausse1B=1 Then
B1=0
Endif
////////////////////////////////////////////////////////////////////////////////////
If K4b2[0]<50 Then
Baisse2B=1
Else
Baisse2B=0
Endif
If K4b2[0]>50 Then
Hausse2B=1
Else
Hausse2B=0
Endif
///rouge
IF ( D4b2[0]<65 AND D4b2[0]<D4b2[1] and K4b2[0]<D4b2[0] and K4b2[0]<30 and K4b2[0]<K4b2[1]) THEN
X12B=-1
Else
X12B=0
endif
IF (D4b2[0]<55 and K4b2[0]<D4b2[0] and D4b2[0]<D4b2[1]) THEN
X22B=-1
Else
X22B=0
endif
IF (D4b2[0]<20) THEN
X32B=-1
Else
X32B=0
endif
////vert
IF (D4b2[0]>35 AND D4b2[0]>D4b2[1] and K4b2[0]>D4b2[0] and K4b2[0]>70 and K4b2[0]>K4b2[1]) THEN
X42B=1
Else
X42B=0
endif
IF (D4b2[0]>55 and K4b2[0]>D4b2[0] and D4b2[0]>D4b2[1]) THEN
X52B=1
Else
X52B=0
endif
IF (D4b2[0]>80) THEN
X62B=1
Else
X62B=0
endif
////////////////////////Si Baisse
IF (X12B+X22B+X32B)<0 Then
B2=-1
Endif
////////////////////////Si Hausse
IF (X42B+X52B+X62B)>0 Then
B2=1
Endif
/////////////////////////Si neutre dans de la baisse
IF (X12B+X22B+X32B)=0 and Baisse2B=1 Then
B2=0
Endif
/////////////////////////Si neutre dans de la hausse
IF (X42B+X52B+X62B)=0 and Hausse2B=1 Then
B2=0
Endif
TIMEFRAME(4 HOUR)
K4Q=Stochastic[PERIODEK,VITESSEK](close)
D4Q=average[PERIODED](K4Q)
K4Q1=Stochastic[PERIODEK1,VITESSEK1](close)
D4Q1=average[PERIODED1](K4Q1)
K4Q2=Stochastic[PERIODEK2,VITESSEK2](close)
D4Q2=average[PERIODED2](K4Q2)
/////////////////////////////////////////////////////
If K4Q[0]<50 Then
BaisseQ=1
Else
BaisseQ=0
Endif
If K4Q[0]>50 Then
HausseQ=1
Else
HausseQ=0
Endif
///rouge
IF ( D4Q[0]<65 AND D4Q[0]<D4Q[1] and K4Q[0]<D4Q[0] and K4Q[0]<30 and K4Q[0]<K4Q[1]) THEN
X1Q=-1
Else
X1Q=0
endif
IF (D4Q[0]<55 and K4Q[0]<D4Q[0] and D4Q[0]<D4Q[1]) THEN
X2Q=-1
Else
X2Q=0
endif
IF (D4Q[0]<20) THEN
X3Q=-1
Else
X3Q=0
endif
////vert
IF (D4Q[0]>35 AND D4Q[0]>D4Q[1] and K4Q[0]>D4Q[0] and K4Q[0]>70 and K4Q[0]>K4Q[1]) THEN
X4Q=1
Else
X4Q=0
endif
IF (D4Q[0]>55 and K4Q[0]>D4Q[0] and D4Q[0]>D4Q[1]) THEN
X5Q=1
Else
X5Q=0
endif
IF (D4Q[0]>80) THEN
X6Q=1
Else
X6Q=0
endif
////////////////////////Si Baisse
IF (X1Q+X2Q+X3Q)<0 Then
Q=-1
Endif
////////////////////////Si Hausse
IF (X4Q+X5Q+X6Q)>0 Then
Q=1
Endif
/////////////////////////Si neutre dans de la Qaisse
IF (X1Q+X2Q+X3Q)=0 and BaisseQ=1 Then
Q=0
Endif
/////////////////////////Si neutre dans de la hausse
IF (X4Q+X5Q+X6Q)=0 and HausseQ=1 Then
Q=0
Endif
///////////////////////////////////////////////////////////////////////////////////////////////////////
If K4Q1[0]<50 Then
Baisse1Q=1
Else
Baisse1Q=0
Endif
If K4Q1[0]>50 Then
Hausse1Q=1
Else
Hausse1Q=0
Endif
///rouge
IF ( D4Q1[0]<65 AND D4Q1[0]<D4Q1[1] and K4Q1[0]<D4Q1[0] and K4Q1[0]<30 and K4Q1[0]<K4Q1[1]) THEN
X11Q=-1
Else
X11Q=0
endif
IF (D4Q1[0]<55 and K4Q1[0]<D4Q1[0] and D4Q1[0]<D4Q1[1]) THEN
X21Q=-1
Else
X21Q=0
endif
IF (D4Q1[0]<20) THEN
X31Q=-1
Else
X31Q=0
endif
////vert
IF (D4Q1[0]>35 AND D4Q1[0]>D4Q1[1] and K4Q1[0]>D4Q1[0] and K4Q1[0]>70 and K4Q1[0]>K4Q1[1]) THEN
X41Q=1
Else
X41Q=0
endif
IF (D4Q1[0]>55 and K4Q1[0]>D4Q1[0] and D4Q1[0]>D4Q1[1]) THEN
X51Q=1
Else
X51Q=0
endif
IF (D4Q1[0]>80) THEN
X61Q=1
Else
X61Q=0
endif
////////////////////////Si Baisse
IF (X11Q+X21Q+X31Q)<0 Then
Q1=-1
Endif
////////////////////////Si Hausse
IF (X41Q+X51Q+X61Q)>0 Then
Q1=1
Endif
/////////////////////////Si neutre dans de la Baisse
IF (X11Q+X21Q+X31Q)=0 and Baisse1Q=1 Then
Q1=0
Endif
/////////////////////////Si neutre dans de la hausse
IF (X41Q+X51Q+X61Q)=0 and Hausse1Q=1 Then
Q1=0
Endif
////////////////////////////////////////////////////////////////////////////////////
If K4Q2[0]<50 Then
Baisse2Q=1
Else
Baisse2Q=0
Endif
If K4Q2[0]>50 Then
Hausse2Q=1
Else
Hausse2Q=0
Endif
///rouge
IF ( D4Q2[0]<65 AND D4Q2[0]<D4Q2[1] and K4Q2[0]<D4Q2[0] and K4Q2[0]<30 and K4Q2[0]<K4Q2[1]) THEN
X12Q=-1
Else
X12Q=0
endif
IF (D4Q2[0]<55 and K4Q2[0]<D4Q2[0] and D4Q2[0]<D4Q2[1]) THEN
X22Q=-1
Else
X22Q=0
endif
IF (D4Q2[0]<20) THEN
X32Q=-1
Else
X32Q=0
endif
////vert
IF (D4Q2[0]>35 AND D4Q2[0]>D4Q2[1] and K4Q2[0]>D4Q2[0] and K4Q2[0]>70 and K4Q2[0]>K4Q2[1]) THEN
X42Q=1
Else
X42Q=0
endif
IF (D4Q2[0]>55 and K4Q2[0]>D4Q2[0] and D4Q2[0]>D4Q2[1]) THEN
X52Q=1
Else
X52Q=0
endif
IF (D4Q2[0]>80) THEN
X62Q=1
Else
X62Q=0
endif
////////////////////////Si Baisse
IF (X12Q+X22Q+X32Q)<0 Then
Q2=-1
Endif
////////////////////////Si Hausse
IF (X42Q+X52Q+X62Q)>0 Then
Q2=1
Endif
/////////////////////////Si neutre dans de la Baisse
IF (X12Q+X22Q+X32Q)=0 and Baisse2Q=1 Then
Q2=0
Endif
/////////////////////////Si neutre dans de la hausse
IF (X42Q+X52Q+X62Q)=0 and Hausse2Q=1 Then
Q2=0
Endif
TIMEFRAME(30 minutes)
K4W=Stochastic[PERIODEK,VITESSEK](close)
D4W=average[PERIODED](K4W)
K4W1=Stochastic[PERIODEK1,VITESSEK1](close)
D4W1=average[PERIODED1](K4W1)
K4W2=Stochastic[PERIODEK2,VITESSEK2](close)
D4W2=average[PERIODED2](K4W2)
/////////////////////////////////////////////////////
If K4W[0]<50 Then
BaisseW=1
Else
BaisseW=0
Endif
If K4W[0]>50 Then
HausseW=1
Else
HausseW=0
Endif
///rouge
IF ( D4W[0]<65 AND D4W[0]<D4W[1] and K4W[0]<D4W[0] and K4W[0]<30 and K4W[0]<K4W[1]) THEN
X1W=-1
Else
X1W=0
endif
IF (D4W[0]<55 and K4W[0]<D4W[0] and D4W[0]<D4W[1]) THEN
X2W=-1
Else
X2W=0
endif
IF (D4W[0]<20) THEN
X3W=-1
Else
X3W=0
endif
////vert
IF (D4W[0]>35 AND D4W[0]>D4W[1] and K4W[0]>D4W[0] and K4W[0]>70 and K4W[0]>K4W[1]) THEN
X4W=1
Else
X4W=0
endif
IF (D4W[0]>55 and K4W[0]>D4W[0] and D4W[0]>D4W[1]) THEN
X5W=1
Else
X5W=0
endif
IF (D4W[0]>80) THEN
X6W=1
Else
X6W=0
endif
////////////////////////Si Baisse
IF (X1W+X2W+X3W)<0 Then
W=-1
Endif
////////////////////////Si Hausse
IF (X4W+X5W+X6W)>0 Then
W=1
Endif
/////////////////////////Si neutre dans de la Waisse
IF (X1W+X2W+X3W)=0 and BaisseW=1 Then
W=0
Endif
/////////////////////////Si neutre dans de la hausse
IF (X4W+X5W+X6W)=0 and HausseW=1 Then
W=0
Endif
///////////////////////////////////////////////////////////////////////////////////////////////////////
If K4W1[0]<50 Then
Baisse1W=1
Else
Baisse1W=0
Endif
If K4W1[0]>50 Then
Hausse1W=1
Else
Hausse1W=0
Endif
///rouge
IF ( D4W1[0]<65 AND D4W1[0]<D4W1[1] and K4W1[0]<D4W1[0] and K4W1[0]<30 and K4W1[0]<K4W1[1]) THEN
X11W=-1
Else
X11W=0
endif
IF (D4W1[0]<55 and K4W1[0]<D4W1[0] and D4W1[0]<D4W1[1]) THEN
X21W=-1
Else
X21W=0
endif
IF (D4W1[0]<20) THEN
X31W=-1
Else
X31W=0
endif
////vert
IF (D4W1[0]>35 AND D4W1[0]>D4W1[1] and K4W1[0]>D4W1[0] and K4W1[0]>70 and K4W1[0]>K4W1[1]) THEN
X41W=1
Else
X41W=0
endif
IF (D4W1[0]>55 and K4W1[0]>D4W1[0] and D4W1[0]>D4W1[1]) THEN
X51W=1
Else
X51W=0
endif
IF (D4W1[0]>80) THEN
X61W=1
Else
X61W=0
endif
////////////////////////Si Baisse
IF (X11W+X21W+X31W)<0 Then
W1=-1
Endif
////////////////////////Si Hausse
IF (X41W+X51W+X61W)>0 Then
W1=1
Endif
/////////////////////////Si neutre dans de la Waisse
IF (X11W+X21W+X31W)=0 and Baisse1W=1 Then
W1=0
Endif
/////////////////////////Si neutre dans de la hausse
IF (X41W+X51W+X61W)=0 and Hausse1W=1 Then
W1=0
Endif
////////////////////////////////////////////////////////////////////////////////////
If K4W2[0]<50 Then
Baisse2W=1
Else
Baisse2W=0
Endif
If K4W2[0]>50 Then
Hausse2W=1
Else
Hausse2W=0
Endif
///rouge
IF ( D4W2[0]<65 AND D4W2[0]<D4W2[1] and K4W2[0]<D4W2[0] and K4W2[0]<30 and K4W2[0]<K4W2[1]) THEN
X12W=-1
Else
X12W=0
endif
IF (D4W2[0]<55 and K4W2[0]<D4W2[0] and D4W2[0]<D4W2[1]) THEN
X22W=-1
Else
X22W=0
endif
IF (D4W2[0]<20) THEN
X32W=-1
Else
X32W=0
endif
////vert
IF (D4W2[0]>35 AND D4W2[0]>D4W2[1] and K4W2[0]>D4W2[0] and K4W2[0]>70 and K4W2[0]>K4W2[1]) THEN
X42W=1
Else
X42W=0
endif
IF (D4W2[0]>55 and K4W2[0]>D4W2[0] and D4W2[0]>D4W2[1]) THEN
X52W=1
Else
X52W=0
endif
IF (D4W2[0]>80) THEN
X62W=1
Else
X62W=0
endif
////////////////////////Si Baisse
IF (X12W+X22W+X32W)<0 Then
W2=-1
Endif
////////////////////////Si Hausse
IF (X42W+X52W+X62W)>0 Then
W2=1
Endif
/////////////////////////Si neutre dans de la Waisse
IF (X12W+X22W+X32W)=0 and Baisse2W=1 Then
W2=0
Endif
/////////////////////////Si neutre dans de la hausse
IF (X42W+X52W+X62W)=0 and Hausse2W=1 Then
W2=0
Endif
timeFrame(default)
COMPTAGE=A+A1+A2+B+B1+B2+Q+Q1+Q2+W+W1+W2
MAGICSTO=COMPTAGE
///////////////////////////////////////////////////////////////// SNIFFER
If Islastbarupdate Then
P2=MAGICSTO[2]
P1=MAGICSTO[1]
countA=0
countB=0
countC=0
For j=1 to DONNEES
If MAGICSTO[j+1]=P1 and MAGICSTO[j+2]=P2 Then
DRAWPOINT(barindex-(J+1), MAGICSTO[j+1],2) coloured(0,255,255)
If MAGICSTO[j]>MAGICSTO[j+1] Then
DeltaA=1
Else
DeltaA=0
Endif
If MAGICSTO[j]<MAGICSTO[j+1] Then
DeltaB=1
Else
DeltaB=0
Endif
If MAGICSTO[j]=MAGICSTO[j+1] Then
DeltaC=1
Else
DeltaC=0
Endif
countA=countA+DELTAA
countB=countB+DELTAB
countC=countC+DELTAC
Endif
Next
//NOMBRE DE FOIS
NBFOISNV=(countA+countB+countC)
//RATIO NV
RATIOH=round((countA*100)/NBFOISNV)
RATIOB=round((countB*100)/NBFOISNV)
RATIOHN=round(((countA+countC)*100)/NBFOISNV)
RATIOBN=round(((countB+countC)*100)/NBFOISNV)
SEGMENTH=RATIOH/20
SEGMENTB=RATIOB/20
SEGMENTHN=RATIOHN/20
SEGMENTBN=RATIOBN/20
RRH = max(0,50+(200-((RATIOH-10)-50)*12))
GGH = max(0,50+(200+((RATIOH-10)-50)*12))
RRB = max(0,50+(200-((RATIOB-10)-50)*12))
GGB = max(0,50+(200+((RATIOB-10)-50)*12))
RRHN = max(0,50+(200-((RATIOHN-10)-50)*12))
GGHN = max(0,50+(200+((RATIOHN-10)-50)*12))
RRBN = max(0,50+(200-((RATIOBN-10)-50)*12))
GGBN = max(0,50+(200+((RATIOBN-10)-50)*12))
If P1>0 Then
DRAWTRIANGLE(barindex-1, P1, barindex, P1, barindex, P1+SEGMENTHN)coloured((min(RRHN,255)),(min(GGHN,255)),0,70)bordercolor((min(RRHN,255)),(min(GGHN,255)),0,0)
DRAWTRIANGLE(barindex-1, P1, barindex, P1, barindex, P1-SEGMENTB)coloured((min(RRB,255)),(min(GGB,255)),0,70)bordercolor((min(RRB,255)),(min(GGB,255)),0,0)
DRAWTEXT("#countA#/ #countC#",Barindex+4,P1+SEGMENTHN,sansserif,bold,10)coloured(min(RRHN,255),min(GGHN,255),0)
DRAWTEXT("#countB#",Barindex+4,P1-SEGMENTB,sansserif,bold,10)coloured(min(RRB,255),min(GGB,255),0)
DRAWTEXT("#RATIOHN#%",Barindex+2,P1+SEGMENTHN,sansserif,bold,10)coloured(min(RRHN,255),min(GGHN,255),0)
DRAWTEXT("#RATIOB#%",Barindex+2,P1-SEGMENTB,sansserif,bold,10)coloured(min(RRB,255),min(GGB,255),0)
Endif
If P1<0 Then
DRAWTRIANGLE(barindex-1, P1, barindex, P1, barindex, P1+SEGMENTH)coloured((min(RRH,255)),(min(GGH,255)),0,70)bordercolor((min(RRH,255)),(min(GGH,255)),0,0)
DRAWTRIANGLE(barindex-1, P1, barindex, P1, barindex, P1-SEGMENTBN)coloured((min(RRBN,255)),(min(GGBN,255)),0,70)bordercolor((min(RRBN,255)),(min(GGBN,255)),0,0)
DRAWTEXT("#countB#/ #countC#",Barindex+4,P1-SEGMENTBN,sansserif,bold,10)coloured(min(RRBN,255),min(GGBN,255),0)
DRAWTEXT("#countA#",Barindex+4,P1+SEGMENTH,sansserif,bold,10)coloured(min(RRH,255),min(GGH,255),0)
DRAWTEXT("#RATIOBN#%",Barindex+2,P1-SEGMENTBN,sansserif,bold,10)coloured(min(RRBN,255),min(GGBN,255),0)
DRAWTEXT("#RATIOH#%",Barindex+2,P1+SEGMENTH,sansserif,bold,10)coloured(min(RRH,255),min(GGH,255),0)
Endif
If DataLigne Then
DRAWSEGMENT(barindex, 0, barindex-DONNEES, 0)coloured(0,255,255)
DRAWSEGMENT(barindex-DONNEES,-12, barindex-DONNEES, 12)coloured(0,255,255)
Endif
Endif
Return MAGICSTO as "MAGIC STO-PAST FINDER"
J’ai collé le code complet
En fait je regarde sur 4 Time Frame Différents, le positionnement de 3 sto de différentes périodes et vitesses 2/1/2 , 4/2/4, 8/2/8. Il s’appelle donc MAGICSTO à partir de la ligne 893, il a un intervalle de +12 jusqu’à -12.
Sur ce MAGICSTO, dans timeframe défaut je viens regarder les deux derniers antérieurs [1] et [2].
Pour savoir comment est ce qu’ils ont agit dans le passé si : – ils ont rejetté vers le haut – si ils ont été égaux – ou si ils sont descendus.
Hier je pensai que mon code était faux mais en faite non. Le problème était que je regardais sur 10 000 données un historique et il fallait que je charge ma fenêtre du 30 mn sur 10 000 données également.
Le nouveau problème qui se montre à moi est que, parfois j’ai des écarts lorsque le programme tourne voir photos (PROBLEME AVANT ACTUALISATION) . Cela arrive de manière aléatoire. Lorsque je relance le programme tout rentre dans l’ordre voir photo (PROBLEME APRES REDEMARRAGE).
Ma question serait d’ou peut venir le problème et comment le résoudre ?
Merci par avance pour ton aide
Si ce n’est pas clair j’essayerai de reformuler ma demande
J’ai pu constater exactement le même problème sur les deux autres programmes que j’ai pu créer avec la même base (MAGICSTO).
Il y a régulièrement des problèmes d’actualisations avec la même source de données.
Le “module” que j’ai mis dans mon précédent commentaire viendra se plugger sur une fenetre que j’utilise déjà voir si la photo ci-joint.
Ton problème vient sans doute de ton code. La lecture de l’historique implique une seule lecture sur chaque UT d’une information, hors en temps réel à chaque tick tu vas chercher une valeur différente dans chaque UT puisque tu n’utilises pas UPDATEONCLOSE qui renvoie la dernière valeur clôturée (hors ici tu prends la valeur de tes indics dans chaque UT à l’instant T). Je n’ai pas bien pris le temps de lire et comprendre tout ton code, mais cette notion pourrait avoir un impact sur ta valeur calculée en temps réel.
Nicolas merci pour ton retour je vais faire un test
Tu me conseilles de le mettre en debut de code avec DEFPARAM, ou alors de le mettre dans chaque UT ?
Je pense reprendre d’ici quelques temps la “source” pour avoir plus de valeurs et de positionnement dans chaque UT. Cela me permettra d’avoir un intervalle de données beaucoup plus précis que 12 et -12.
Bonsoir Nicolas,
Mon problème est toujours existant, sur chaque relance de programme ou redémarrage de la cession.
Mettre updateonclose dans chaque UT ne met pas utile puisque je cherche à figer à l’instant t dans le TMF defaukt, le positionnement de plusieurs stochastic de différentes UT /périodes /vitesses.
Le triangle que tu peux appercevoir, se base sur les deux derniers antérieurs. Pour pouvoir connaitre qu’elles ont été, les conséquences de ce shémat sur l’instant d’après dans le passé.
Aurais-tu une autre idée pour que je puisse faire disparaître ce problème ?
Merci par avance
DEFPARAM DRAWONLASTBARONLY=true
TIMEFRAME(30 minutes)
K4W=Stochastic[PERIODEK,VITESSEK](close)
D4W=average[PERIODED](K4W)
K4W1=Stochastic[PERIODEK1,VITESSEK1](close)
D4W1=average[PERIODED1](K4W1)
K4W2=Stochastic[PERIODEK2,VITESSEK2](close)
D4W2=average[PERIODED2](K4W2)
/////////////////////////////////////////////////////
///Baisse
IF ( D4W[0]<65 AND D4W[0]<D4W[1] and K4W[0]<D4W[0] and K4W[0]<30 and K4W[0]<K4W[1]) THEN
X1W=-1
Else
X1W=0
endif
IF (D4W[0]<55 and K4W[0]<D4W[0] and D4W[0]<D4W[1]) THEN
X2W=-1
Else
X2W=0
endif
IF (D4W[0]<20) THEN
X3W=-1
Else
X3W=0
endif
////Hausse
IF (D4W[0]>35 AND D4W[0]>D4W[1] and K4W[0]>D4W[0] and K4W[0]>70 and K4W[0]>K4W[1]) THEN
X4W=1
Else
X4W=0
endif
IF (D4W[0]>55 and K4W[0]>D4W[0] and D4W[0]>D4W[1]) THEN
X5W=1
Else
X5W=0
endif
IF (D4W[0]>80) THEN
X6W=1
Else
X6W=0
endif
////////////////////////Si Baisse
IF (X1W+X2W+X3W)<0 Then
WB=-1
Else
WB=0
Endif
////////////////////////Si Hausse
IF (X4W+X5W+X6W)>0 Then
WH=1
Else
WH=0
Endif
///////////////////////////////////////////////////////////////////////////////////////////////////////
///Baisse
IF ( D4W1[0]<65 AND D4W1[0]<D4W1[1] and K4W1[0]<D4W1[0] and K4W1[0]<30 and K4W1[0]<K4W1[1]) THEN
X11W=-1
Else
X11W=0
endif
IF (D4W1[0]<55 and K4W1[0]<D4W1[0] and D4W1[0]<D4W1[1]) THEN
X21W=-1
Else
X21W=0
endif
IF (D4W1[0]<20) THEN
X31W=-1
Else
X31W=0
endif
////Hausse
IF (D4W1[0]>35 AND D4W1[0]>D4W1[1] and K4W1[0]>D4W1[0] and K4W1[0]>70 and K4W1[0]>K4W1[1]) THEN
X41W=1
Else
X41W=0
endif
IF (D4W1[0]>55 and K4W1[0]>D4W1[0] and D4W1[0]>D4W1[1]) THEN
X51W=1
Else
X51W=0
endif
IF (D4W1[0]>80) THEN
X61W=1
Else
X61W=0
endif
////////////////////////Si Baisse
IF (X11W+X21W+X31W)<0 Then
W1B=-1
Else
W1B=0
Endif
////////////////////////Si Hausse
IF (X41W+X51W+X61W)>0 Then
W1H=1
Else
W1H=0
Endif
////////////////////////////////////////////////////////////////////////////////////
///Baisse
IF ( D4W2[0]<65 AND D4W2[0]<D4W2[1] and K4W2[0]<D4W2[0] and K4W2[0]<30 and K4W2[0]<K4W2[1]) THEN
X12W=-1
Else
X12W=0
endif
IF (D4W2[0]<55 and K4W2[0]<D4W2[0] and D4W2[0]<D4W2[1]) THEN
X22W=-1
Else
X22W=0
endif
IF (D4W2[0]<20) THEN
X32W=-1
Else
X32W=0
endif
////Hausse
IF (D4W2[0]>35 AND D4W2[0]>D4W2[1] and K4W2[0]>D4W2[0] and K4W2[0]>70 and K4W2[0]>K4W2[1]) THEN
X42W=1
Else
X42W=0
endif
IF (D4W2[0]>55 and K4W2[0]>D4W2[0] and D4W2[0]>D4W2[1]) THEN
X52W=1
Else
X52W=0
endif
IF (D4W2[0]>80) THEN
X62W=1
Else
X62W=0
endif
////////////////////////Si Baisse
IF (X12W+X22W+X32W)<0 Then
W2B=-1
Else
W2B=0
Endif
////////////////////////Si Hausse
IF (X42W+X52W+X62W)>0 Then
W2H=1
Else
W2H=0
Endif
TIMEFRAME(1 HOUR)
K4a=Stochastic[PERIODEK,VITESSEK](close)
D4a=average[PERIODED](K4a)
K4a1=Stochastic[PERIODEK1,VITESSEK1](close)
D4a1=average[PERIODED1](K4a1)
K4a2=Stochastic[PERIODEK2,VITESSEK2](close)
D4a2=average[PERIODED2](K4a2)
/////////////////////////////////////////////////////
///Baisse
IF ( D4a[0]<65 AND D4a[0]<D4a[1] and K4a[0]<D4a[0] and K4a[0]<30 and K4a[0]<K4a[1]) THEN
X1A=-1
Else
X1A=0
endif
IF (D4a[0]<55 and K4a[0]<D4a[0] and D4a[0]<D4a[1]) THEN
X2A=-1
Else
X2A=0
endif
IF (D4a[0]<20) THEN
X3A=-1
Else
X3A=0
endif
////Hausse
IF (D4a[0]>35 AND D4a[0]>D4a[1] and K4a[0]>D4a[0] and K4a[0]>70 and K4a[0]>K4a[1]) THEN
X4A=1
Else
X4A=0
endif
IF (D4a[0]>55 and K4a[0]>D4a[0] and D4a[0]>D4a[1]) THEN
X5A=1
Else
X5A=0
endif
IF (D4a[0]>80) THEN
X6A=1
Else
X6A=0
endif
////////////////////////Si Baisse
IF (X1A+X2A+X3A)<0 Then
AB=-1
Else
AB=0
Endif
////////////////////////Si Hausse
IF (X4A+X5A+X6A)>0 Then
AH=1
Else
AH=0
Endif
///////////////////////////////////////////////////////////////////////////////////////////////////////
///Baisse
IF ( D4a1[0]<65 AND D4a1[0]<D4a1[1] and K4a1[0]<D4a1[0] and K4a1[0]<30 and K4a1[0]<K4a1[1]) THEN
X11A=-1
Else
X11A=0
endif
IF (D4a1[0]<55 and K4a1[0]<D4a1[0] and D4a1[0]<D4a1[1]) THEN
X21A=-1
Else
X21A=0
endif
IF (D4a1[0]<20) THEN
X31A=-1
Else
X31A=0
endif
////Hausse
IF (D4a1[0]>35 AND D4a1[0]>D4a1[1] and K4a1[0]>D4a1[0] and K4a1[0]>70 and K4a1[0]>K4a1[1]) THEN
X41A=1
Else
X41A=0
endif
IF (D4a1[0]>55 and K4a1[0]>D4a1[0] and D4a1[0]>D4a1[1]) THEN
X51A=1
Else
X51A=0
endif
IF (D4a1[0]>80) THEN
X61A=1
Else
X61A=0
endif
////////////////////////Si Baisse
IF (X11A+X21A+X31A)<0 Then
A1B=-1
Else
A1B=0
Endif
////////////////////////Si Hausse
IF (X41A+X51A+X61A)>0 Then
A1H=1
Else
A1H=0
Endif
////////////////////////////////////////////////////////////////////////////////////
///Baisse
IF ( D4a2[0]<65 AND D4a2[0]<D4a2[1] and K4a2[0]<D4a2[0] and K4a2[0]<30 and K4a2[0]<K4a2[1]) THEN
X12A=-1
Else
X12A=0
endif
IF (D4a2[0]<55 and K4a2[0]<D4a2[0] and D4a2[0]<D4a2[1]) THEN
X22A=-1
Else
X22A=0
endif
IF (D4a2[0]<20) THEN
X32A=-1
Else
X32A=0
endif
////Hausse
IF (D4a2[0]>35 AND D4a2[0]>D4a2[1] and K4a2[0]>D4a2[0] and K4a2[0]>70 and K4a2[0]>K4a2[1]) THEN
X42A=1
Else
X42A=0
endif
IF (D4a2[0]>55 and K4a2[0]>D4a2[0] and D4a2[0]>D4a2[1]) THEN
X52A=1
Else
X52A=0
endif
IF (D4a2[0]>80) THEN
X62A=1
Else
X62A=0
endif
////////////////////////Si Baisse
IF (X12A+X22A+X32A)<0 Then
A2B=-1
Else
A2B=0
Endif
////////////////////////Si Hausse
IF (X42A+X52A+X62A)>0 Then
A2H=1
Else
A2H=0
Endif
TIMEFRAME(2 HOUR)
K4b=Stochastic[PERIODEK,VITESSEK](close)
D4b=average[PERIODED](K4b)
K4b1=Stochastic[PERIODEK1,VITESSEK1](close)
D4b1=average[PERIODED1](K4b1)
K4b2=Stochastic[PERIODEK2,VITESSEK2](close)
D4b2=average[PERIODED2](K4b2)
/////////////////////////////////////////////////////
///Baisse
IF ( D4b[0]<65 AND D4b[0]<D4b[1] and K4b[0]<D4b[0] and K4b[0]<30 and K4b[0]<K4b[1]) THEN
X1B=-1
Else
X1B=0
endif
IF (D4b[0]<55 and K4b[0]<D4b[0] and D4b[0]<D4b[1]) THEN
X2B=-1
Else
X2B=0
endif
IF (D4b[0]<20) THEN
X3B=-1
Else
X3B=0
endif
////Hausse
IF (D4b[0]>35 AND D4b[0]>D4b[1] and K4b[0]>D4b[0] and K4b[0]>70 and K4b[0]>K4b[1]) THEN
X4B=1
Else
X4B=0
endif
IF (D4b[0]>55 and K4b[0]>D4b[0] and D4b[0]>D4b[1]) THEN
X5B=1
Else
X5B=0
endif
IF (D4b[0]>80) THEN
X6B=1
Else
X6B=0
endif
////////////////////////Si Baisse
IF (X1B+X2B+X3B)<0 Then
BB=-1
Else
BB=0
Endif
////////////////////////Si Hausse
IF (X4B+X5B+X6B)>0 Then
BH=1
Else
BH=0
Endif
///////////////////////////////////////////////////////////////////////////////////////////////////////
///Baisse
IF ( D4b1[0]<65 AND D4b1[0]<D4b1[1] and K4b1[0]<D4b1[0] and K4b1[0]<30 and K4b1[0]<K4b1[1]) THEN
X11B=-1
Else
X11B=0
endif
IF (D4b1[0]<55 and K4b1[0]<D4b1[0] and D4b1[0]<D4b1[1]) THEN
X21B=-1
Else
X21B=0
endif
IF (D4b1[0]<20) THEN
X31B=-1
Else
X31B=0
endif
////Hausse
IF (D4b1[0]>35 AND D4b1[0]>D4b1[1] and K4b1[0]>D4b1[0] and K4b1[0]>70 and K4b1[0]>K4b1[1]) THEN
X41B=1
Else
X41B=0
endif
IF (D4b1[0]>55 and K4b1[0]>D4b1[0] and D4b1[0]>D4b1[1]) THEN
X51B=1
Else
X51B=0
endif
IF (D4b1[0]>80) THEN
X61B=1
Else
X61B=0
endif
////////////////////////Si Baisse
IF (X11B+X21B+X31B)<0 Then
B1B=-1
Else
B1B=0
Endif
////////////////////////Si Hausse
IF (X41B+X51B+X61B)>0 Then
B1H=1
Else
B1H=0
Endif
////////////////////////////////////////////////////////////////////////////////////
///Baisse
IF ( D4b2[0]<65 AND D4b2[0]<D4b2[1] and K4b2[0]<D4b2[0] and K4b2[0]<30 and K4b2[0]<K4b2[1]) THEN
X12B=-1
Else
X12B=0
endif
IF (D4b2[0]<55 and K4b2[0]<D4b2[0] and D4b2[0]<D4b2[1]) THEN
X22B=-1
Else
X22B=0
endif
IF (D4b2[0]<20) THEN
X32B=-1
Else
X32B=0
endif
////Hausse
IF (D4b2[0]>35 AND D4b2[0]>D4b2[1] and K4b2[0]>D4b2[0] and K4b2[0]>70 and K4b2[0]>K4b2[1]) THEN
X42B=1
Else
X42B=0
endif
IF (D4b2[0]>55 and K4b2[0]>D4b2[0] and D4b2[0]>D4b2[1]) THEN
X52B=1
Else
X52B=0
endif
IF (D4b2[0]>80) THEN
X62B=1
Else
X62B=0
endif
////////////////////////Si Baisse
IF (X12B+X22B+X32B)<0 Then
B2B=-1
Else
B2B=0
Endif
////////////////////////Si Hausse
IF (X42B+X52B+X62B)>0 Then
B2H=1
Else
B2H=0
Endif
TIMEFRAME(4 HOUR)
K4Q=Stochastic[PERIODEK,VITESSEK](close)
D4Q=average[PERIODED](K4Q)
K4Q1=Stochastic[PERIODEK1,VITESSEK1](close)
D4Q1=average[PERIODED1](K4Q1)
K4Q2=Stochastic[PERIODEK2,VITESSEK2](close)
D4Q2=average[PERIODED2](K4Q2)
/////////////////////////////////////////////////////
///Baisse
IF ( D4Q[0]<65 AND D4Q[0]<D4Q[1] and K4Q[0]<D4Q[0] and K4Q[0]<30 and K4Q[0]<K4Q[1]) THEN
X1Q=-1
Else
X1Q=0
endif
IF (D4Q[0]<55 and K4Q[0]<D4Q[0] and D4Q[0]<D4Q[1]) THEN
X2Q=-1
Else
X2Q=0
endif
IF (D4Q[0]<20) THEN
X3Q=-1
Else
X3Q=0
endif
////Hausse
IF (D4Q[0]>35 AND D4Q[0]>D4Q[1] and K4Q[0]>D4Q[0] and K4Q[0]>70 and K4Q[0]>K4Q[1]) THEN
X4Q=1
Else
X4Q=0
endif
IF (D4Q[0]>55 and K4Q[0]>D4Q[0] and D4Q[0]>D4Q[1]) THEN
X5Q=1
Else
X5Q=0
endif
IF (D4Q[0]>80) THEN
X6Q=1
Else
X6Q=0
endif
////////////////////////Si Baisse
IF (X1Q+X2Q+X3Q)<0 Then
QB=-1
Else
QB=0
Endif
////////////////////////Si Hausse
IF (X4Q+X5Q+X6Q)>0 Then
QH=1
Else
QH=0
Endif
///////////////////////////////////////////////////////////////////////////////////////////////////////
///Baisse
IF ( D4Q1[0]<65 AND D4Q1[0]<D4Q1[1] and K4Q1[0]<D4Q1[0] and K4Q1[0]<30 and K4Q1[0]<K4Q1[1]) THEN
X11Q=-1
Else
X11Q=0
endif
IF (D4Q1[0]<55 and K4Q1[0]<D4Q1[0] and D4Q1[0]<D4Q1[1]) THEN
X21Q=-1
Else
X21Q=0
endif
IF (D4Q1[0]<20) THEN
X31Q=-1
Else
X31Q=0
endif
////Hausse
IF (D4Q1[0]>35 AND D4Q1[0]>D4Q1[1] and K4Q1[0]>D4Q1[0] and K4Q1[0]>70 and K4Q1[0]>K4Q1[1]) THEN
X41Q=1
Else
X41Q=0
endif
IF (D4Q1[0]>55 and K4Q1[0]>D4Q1[0] and D4Q1[0]>D4Q1[1]) THEN
X51Q=1
Else
X51Q=0
endif
IF (D4Q1[0]>80) THEN
X61Q=1
Else
X61Q=0
endif
////////////////////////Si Baisse
IF (X11Q+X21Q+X31Q)<0 Then
Q1B=-1
Else
Q1B=0
Endif
////////////////////////Si Hausse
IF (X41Q+X51Q+X61Q)>0 Then
Q1H=1
Else
Q1H=0
Endif
////////////////////////////////////////////////////////////////////////////////////
///Baisse
IF ( D4Q2[0]<65 AND D4Q2[0]<D4Q2[1] and K4Q2[0]<D4Q2[0] and K4Q2[0]<30 and K4Q2[0]<K4Q2[1]) THEN
X12Q=-1
Else
X12Q=0
endif
IF (D4Q2[0]<55 and K4Q2[0]<D4Q2[0] and D4Q2[0]<D4Q2[1]) THEN
X22Q=-1
Else
X22Q=0
endif
IF (D4Q2[0]<20) THEN
X32Q=-1
Else
X32Q=0
endif
////Hausse
IF (D4Q2[0]>35 AND D4Q2[0]>D4Q2[1] and K4Q2[0]>D4Q2[0] and K4Q2[0]>70 and K4Q2[0]>K4Q2[1]) THEN
X42Q=1
Else
X42Q=0
endif
IF (D4Q2[0]>55 and K4Q2[0]>D4Q2[0] and D4Q2[0]>D4Q2[1]) THEN
X52Q=1
Else
X52Q=0
endif
IF (D4Q2[0]>80) THEN
X62Q=1
Else
X62Q=0
endif
////////////////////////Si Baisse
IF (X12Q+X22Q+X32Q)<0 Then
Q2B=-1
Else
Q2B=0
Endif
////////////////////////Si Hausse
IF (X42Q+X52Q+X62Q)>0 Then
Q2H=1
Else
Q2H=0
Endif
timeFrame(default,UPDATEONCLOSE)
////////////////////////////////////////////////////////////////////////
COMPTAGE=WB+WH+W1B+W1H+W2B+W2H+AB+AH+A1B+A1H+A2B+A2H+BB+BH+B1B+B1H+B2B+B2H+QB+QH+Q1B+Q1H+Q2B+Q2H
MAGICSTO=COMPTAGE
///////////////////////////////////////////////////////////////// SNIFFER
If Islastbarupdate Then
P2=MAGICSTO[2]
P1=MAGICSTO[1]
countA=0
countB=0
countC=0
For j=1 to DONNEES
If MAGICSTO[j+1]=P1 and MAGICSTO[j+2]=P2 Then
If MAGICSTO[j]>MAGICSTO[j+1] Then
DeltaA=1
Else
DeltaA=0
Endif
If MAGICSTO[j]<MAGICSTO[j+1] Then
DeltaB=1
Else
DeltaB=0
Endif
If MAGICSTO[j]=MAGICSTO[j+1] Then
DeltaC=1
Else
DeltaC=0
Endif
countA=countA+DELTAA
countB=countB+DELTAB
countC=countC+DELTAC
Endif
Next
//NOMBRE DE FOIS
NBFOISNV=(countA+countB+countC)
//RATIO NV
RATIOH=round((countA*100)/NBFOISNV)
RATIOB=round((countB*100)/NBFOISNV)
RATIOHN=round(((countA+countC)*100)/NBFOISNV)
RATIOBN=round(((countB+countC)*100)/NBFOISNV)
SEGMENTH=RATIOH/20
SEGMENTB=RATIOB/20
SEGMENTHN=RATIOHN/20
SEGMENTBN=RATIOBN/20
RRH = max(0,50+(200-((RATIOH-10)-50)*12))
GGH = max(0,50+(200+((RATIOH-10)-50)*12))
RRB = max(0,50+(200-((RATIOB-10)-50)*12))
GGB = max(0,50+(200+((RATIOB-10)-50)*12))
RRHN = max(0,50+(200-((RATIOHN-10)-50)*12))
GGHN = max(0,50+(200+((RATIOHN-10)-50)*12))
RRBN = max(0,50+(200-((RATIOBN-10)-50)*12))
GGBN = max(0,50+(200+((RATIOBN-10)-50)*12))
If P1>0 Then
DRAWTRIANGLE(barindex-1, P1, barindex, P1+SEGMENTHN, barindex+1, P1)coloured((min(RRHN,255)),(min(GGHN,255)),0,70)bordercolor((min(RRHN,255)),(min(GGHN,255)),0,0)
DRAWTRIANGLE(barindex-1, P1, barindex, P1-SEGMENTB, barindex+1, P1)coloured((min(RRB,255)),(min(GGB,255)),0,70)bordercolor((min(RRB,255)),(min(GGB,255)),0,0)
DRAWTEXT("#countA#/#countC#",Barindex+5,P1+SEGMENTHN,sansserif,bold,10)coloured(min(RRHN,255),min(GGHN,255),0)
DRAWTEXT("#countB#",Barindex+5,P1-SEGMENTB,sansserif,bold,10)coloured(min(RRB,255),min(GGB,255),0)
DRAWTEXT("#RATIOHN#%",Barindex+2,P1+SEGMENTHN,sansserif,bold,10)coloured(min(RRHN,255),min(GGHN,255),0)
DRAWTEXT("#RATIOB#%",Barindex+2,P1-SEGMENTB,sansserif,bold,10)coloured(min(RRB,255),min(GGB,255),0)
Endif
If P1<0 Then
DRAWTRIANGLE(barindex-1, P1, barindex, P1+SEGMENTH, barindex+1, P1)coloured((min(RRH,255)),(min(GGH,255)),0,70)bordercolor((min(RRH,255)),(min(GGH,255)),0,0)
DRAWTRIANGLE(barindex-1, P1, barindex, P1-SEGMENTBN, barindex+1, P1)coloured((min(RRBN,255)),(min(GGBN,255)),0,70)bordercolor((min(RRBN,255)),(min(GGBN,255)),0,0)
DRAWTEXT("#countB#/#countC#",Barindex+5,P1-SEGMENTBN,sansserif,bold,10)coloured(min(RRBN,255),min(GGBN,255),0)
DRAWTEXT("#countA#",Barindex+5,P1+SEGMENTH,sansserif,bold,10)coloured(min(RRH,255),min(GGH,255),0)
DRAWTEXT("#RATIOBN#%",Barindex+2,P1-SEGMENTBN,sansserif,bold,10)coloured(min(RRBN,255),min(GGBN,255),0)
DRAWTEXT("#RATIOH#%",Barindex+2,P1+SEGMENTH,sansserif,bold,10)coloured(min(RRH,255),min(GGH,255),0)
Endif
If DataLigne Then
DRAWSEGMENT(barindex, 0, barindex-DONNEES, 0)coloured(0,255,255)
DRAWSEGMENT(barindex-DONNEES,-12, barindex-DONNEES, 12)coloured(0,255,255)
Endif
Endif
Return
PAST FINDER ERREUR
This topic contains 6 replies,
has 2 voices, and was last updated by Antoine
3 years, 11 months ago.
| Forum: | ProBuilder : Indicateurs & Outils Personnalisés |
| Language: | French |
| Started: | 03/30/2022 |
| Status: | Active |
| Attachments: | 6 files |
The information collected on this form is stored in a computer file by ProRealCode to create and access your ProRealCode profile. This data is kept in a secure database for the duration of the member's membership. They will be kept as long as you use our services and will be automatically deleted after 3 years of inactivity. Your personal data is used to create your private profile on ProRealCode. This data is maintained by SAS ProRealCode, 407 rue Freycinet, 59151 Arleux, France. If you subscribe to our newsletters, your email address is provided to our service provider "MailChimp" located in the United States, with whom we have signed a confidentiality agreement. This company is also compliant with the EU/Swiss Privacy Shield, and the GDPR. For any request for correction or deletion concerning your data, you can directly contact the ProRealCode team by email at privacy@prorealcode.com If you would like to lodge a complaint regarding the use of your personal data, you can contact your data protection supervisory authority.