Etendre DRAWRAY sur X barres
Forums › ProRealTime forum Français › Support ProBuilder › Etendre DRAWRAY sur X barres
- This topic has 21 replies, 6 voices, and was last updated 3 weeks ago by  Robb. Robb.
- 
	
		
- 
		
			
				
09/24/2021 at 12:55 PM #178298On peut essayer avec le code ci-dessous pour détecter les cassures de triangles: 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576//PRC_triangle Wedge pattern | screener//12.09.2016//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge// modified by Yannick v4 31.10.2017 avec affichage des buystop et sellstop level//fractalscp = 1//4 //lookback//Detection Highif high[cp] >= highest[(cp)*2+1](high) thenLLH = 1elseLLH = 0endif//Value of last Highif LLH = 1 thenHigh1 = High2[1]High1bar = High2bar[1]High2 = high[cp]High2bar = barindex[cp]endif//Detection Lowif low[cp] <= lowest[(cp)*2+1](low) thenLLL = -1elseLLL = 0endif//Value of last Lowif LLL = -1 thenLow1 = Low2[1]Low1bar = Low2bar[1]Low2 = low[cp]Low2bar = barindex[cp]endiftriangle = High1>High2 and Low1<Low2 and abs(High1-Low1)> abs(High2-Low2) //triangle conditions 1+2 contraction Low increasing and High decreasingoscillationH1L1H2L2= High1bar< Low1bar and Low1bar< High2bar and High2bar<Low2bar //triangle condition 3 oscillationoscillationL1H1L2H2= Low1bar<High1bar and High1bar<Low2bar and Low2bar< High2bar //triangle condition 3 oscillationtriangleamplitude=abs(High1-Low1)< 2* abs(High2-Low2)//triangleamplitude =1//Triangle display and H1L1H2L2if triangle and triangleamplitude and oscillationH1L1H2L2 or triangle and triangleamplitude and oscillationL1H1L2H2 then//DRAWSEGMENT(Low1bar,Low1,Low2bar,Low2,barindex+5)//DRAWSEGMENT(High1bar,High1,High2bar,High2,barindex+5)startbar=barindexendif//calculation of upperline equationaH=(High2-High1)/(High2bar-High1bar)//calculation of lowerline equationaL=(Low2-Low1)/(Low2bar-Low1bar)signal=0//interceptupperline = high2+ah*(barindex-high2bar)if close crosses over upperline and upperline>0 and barindex-startbar<=5 thensignal=1//drawarrowup(barindex,low-averagetruerange[14]/2) coloured(0,255,0)endif//drawpoint(barindex,high2+ah*(barindex-high2bar))lowerline = low2-al*(barindex-low2bar)if close crosses under lowerline and lowerline>0 and barindex-startbar<=5 thensignal=-1//drawarrowdown(barindex,high+averagetruerange[14]/2) coloured(255,0,0)endifscreener[signal<>0]09/26/2021 at 2:46 PM #17844711/08/2021 at 10:27 PM #18127310/04/2025 at 2:12 PM #252161HelloI wanted to draw triangles with different lookbacks, like 3 and 5, in the same chart with one indicator only.I thought that this could be sufficient:Bonjour Je souhaitais dessiner des triangles avec des rétrospections différentes, comme 3 et 5, dans le même graphique avec un seul indicateur. J’ai pensé que cela pourrait suffire : $cpArray[0] = 3 
 $cpArray[1] = 5for i = 0 to 1 do 
 cp = $cpArray[i]…same code as describe in this topic….…même code que décrit dans ce sujet… next return But surprisingly it does not work, I got only triangle acc. to cp=3.Any advice?
 ùthanks a lotMais étonnamment, ça ne fonctionne pas ; je n’ai obtenu qu’un triangle selon cp=3. Un conseil ? 
 Merci beaucoupRoberto 10/05/2025 at 6:42 PM #252176@Robb Publiez uniquement dans la langue du forum dans laquelle vous publiez. Par exemple, l’anglais uniquement dans les forums anglophones et le français uniquement dans les forums francophones. Merci 🙂 10/07/2025 at 5:22 PM #252270Cette instruction imprime un triangle, mais nécessite six données : trois pour les coordonnées X (les barres où sont imprimés les trois côtés) et trois pour les coordonnées Y (c’est-à-dire les niveaux de prix où sont imprimés les côtés). 
 Dans votre cas, quelles sont ces six données ?1DRAWTRIANGLE(BarIndex[10],low[10],BarIndex[5],high[5],barindex,low) style(line,4) coloured("Cyan")10/07/2025 at 8:12 PM #252308J’ai résolu le problème en écrivant le code deux fois dans le même indicateur, une fois avec cp=3 et une fois avec cp=5. Dans la deuxième partie avec cp=5, j’ai modifié les noms des variables pour éviter toute confusion. Ainsi, l’indicateur dessine des triangles pour cp=3 et cp=5. J’aurais aimé trouver un système plus élégant, comme avec des arrays, mais je crains que le programme ne permette pas de les utiliser de cette façon. 1 user thanked author for this post.
- 
		AuthorPosts
			Find exclusive trading pro-tools on 


 
		 
		 
		