Display Line Name of Fibonacci Lines
Forums › ProRealTime English forum › ProBuilder support › Display Line Name of Fibonacci Lines
- This topic has 23 replies, 4 voices, and was last updated 4 years ago by Vonasi.
-
-
06/02/2020 at 8:56 AM #13414906/08/2020 at 7:37 AM #13510506/08/2020 at 8:20 AM #135114
Sorry – not sure how that happened must have had some brain fade!
Try this code. It should use the previous days high and low on Wednesday, Thursday and Friday. On Sunday and Monday it uses the high and low from Friday. On Tuesday it uses the highest high and lowest low from Sunday and Monday combined.
Not tested!
123456789101112131415161718192021if d <> d[1] thenif (D=0 or D=3 or D=4 or D=5) thenH1=DHigh(1)L1=DLow(1)C1=DClose(1)O=DOpen(1)endifif D=2 thenH1=max(DHigh(1),dHigh(2))L1=min(DLow(1),dLow(2))C1=DClose(1)O=DOpen(2)endifif d=1 thenH1=DHigh(2)L1=DLow(2)C1=DClose(2)O=DOpen(2)endif1 user thanked author for this post.
06/08/2020 at 8:43 AM #13512306/12/2020 at 2:16 PM #135745Many thanks Vonasi. It worked. One last requirement is if I want to have discrete lines for each day, instead of continuous lines with no break between days as it is appearing now, what should be done? For example, as it appears for standard Pivot Points discrete for each day and not joined from previous day.
Regards,
06/14/2020 at 4:22 PM #135911You would need to use DRAWSEGMENT.
I’ve also added a small fix to stop it drawing text on Mondays as it clashes with the same text drawn on Sundays.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105D=openDayOfWeekif d <> d[1] thenif (D=0 or D=3 or D=4 or D=5) thenH1=DHigh(1)L1=DLow(1)C1=DClose(1)O=DOpen(1)endifif D=2 thenH1=max(DHigh(1),dHigh(2))L1=min(DLow(1),dLow(2))C1=DClose(1)O=DOpen(2)endifif d=1 thenH1=DHigh(2)L1=DLow(2)C1=DClose(2)O=DOpen(2)endifr=h1-l1R236=L1+R*0.236R382=L1+R*0.382R50=L1+R*0.5r6=l1+r*0.618r7=l1+r*.786r1=l1+r*1.272r11=l1+r*1.618R22=L1+R*2R2618=L1+R*2.618R33=L1+R*3.33DH=H1-r*1DL=H1-r*0Lr1=H1-r*1.272L11=H1-r*1.618L22=H1-R*2L2618=H1-R*2.618L33=H1-R*3.33WPH=(H1+L1+C1)*2/3-H1WPL=(H1+L1+C1)*2/3-L1P=H1+L1+C1if O>C1 thenX=(P+H1)/2elsif O<C1 thenX=(P+L1)/2elsif O=C1 thenX=(P+C1)/2endifDPH=X-L1DPL=X-H1if d<>1 thenvoff=5*pipsizeDRAWTEXT("1.618", barindex,r11+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT("0.236", barindex,r236+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT("0.382", barindex,r382+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT("0.5", barindex,r50+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT("0.618", barindex,r6+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT("0.786", barindex,r7+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT("1.272", barindex,r1+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT("2.0", barindex,r22+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT("2.618", barindex,r2618+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT("3.33", barindex,r33+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT("DH", barindex,DH+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT("DL", barindex,DL+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT(" - 1.272", barindex,LR1+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT(" - 1.618", barindex,L11+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT(" - 2.0", barindex,L22+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT(" - 2.618", barindex,L2618+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT(" - 3.33", barindex,L33+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT("DPRH", barindex,DPH+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT("DPRL", barindex,DPL+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT("WPRH", barindex,WPH+voff, Dialog , Bold, 18) COLOURED(255,255,0)DRAWTEXT("WPRL", barindex,WPL+voff, Dialog , Bold, 18) COLOURED(255,255,0)endifendifdrawsegment (barindex, wph, barindex-1,wph)drawsegment (barindex, dph, barindex-1,dph)drawsegment (barindex, wpl, barindex-1,wpl)drawsegment (barindex, dpl, barindex-1,dpl)drawsegment (barindex, r236, barindex-1,r236)drawsegment (barindex, r382, barindex-1,r382)drawsegment (barindex, r50, barindex-1,r50)drawsegment (barindex, r6, barindex-1,r6)drawsegment (barindex, r7, barindex-1,r7)drawsegment (barindex, r1, barindex-1,r1)drawsegment (barindex, r11, barindex-1,r11)drawsegment (barindex, r22, barindex-1,r22)drawsegment (barindex, r2618, barindex-1,r2618)drawsegment (barindex, r33, barindex-1,r33)drawsegment (barindex, dh, barindex-1,dh)drawsegment (barindex, dl, barindex-1,dl)drawsegment (barindex, lr1, barindex-1,lr1)drawsegment (barindex, l11, barindex-1,l11)drawsegment (barindex, l22, barindex-1,l22)drawsegment (barindex, l2618, barindex-1,l2618)drawsegment (barindex, l33, barindex-1,l33)RETURN06/15/2020 at 8:32 AM #135960Brilliant Vonasi. Much appreciated.
06/15/2020 at 12:49 PM #135997Hello Vonasi, it is now looking neat as enclosed, however the corresponding price levels for the Fibonacci ratios are not appearing in the Y axis. e.g. 0.786 price level as 5,860. What should we do now, please?
06/15/2020 at 3:48 PM #136008The values on the Y axis can only be shown of RETURN’ed values. A segment is just a graphical instruction to draw a line between two points and so no value is shown on the Y axis.
The only fix that I can think of is to create a separate indicator that draws on the last bar only and draws text on the last bar of the chart showing the values.
-
AuthorPosts
Find exclusive trading pro-tools on