Day High Low Open for Amibroker (AFL)
nowrajhere over 13 years ago Amibroker (AFL)
Day Hi Low and Previous Day High Low Open
This code only supports for existing .afl files
Indicator / Formula
Copy & Paste Friendly
_SECTION_BEGIN( "RAJA" );
/*RAJA*/
"========";
H1 = SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 ) );
L1 = SelectedValue( TimeFrameGetPrice( "L", inDaily, -1 ) );
C1 = SelectedValue( TimeFrameGetPrice( "C", inDaily, -1 ) );
H2 = SelectedValue( TimeFrameGetPrice( "H", inDaily, 0 ) );
L2 = SelectedValue( TimeFrameGetPrice( "L", inDaily, 0 ) );
O1 = SelectedValue( TimeFrameGetPrice( "open", inDaily, 0 ) );
/*PIVOT Calculation*/
D1 = ( H1 - L1 );
D2 = ( H2 - L2 );
F1 = D1 * 0.433;
F2 = D1 * 0.766;
F3 = D1 * 1.35;
F4 = 0;
if ( D2 <= F1 )
F4 = F1;
else
if ( D2 <= F2 )
F4 = F2;
else
F4 = F3;
p = ( H1 + L1 + C1 ) / 3;
s1 = ( H1 );
r1 = ( L1 );
r2 = SelectedValue( L2 );
s2 = SelectedValue( H2 );
//CONDITION
S = ( C > p );
SS = ( C < P );
//Plot
Plot ( p , "PIVOT", 25, 1 );PlotText( "PIVOT" , BarCount-25, p+0, 25 );
Plot ( r1, "PRE_LOW", 28, 1 );PlotText( "PreDay LOW" , BarCount-25, r1+0, 28 );
Plot ( s1, "PRE_HIGH", 28, 1 );PlotText( "PreDay HIGH" , BarCount-25, s1+0, 28 );
Plot ( s2, "DAY_HIGH", 42, 1 );PlotText( "Day HIGH" , BarCount-25, s2+0, 42 );
Plot ( r2, "DAY_LOW", 42, 1 );PlotText( "Day LOW" , BarCount-25, r2+0, 42 );
Plot ( O1, "DAY_Open", 15, 1 );PlotText( "Day Open" , BarCount-25, O1+0, 15 );
_SECTION_END();2 comments
Leave Comment
Please login here to leave a comment.
I’m sorry. What’s the purpose of this formula?
Thanks in advance.
To know the day high low and pivot points