N days historical Pivot points – Help needed.
Forums › ProRealTime English forum › ProBuilder support › N days historical Pivot points – Help needed.
- This topic has 9 replies, 2 voices, and was last updated 4 years ago by boonet.
-
-
08/13/2020 at 10:30 AM #141500
I found that the price usually fluctuates between pivot points from last three days.
Please see attached example screenshot.
In the attached example –
- All the blue lines are the pivot points of last 3 days which I drew manually
- Highlighted in purple are the points where price bounced off.
It would be very handy to have an indicator which shows pivot points from last 3 days.(or n days)
Can someone please help coding it?
Thanks in advance.
08/13/2020 at 10:42 AM #14150308/13/2020 at 11:30 AM #14150508/13/2020 at 1:02 PM #14150808/13/2020 at 2:20 PM #141520Thanks a lot @Nicolas.
Tried this code.
123456789p1 = (dhigh(1)+dlow(1)+dclose(1))/3p2 = (dhigh(2)+dlow(2)+dclose(2))/3p3 = (dhigh(3)+dlow(3)+dclose(3))/3DRAWLINE(barindex-1,p1,barindex,p1) coloured(153,153,0)DRAWLINE(barindex-1,p2,barindex,p2) coloured(153,153,0)DRAWLINE(barindex-1,p3,barindex,p3) coloured(153,153,0)returnThis generates several lines on the chart may be because there is no conditional statement to restrict it to 3 days.
See attached screenshot.
Sorry may be my newbie knowledge.08/13/2020 at 3:37 PM #14152508/13/2020 at 5:09 PM #141532Thanks a lot @Nicolas.
It worked. Here is the full code
Last three days pivot points12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061defparam drawonlastbaronly=truep1 = (dhigh(1)+dlow(1)+dclose(1))/3p2 = (dhigh(2)+dlow(2)+dclose(2))/3p3 = (dhigh(3)+dlow(3)+dclose(3))/3r11 = 2*p1 - dlow(1)r12 = 2*p2 - dlow(2)r13 = 2*p3 - dlow(3)s11 = 2*p1 - dhigh(1)s12 = 2*p2 - dhigh(2)s13 = 2*p3 - dhigh(3)r21 = p1 + (dhigh(1)-dlow(1))r22 = p2 + (dhigh(2)-dlow(2))r23 = p3 + (dhigh(3)-dlow(3))s21 = p1 - (dhigh(1)-dlow(1))s22 = p2 - (dhigh(2)-dlow(2))s23 = p3 - (dhigh(3)-dlow(3))r31 = r11+(dhigh(1)-dlow(1))r32 = r12+(dhigh(2)-dlow(2))r33 = r13+(dhigh(3)-dlow(3))s31 = s11-(dhigh(1)-dlow(1))s32 = s12-(dhigh(2)-dlow(2))s33 = s13-(dhigh(3)-dlow(3))DRAWLINE(barindex-1,p1,barindex,p1) coloured(153,153,0)DRAWLINE(barindex-1,p2,barindex,p2) coloured(153,153,0)DRAWLINE(barindex-1,p3,barindex,p3) coloured(153,153,0)DRAWLINE(barindex-1,r11,barindex,r11) coloured(170,153,0)DRAWLINE(barindex-1,r12,barindex,r12) coloured(170,153,0)DRAWLINE(barindex-1,r13,barindex,r13) coloured(170,153,0)DRAWLINE(barindex-1,s11,barindex,s11) coloured(170,153,0)DRAWLINE(barindex-1,s12,barindex,s12) coloured(170,153,0)DRAWLINE(barindex-1,s13,barindex,s13) coloured(170,153,0)DRAWLINE(barindex-1,r21,barindex,r21) coloured(170,153,0)DRAWLINE(barindex-1,r22,barindex,r22) coloured(170,153,0)DRAWLINE(barindex-1,r23,barindex,r23) coloured(170,153,0)DRAWLINE(barindex-1,s21,barindex,s21) coloured(170,153,0)DRAWLINE(barindex-1,s22,barindex,s22) coloured(170,153,0)DRAWLINE(barindex-1,s23,barindex,s23) coloured(170,153,0)DRAWLINE(barindex-1,r31,barindex,r31) coloured(170,153,0)DRAWLINE(barindex-1,r32,barindex,r32) coloured(170,153,0)DRAWLINE(barindex-1,r33,barindex,r33) coloured(170,153,0)DRAWLINE(barindex-1,s31,barindex,s31) coloured(170,153,0)DRAWLINE(barindex-1,s32,barindex,s32) coloured(170,153,0)DRAWLINE(barindex-1,s33,barindex,s33) coloured(170,153,0)return08/13/2020 at 5:47 PM #141534Hi @Nicolas,
From the above code I want to frame something like –
1234567data = min(abs(close-r11),min(abs(close-r12),min(abs(close-r13),min(abs(close-s11),min(abs(close-s12),abs(close-s13))))))c1 = (data/close*100)<=Percent/100screener [c1](data/close*100)How can I integrate all 21 variables(S11,S12,S13…..P1,P2,P3, …..R31,R32,R33) in above equation data=____ ?
08/14/2020 at 7:50 AM #14157608/14/2020 at 10:01 AM #141610 -
AuthorPosts