2 DERNIERS SIGNAUX SEULEMENT
Forums › ProRealTime forum Français › Support ProBuilder › 2 DERNIERS SIGNAUX SEULEMENT
- This topic has 4 replies, 2 voices, and was last updated 2 years ago by
Roland57800.
-
-
09/13/2023 at 7:59 AM #220908
Bonjour,
j’ai écris un code pour me donner un signal
Concrètement j’ai un chandelier ROUGE suivi de 2 chandeliers VERT
Je voudrais ne garder que les 2 derniers signaux sur le graphique
le code
ROUGE VERT VERT1234567891011121314151617181920C1 = close[2] < open [2]c2 = close [1] > open [1]c2a = close > open and close > close [1]c3 = close > close [2] and close > close[3]// CALCUL POUR DETERMINER LE STOPif c1 and c2 and c3 and c2a THENdrawtext(" ------ SL ",barindex,LOW [2],Dialog,Bold,14 ) coloured ( 255,0,0 )ENDIFif c1 and c2 and c3 and c2a thenDRAWARROWUP (barindex, LOW - 3.5 ) coloured(0,0,255) //coloured(72,224,208) // MEDIUM TURQUOISEDRAWTEXT ( "◯", barindex, LOW - 3.5 ,dialog, bold,20) coloured(0,0,255)ENDIFRETURNMerci pour votre retour
Cordialement
09/13/2023 at 10:43 AM #220921Pour cela il faut enregistrer les signaux quand ils surviennent, dans un tableau. Puis on trace dans le passé à partir du chandelier courant, les 2 derniers signaux :
123456789101112131415161718192021222324252627defparam drawonlastbaronly=trueC1 = close[2] < open [2]c2 = close [1] > open [1]c2a = close > open and close > close [1]c3 = close > close [2] and close > close[3]// j'enregistre dans un tableau le signalif c1 and c2 and c3 and c2a THEN$signal[count]=low$signalbar[count]=barindexcount=count+1ENDIF// je trace dans le passé les 2 derniers signauxif islastbarupdate and count>=3 thenfor i = count-1 downto count-2drawtext(" ------ SL ",$signalbar[i],low [$signalbar[i]-2],Dialog,Bold,14 ) coloured ( 255,0,0 )DRAWARROWUP ($signalbar[i], $signal[i] - 3.5 ) coloured(0,0,255) //coloured(72,224,208) // MEDIUM TURQUOISEDRAWTEXT ( "◯", $signalbar[i], $signal[i] - 3.5 ,dialog, bold,20) coloured(0,0,255)nextENDIFRETURN09/13/2023 at 1:44 PM #220939Merci Nicolas
pour ton retour. c’est parfait
fonctionne correctement
Cordialement
09/13/2023 at 2:07 PM #220940Nicolas,
désolé je me suis emballé un peu trop vite
en effet la 1ère ligne de DRAWTEXT ne s’affiche (celle ci-dessous)
drawtext(” —— SL “,$signalbar[i],low [$signalbar[i]–2],Dialog,Bold,14 ) coloured ( 255,0,0 )
j’ai essayé de comprendre et j’ai pas trouvé.
merci pour ton retour
Cordialement
09/13/2023 at 2:15 PM #220942Nicolas,
j’ai repris la ligne de code dans le bon format
TEST ROUGE VERT VERT1drawtext(" ------ SL ",$signalbar[i],low [$signalbar[i]-2],Dialog,Bold,14 ) coloured ( 255,0,0 )Merci
-
AuthorPosts
Find exclusive trading pro-tools on