Etendre DRAWRAY sur X barres
Forums › ProRealTime forum Français › Support ProBuilder › Etendre DRAWRAY sur X barres
- This topic has 17 replies, 4 voices, and was last updated 3 years ago by Manu L..
-
-
06/26/2020 at 5:22 PM #13726706/28/2020 at 10:16 AM #13736506/28/2020 at 11:08 AM #13738406/29/2020 at 8:16 AM #137448
Pour faire cela on peut utiliser DRAWSEGMENT, on lui donne une troisième coordonnées en X et il trouvera automatiquement la valeur de Y en calculant sa fonction affine.
Par exemple :
1DRAWsegment(barindex, close, barindex[10],close[5],barindex+10)06/29/2020 at 9:02 PM #13757106/30/2020 at 7:46 AM #13760706/30/2020 at 3:54 PM #137757cela marche nickel pour:
1DRAWsegment(barindex, close, barindex[10],close[5],barindex+10)pour votre derniere reponse
Il suffit de créer une fonctionne affine et de tester le nouveau niveau calculé sur chaque barre. Le coefficient directeur étant celui-ci : (distance du prix parcourus) / (quantité de chandeliers)
dans votre code “PRC_triangle Wedge pattern” je ne vois pas les buystop et sellstop
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135//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 leveldefparam drawonlastbaronly = true//fractalscp = 1//4 //lookback//volatilty//HistVolatily=HistoricVolatility[20](close)//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]endif// condition of screening Triangle//condition 1 triangle compression contraction Lows are increasings and High are decreasing High1>High2 and Low1<Low2//condition 2 compression of volatilty Initial swing High1Low1> Last Swing High2Low2 : abs(High1-Low1)> abs(High2-Low2)//condition 3 triangle oscillation inside the triangle e.g. correct order of bars L/H/L/H or H/L/H/L//condition 4 triangle amplitude ratio control H1L1< 2 H2L2triangle = 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 //and HistVolatily< HistVolatily[20]DRAWSEGMENT(Low1bar,Low1,Low2bar,Low2,barindex+5)DRAWSEGMENT(High1bar,High1,High2bar,High2,barindex+5)DRAWARROWUP(Low1bar,Low1)coloured(10,255,10)DRAWARROWUP(Low2bar,Low2)coloured(10,255,10)DRAWARROWDOWN(High1bar,High1)coloured(255,10,10)DRAWARROWDOWN(High2bar,High2)coloured(255,10,10)//DRAWCANDLE(High1,high2,low2,low1) //when triangle is detectedendif// possible buystop or sellstop orders level///Equation of line y=ax+b// slope a= (yB-yA)/(xB-xA)= deltay/deltax// intercept b= yA-xA(YB-YA)/(xB-xA)//calculation of upperline equation and position yHigh for buystopaH=(High2-High1)/(High2bar-High1bar)bH=High1-High1bar*(High2-High1)/(High2bar-High1bar)//calculation of lowerline equationaL=(Low2-Low1)/(Low2bar-Low1bar)bL=Low1-Low1bar*(Low2-Low1)/(Low2bar-Low1bar)if triangle and triangleamplitude and oscillationH1L1H2L2 or triangle and triangleamplitude and oscillationL1H1L2H2 then //and HistVolatily< HistVolatily[20]//upper line//for i=0 to High1bar doi=1yHigh= aH*(i-High1bar)+bHDRAWARROWUP(i,yHigh)coloured(10,255,10)//next//lowerline//for j=0 to Low1bar doj=1yLow= aL*(j-Low1bar)+bLDRAWARROWDOWN(j,yLow)coloured(255,10,10)//nextEndif//end of triangle// intercept between yH and yL yH=yL= aH(x-H1bar)+bH=aL(x-L1bar)+bL => x= (bL-bH+aH*H1bar-aL*L1bar)/(aH-aL)//conditions of screening wedge//risingwedge = High1<High2 and Low1<Low2 and abs(High1bar-High2bar)>abs(Low1bar-Low2bar) and abs(High1-High2)<abs(Low1-Low2) //Rising wedge?//fallingwedge = High1>High2 and Low1>Low2 and abs(High1bar-High2bar)<abs(Low1bar-Low2bar) and abs(High1-High2)>abs(Low1-Low2) //Falling weg ?//condition 3 wedge oscillation inside the wedge e.g. correct order of bars L/H/L/H or H/L/H/L similar condition than triangle//condition 4 wedge amplitude ratio control H1L1< ??? H2L2 to check?//if risingwedge or fallingwedge and oscillationH1L1H2L2 or oscillationL1H1L2H2 then//DRAWsegment(Low1bar,Low1,Low2bar,Low2)//DRAWsegment(High1bar,High1,High2bar,High2)//DRAWARROWUP(Low1bar,Low1)coloured(10,255,10)//DRAWARROWUP(Low2bar,Low2)coloured(10,255,10)//DRAWARROWDOWN(High1bar,High1)coloured(255,10,10)//DRAWARROWDOWN(High2bar,High2)coloured(255,10,10)//endif//Volatility decrease in triangle lowest 300 period volatily//AverageVolatity//Volatilty//Previous trend detection : triangle should be continuation pattern//Previous trend detection : trend continuation wedge should a short term reversalpattern and long term continuation//close > average[X]Return//Indicator Endest il possible de l’afficher comme dans l’exemple ci dessous
exemple fleche verte quand le triangle est cassé par le haut à la cloture de l’extension du segment
06/30/2020 at 4:59 PM #13777206/30/2020 at 5:08 PM #137773Nicolas,
dans votre version ci dessus(triangle-v4.tif), je souhaiterais avoir une alerte ou une fleche quand la cloture casse par exemple à la hausse l’extension du segment (cf capture chart ci dessus)code ligne 62
1DRAWSEGMENT(High1bar,High1,High2bar,High2,barindex+5)//PRC_triangle Wedge pattern | screener
//12.09.2016
//Nicolas @ http://www.prorealcode.com
//Sharing ProRealTime knowledge
// modified by Yannick v4 31.10.2017 avec affichage des buystop et sellstop level07/01/2020 at 4:22 PM #137968Ce code n’est pas le mien, il a été modifié et pas facile à lire. Je l’ai modifié pour tracer des flèches à la cassures des triangles par le haut ou par le bas sur 5 bougies depuis sa création puisque tu étends de 5 bougies seulement les droites.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374//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 leveldefparam drawonlastbaronly = false//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 thenDRAWSEGMENT(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)//interceptupperline = high2+ah*(barindex-high2bar)if close crosses over upperline and upperline>0 and barindex-startbar<=5 thendrawarrowup(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 thendrawarrowdown(barindex,high+averagetruerange[14]/2) coloured(255,0,0)endifReturn1 user thanked author for this post.
07/01/2020 at 8:45 PM #138017Un grand merci Nicolas pour le code
j’ai bien saisi le calcul
1234567//calculation of upperline equationaH=(High2-High1)/(High2bar-High1bar)//calculation of lowerline equationaL=(Low2-Low1)/(Low2bar-Low1bar)//interceptupperline = high2+ah*(barindex-high2bar)11/06/2020 at 10:38 AM #14963811/06/2020 at 11:13 AM #149644C’est un code v11, et c’est une des améliorations de la v11 sur la v10.3, on peut y mettre dans drawsegment un 5ème paramètre pour préciser l’abscisse “x” d’un 3ème point, et cela prolongera le segment suivant la même pente au point x,y correspondant
1 user thanked author for this post.
11/06/2020 at 11:14 AM #149646En effet, ces deux lignes devraient être comme ci-dessous, cela ne générant pas d’erreurs en v11 à l’époque ..
12DRAWSEGMENT(Low1bar,Low1,Low2bar,Low2)DRAWSEGMENT(High1bar,High1,High2bar,High2)1 user thanked author for this post.
09/23/2021 at 10:41 PM #178262 -
AuthorPosts
Find exclusive trading pro-tools on