Difference between Pivots

amitrandive

Well-Known Member
Dear All

I want an exploration which calculates the difference between the Daily and Weekly and Pivots and the Daily and Monthly Pivots.

This exploration should write the difference between as an example say Daily R1 and Weekly R1 in points or percentages.

Thanks
Amit

casoni

Well-Known Member
Hello ,
check this

diffpoints = r1-w1;

X = round(r1 - w1);
Chg =Prec((X/w1)*100,1);

filter=diffpoints and chg

Hope this helps.
thank you

amitrandive

Well-Known Member
Casoni

Thanks but can you please provide the complete exploration code for this ?

Thanks
Amit

casoni

Well-Known Member
Hello ,
it is complete code..

diffpoints = r1-w1;// this will show you diff in points

X = round(r1 - w1);
Chg =Prec((X/w1)*100,1); // his will show you diff in %

filter=diffpoints and chg ;// explore

thank you

amitrandive

Well-Known Member
Casoni

I have developed the following code, I want the exploration to return only those values which are lesser than 0.5%.

TimeFrameSet(inDaily);

PP = Ref( ((H + L + C)/3),-1) ;

Range = Ref((H-L),-1) ;

R1 = PP + PP-Ref(L,-1) ;

S1 = PP - (Ref(H,-1)-PP);
DC= Ref(C,-1);

TimeFrameRestore();
TimeFrameSet(inWeekly);

PW = Ref( ((H + L + C)/3),-1) ;

Range = Ref((H-L),-1) ;

RW1 = PW + PW-Ref(L,-1) ;

SW1 = PW - (Ref(H,-1)-PW);
PC= Ref (C,-1);

TimeFrameRestore();

r1=TimeFrameExpand(PP,inDaily,expandFirst);
w1=TimeFrameExpand(PP,inWeekly,expandFirst);

diffpoints = r1-w1;// This will show you diff in points

X = round(r1 - w1);
Chg =Prec((X/w1)*100,1); // This will show you diff in %

Filter=diffpoints AND chg ;// explore

Thanks
Amit

columbus

Well-Known Member
It would be so nice of you ,if you include the OUTPUT of the program here.
It will help a lot ,those ,who are well versed with AMIBROKER.
This go well for any such CODES.Thank you.

casoni

Well-Known Member
Casoni

I have developed the following code, I want the exploration to return only those values which are lesser than 0.5%.

TimeFrameSet(inDaily);

PP = Ref( ((H + L + C)/3),-1) ;

Range = Ref((H-L),-1) ;

R1 = PP + PP-Ref(L,-1) ;

S1 = PP - (Ref(H,-1)-PP);
DC= Ref(C,-1);

TimeFrameRestore();
TimeFrameSet(inWeekly);

PW = Ref( ((H + L + C)/3),-1) ;

Range = Ref((H-L),-1) ;

RW1 = PW + PW-Ref(L,-1) ;

SW1 = PW - (Ref(H,-1)-PW);
PC= Ref (C,-1);

TimeFrameRestore();

r1=TimeFrameExpand(PP,inDaily,expandFirst);
w1=TimeFrameExpand(PP,inWeekly,expandFirst);

diffpoints = r1-w1;// This will show you diff in points

X = round(r1 - w1);
Chg =Prec((X/w1)*100,1); // This will show you diff in %

Filter=diffpoints AND chg ;// explore

Thanks
Amit
there is small error ..check code marked in red..
it should be
w1=TimeFrameExpand(Pw,inWeekly,expandFirst);// corrected

amitrandive

Well-Known Member
Casoni

Thanks for pointing out the error.

Please guide me how to limit the results only to shoe with the differences of 0.5%.

My strategy is as below ( I found on a net article in Forex trading)

1) find the distance between (a) pivot and wkly resistance (b) pivot and wkly support

2) trade the direction of the one with the larger distance

e.g. pivot is 180pips apart from weekly resistance. pivot is 230pips apart from weekly support. GO SHORT

*the difference between (a) and (b) should be significant enough. at least 30 pips difference.*

Last edited: