Please Help Me To Make This Code

#1
Dear all,

i am new using amibroker..and i need your help.
i find coding to count pivot,Resistant and support like this :

Hi1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 ));
Li1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 ));
Ci1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 ));

/*PIVOT Calculation*/
p = ( Hi1+ Li1 + Ci1 )/3;
s1 = (2*p)-Hi1;
r1 = (2*p)-Li1;
s2 = p -(Hi1 - Li1);
s3 = S1 - (Hi1-Li1);
r2 = p +(Hi1 - Li1);
r3 = R1 +(Hi1-Li1);


i want to add buying condition, where close > previous Resistant,not today resistant, and Close > today support. Please help me.. Thanks
 

casoni

Well-Known Member
#2
Dear all,

i am new using amibroker..and i need your help.
i find coding to count pivot,Resistant and support like this :

Hi1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 ));
Li1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 ));
Ci1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 ));

/*PIVOT Calculation*/
p = ( Hi1+ Li1 + Ci1 )/3;
s1 = (2*p)-Hi1;
r1 = (2*p)-Li1;
s2 = p -(Hi1 - Li1);
s3 = S1 - (Hi1-Li1);
r2 = p +(Hi1 - Li1);
r3 = R1 +(Hi1-Li1);


i want to add buying condition, where close > previous Resistant,not today resistant, and Close > today support. Please help me.. Thanks

Check this

H1 = TimeFrameGetPrice( "H", inDaily, -1 ) ;
L1 = TimeFrameGetPrice( "L", inDaily, -1 ) ;
C1 = TimeFrameGetPrice( "C", inDaily, -1 ) ;

PP = ( L1 + H1 + C1 ) / 3;
S1 = ( 2 * PP ) - H1;
S2 = PP - ( H1 - L1 );
S3 = L1 - 2 * ( H1 - PP );
R1 = ( 2 * PP ) - L1;
R2 = PP + ( H1 - L1 );
R3 = 2 * ( PP - L1 ) + H1;

Plot(C,"",47,128|4);
Plot( S1, "", colorOrange, styleDashed );
Plot( S2, "", colorOrange, styleLine );
Plot( S3, "", colorOrange, 8 );
Plot( PP, "", 7, ParamStyle("pp style",styleLine + styleThick, maskAll) );
Plot( R1, "", colorPaleGreen, styleDashed );
Plot( R2, "", colorPaleGreen, styleLine );
Plot( R3, "", colorPaleGreen, 8 );



Buy =
Cross(C,Ref(R1,-1)) OR Cross(C,Ref(R2,-1)) OR Cross(C,Ref(R3,-1))
OR
Cross(C,S1) OR Cross(C,S2) OR Cross(C,S3) ;

PlotShapes(shapeUpArrow*Buy,colorGreen,0,L,-5);
 

Similar threads