Hi DM,
I have been trying to get the distance between two pivots and have looked all over the net but have not found anything yet,what i am looking for is an AFL which will show me the distance between two pivots ie pivot and a mid point on the chart,or at least the distance from the pivot point to the mid point between R1 and the pivot point and the distance between pivot point to the mid point below ie the mid point from from the pivot and the S1 ,my AFL for Pivot+mid point is as follows;
_SECTION_BEGIN("ppint");
H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 ));
L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 ));
C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 ));
//O1=SelectedValue(TimeFrameGetPrice( "O", inDaily));
/*PIVOT Calculation*/
//p = ( H1+ L1 + O1 )/3;
p = ( H1+ L1 + C1 )/3;
s1 = (2*p)-H1;
r1 = (2*p)-L1;
s2 = p -(H1 - L1);
s3 = S1 - (H1-L1);
r2 = p +(H1 - L1);
r3 = R1 +(H1-L1);
R4 = R2 +(H1-L1);
S4 = S2 -(H1-L1);
//Plot(R4,"R4",colorRed);
//Plot((r4+r3)/2, "Mid Value of R4 & R3 - ",colorWhite,styleDashed,1,styleNoTitle);
//Plot (r3,"R3",colorRed,styleNoTitle);
//Plot((r3+r2)/2, "Mid Value of R2 & R3 - ",colorWhite,styleDashed,1,styleNoTitle);
//Plot (r2,"R2",colorWhite,styleDashed,styleNoTitle);
//Plot((r1+r2)/2, "Mid Value of R1 & R2 - ",colorWhite,styleDashed,1,styleNoTitle);
Plot (r1,"R1",colorWhite,styleDashed,styleNoTitle);
Plot((p+r1)/2, "Mid Value of R1 & Pivot ",colorWhite,styleDashed,1,styleNoTitle);
Plot (p,"Pivot",colorOrange,styleDashed,styleNoTitle);
Plot((p+s1)/2, "Mid Value of S1 & Pivot ",colorWhite,styleDashed,1,styleNoTitle);
Plot (s1,"S1",colorWhite,styleDashed,styleNoTitle);
Plot((s1+s2)/2, "Mid Value of S1 & S2 - ",colorWhite,styleDashed,1,styleNoTitle);
Plot (s2,"S2",colorWhite,styleDashed,styleNoTitle);
//Plot((s3+s2)/2, "Mid Value of S2 & S3 ",colorWhite,styleDashed,1,styleNoTitle);
//Plot (s3,"S3",colorGreen,styleNoTitle);
//Plot((s3+s4)/2, "Mid Value of S4 & S3 ",colorWhite,styleDashed,1,styleNoTitle);
//Plot(S4,"S4",colorGreen);
Would request you to kindly help me with the same.
I have been trying to get the distance between two pivots and have looked all over the net but have not found anything yet,what i am looking for is an AFL which will show me the distance between two pivots ie pivot and a mid point on the chart,or at least the distance from the pivot point to the mid point between R1 and the pivot point and the distance between pivot point to the mid point below ie the mid point from from the pivot and the S1 ,my AFL for Pivot+mid point is as follows;
_SECTION_BEGIN("ppint");
H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 ));
L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 ));
C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 ));
//O1=SelectedValue(TimeFrameGetPrice( "O", inDaily));
/*PIVOT Calculation*/
//p = ( H1+ L1 + O1 )/3;
p = ( H1+ L1 + C1 )/3;
s1 = (2*p)-H1;
r1 = (2*p)-L1;
s2 = p -(H1 - L1);
s3 = S1 - (H1-L1);
r2 = p +(H1 - L1);
r3 = R1 +(H1-L1);
R4 = R2 +(H1-L1);
S4 = S2 -(H1-L1);
//Plot(R4,"R4",colorRed);
//Plot((r4+r3)/2, "Mid Value of R4 & R3 - ",colorWhite,styleDashed,1,styleNoTitle);
//Plot (r3,"R3",colorRed,styleNoTitle);
//Plot((r3+r2)/2, "Mid Value of R2 & R3 - ",colorWhite,styleDashed,1,styleNoTitle);
//Plot (r2,"R2",colorWhite,styleDashed,styleNoTitle);
//Plot((r1+r2)/2, "Mid Value of R1 & R2 - ",colorWhite,styleDashed,1,styleNoTitle);
Plot (r1,"R1",colorWhite,styleDashed,styleNoTitle);
Plot((p+r1)/2, "Mid Value of R1 & Pivot ",colorWhite,styleDashed,1,styleNoTitle);
Plot (p,"Pivot",colorOrange,styleDashed,styleNoTitle);
Plot((p+s1)/2, "Mid Value of S1 & Pivot ",colorWhite,styleDashed,1,styleNoTitle);
Plot (s1,"S1",colorWhite,styleDashed,styleNoTitle);
Plot((s1+s2)/2, "Mid Value of S1 & S2 - ",colorWhite,styleDashed,1,styleNoTitle);
Plot (s2,"S2",colorWhite,styleDashed,styleNoTitle);
//Plot((s3+s2)/2, "Mid Value of S2 & S3 ",colorWhite,styleDashed,1,styleNoTitle);
//Plot (s3,"S3",colorGreen,styleNoTitle);
//Plot((s3+s4)/2, "Mid Value of S4 & S3 ",colorWhite,styleDashed,1,styleNoTitle);
//Plot(S4,"S4",colorGreen);
Would request you to kindly help me with the same.