My System - My trades.

Vipul_84

Well-Known Member
15 period ribbon AFL Code. Someone was looking for this.

Hello

This is the code (old) used for plotting 15 Period OBV ribbon

Code:
Ob = OBV();
H15 = HHV(Ob,15);			L15 = LLV(Ob,15);	
B1 = Cross(Ob,Ref(H15,-1));		S1 = Cross(Ref(L15,-1),Ob);
B1 = ExRem(B1,S1);			S1 = ExRem(S1,B1);
UP1 = Flip(B1,S1);			DN1 = Flip(S1,B1);
PlotOHLC(10,15,10,10,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
Add these two line to it, if you want to plot vertical lines on your chart marking the bar on which the ribbon flips color

Code:
Plot(IIf(B1,1,0),"",colorBlue,styleOwnScale|styleNoLabel|styleHistogram|styleDashed,0,1);
Plot(IIf(S1,1,0),"",colorRed, styleOwnScale|styleNoLabel|styleHistogram|styleDashed,0,1);

Happy :)
 
the afl u were searching was already posted here.. I think wisp directed someone recently to this thread..

http://www.traderji.com/members-dis...-vijkriss-trading-record-pnl.html#post1206945
SIR THANKS A LOT FOR THIS POST.
BUT SIR I WANT I NEED YOUR HELP
sir i require varun sir afl please.
SIR I GETTING ERROR IN PRICE PANEL AS WELL AS OBV PANEL WHEN I TRIED TO SAVE THE AFL.

and one more thing sir please guide me
when i want to write in price panel,
then what actually i should do,
means am i suppose to edit original price afl and add price panel in it. and is it same in case of obv indicator, i.e., editing obv indicator formula and inserting obv panel formula.

sir help ji i give up, muje nahi aata, i dont know how to do sir. :sos:

SIR please please help me i am not technosavvy , sir please send me the afl i am using amibroker 5.7

sir help me please, i am very very thankful.
 

vijkris

Learner and Follower
SIR THANKS A LOT FOR THIS POST.
BUT SIR I WANT I NEED YOUR HELP
sir i require varun sir afl please.
SIR I GETTING ERROR IN PRICE PANEL AS WELL AS OBV PANEL WHEN I TRIED TO SAVE THE AFL.

and one more thing sir please guide me
when i want to write in price panel,
then what actually i should do,
means am i suppose to edit original price afl and add price panel in it. and is it same in case of obv indicator, i.e., editing obv indicator formula and inserting obv panel formula.


sir help ji i give up, muje nahi aata, i dont know how to do sir. :sos:

SIR please please help me i am not technosavvy , sir please send me the afl i am using amibroker 5.7

sir help me please, i am very very thankful.
1. Varun Sir afl is with Varun sir only. :lol:
I don't have it.
2. What is the error in both panels ? :confused:
Post the error codes or screen shot.
I hope u read the post completely..

3. No need to be tech savy to load afls.. Just open afl editor, paste the code. then click tools-insert chart. thats it.

I have not understood anything which I marked in bold. :confused:

In Price Panel what u want to write? "I love Rihana/britney Spears" kya..? :D :rofl:
 
1. Varun Sir afl is with Varun sir only. :lol:
I don't have it.
2. What is the error in both panels ? :confused:
Post the error codes or screen shot.
I hope u read the post completely..

3. No need to be tech savy to load afls.. Just open afl editor, paste the code. then click tools-insert chart. thats it.

I have not understood anything which I marked in bold. :confused:

In Price Panel what u want to write? "I love Rihana/britney Spears" kya..? :D :rofl:
Good Evening sir,
And Thanks For The Reply,
Sir i getting the following problem,

On Price Pane

1) Ribbon for breakout on 15 minutes Hi/Lo of Price
2) Ribbon for breakout on 15 minutes Hi/Lo of OBV


Code:

_SECTION_BEGIN("Price Hi Lo");

HiP= HHV(H,15); LoP= LLV(L,15);

B2 = Cross(C,Ref(HiP,-1)); S2 = Cross(Ref(LoP,-1),C);

B2 = ExRem(B2,S2); S2 = ExRem(S2,B2);

UP2 = Flip(B2,S2); DN2 = Flip(S2,B2);

Plot(40,"",IIf(UP2,colorBlue,colorRed),styleOwnSca le|styleNoLabel|styleThick,0,200,0,-5,8);
//Plot(4,"",IIf(UP2,colorBlue,colorRed),styleOwnScal e|styleNoLabel|styleNoLine|styleDots,0,200);
//Plot(2,"",IIf(UP1,colorBlue,colorRed),styleOwnScal e|styleNoLabel|styleNoLine|styleDots,0,200);
_SECTION_END();

_SECTION_BEGIN("OBV Hi Lo");
Ob = OBV(); Hi = HHV(Ob,15); Lo = LLV(Ob,15);

B1 = Cross(Ob,Ref(Hi,-1)); S1 = Cross(Ref(Lo,-1),Ob);

B1 = ExRem(B1,S1); S1 = ExRem(S1,B1);

UP1 = Flip(B1,S1); DN1 = Flip(S1,B1);

Plot(40,"",IIf(UP1,colorBlue,colorRed),style OwnScale|styleNoLabel|styleThick,0,500,0,-5,8);
//Plot(4,"",IIf(UP2,colorBlue,colorRed),styleOwnScal e|styleNoLabel|styleNoLine|styleDots,0,200);
//Plot(2,"",IIf(UP1,colorBlue,colorRed),styleOwnScal e|styleNoLabel|styleNoLine|styleDots,0,200);
_SECTION_END();




On OBV pane

1) Ribbon Showing breakout combination (Both Price & OBV) on 15 Bars
2) Ribbon Showing breakout combination (Both Price & OBV) on 30 Bars
3) Ribbon Showing breakout combination (Both Price & OBV) on 60 Bars
Code:

//================================================== ================================================== =======================
GraphXSpace=5;
_SECTION_BEGIN("On Balance Volume");
Ob = OBV(); e36 = EMA(Ob,36); e200 = EMA(Ob,200);
Plot(Ob,"",colorWhite,styleNoTitle|styleThick);
Plot(0,"",colorWhite,styleNoLabel|styleNoRescale|s tyleDashed,0,0,5,-5);
Plot(e200,"",colorBrightGreen,styleNoLabel|styleNo Rescale);
Plot(e36, "",colorGold,styleNoLabel|styleNoRescale|styleDash ed);
_SECTION_END();


_SECTION_BEGIN("OBV & Price Hi Lo Breaks");
Ob = OBV();
H15 = HHV(Ob,15); L15 = LLV(Ob,15); B1 = Cross(Ob,Ref(H15,-1)); S1 = Cross(Ref(L15,-1),Ob);
H30 = HHV(Ob,30); L30 = LLV(Ob,30); B2 = Cross(Ob,Ref(H30,-1)); S2 = Cross(Ref(L30,-1),Ob);
H60 = HHV(Ob,60); L60 = LLV(Ob,60); B3 = Cross(Ob,Ref(H60,-1)); S3 = Cross(Ref(L60,-1),Ob);

B1 = ExRem(B1,S1); S1 = ExRem(S1,B1); UP1 = Flip(B1,S1); DN1 = Flip(S1,B1);
B2 = ExRem(B2,S2); S2 = ExRem(S2,B2); UP2 = Flip(B2,S2); DN2 = Flip(S2,B2);
B3 = ExRem(B3,S3); S3 = ExRem(S3,B3); UP3 = Flip(B3,S3); DN3 = Flip(S3,B3);

P15 = HHV(H,15); Q15 = LLV(L,15); X1 = Cross(C,Ref(P15,-1)); Y1 = Cross(Ref(Q15,-1),C);
P30 = HHV(H,30); Q30 = LLV(L,30); X2 = Cross(C,Ref(P30,-1)); Y2 = Cross(Ref(Q30,-1),C);
P60 = HHV(H,60); Q60 = LLV(L,60); X3 = Cross(C,Ref(P60,-1)); Y3 = Cross(Ref(Q60,-1),C);

X1 = ExRem(X1,Y1); Y1 = ExRem(Y1,X1); LG1 = Flip(X1,Y1); SH1 = Flip(Y1,X1);
X2 = ExRem(X2,Y2); Y2 = ExRem(Y2,X2); LG2 = Flip(X2,Y2); SH2 = Flip(Y2,X2);
X3 = ExRem(X3,Y3); Y3 = ExRem(Y3,X3); LG3 = Flip(X3,Y3); SH3 = Flip(Y3,X3);

B15 = UP1 AND LG1; S15 = DN1 AND SH1;
B30 = UP2 AND LG2; S30 = DN2 AND SH2;
B60 = UP3 AND LG3; S60 = DN3 AND SH3;

B15 = ExRem(B15,S15); S15 = ExRem(S15,B15); UP15 = Flip(B15,S15); DN15 = Flip(S15,B15);
B30 = ExRem(B30,S30); S30 = ExRem(S30,B30); UP30 = Flip(B30,S30); DN30 = Flip(S30,B30);
B60 = ExRem(B60,S60); S60 = ExRem(S60,B60); UP60 = Flip(B60,S60); DN60 = Flip(S60,B60);

Plot(30,"",IIf(UP15,colorBlue,colorRed),styleOwnSc ale|styleNoLabel|styleThick,0,500,0,0,3);
Plot(20,"",IIf(UP30,colorBlue,colorRed),styleOwnSc ale|styleNoLabel|styleThick,0,500,0,0,3);
Plot(10,"",IIf(UP60,colorBlue,colorRed),styleOwnSc ale|styleNoLabel|styleThick,0,500,0,0,3);

Title = "Varun's OBV & Price Breakout Ribbons, Topmost: 15 Minutes, Lowest: 60 Minutes & Middle 30 Minutes";
_SECTION_END();
//================================================== ================================================== =======================

Sir (1) i inserted price pane below price.
and (2) then i inserted OBV indicator below it.
after this i inserted OBV PANE below OBV

Sir am i correctly configured the setting for the require study.

but sir both price pane and obv pane showing errors in coding.
Please help me sir.

So i request you sir please check the code , and please help me by providing the corrected code. i will be very much thankful to you sir.

and also please guide me if anything i should more do.
Thanks for the guidance and help sir.
 
Good Evening sir,
And Thanks For The Reply,
Sir i getting the following problem,

On Price Pane

1) Ribbon for breakout on 15 minutes Hi/Lo of Price
2) Ribbon for breakout on 15 minutes Hi/Lo of OBV


Code:

_SECTION_BEGIN("Price Hi Lo");

HiP= HHV(H,15); LoP= LLV(L,15);

B2 = Cross(C,Ref(HiP,-1)); S2 = Cross(Ref(LoP,-1),C);

B2 = ExRem(B2,S2); S2 = ExRem(S2,B2);

UP2 = Flip(B2,S2); DN2 = Flip(S2,B2);

Plot(40,"",IIf(UP2,colorBlue,colorRed),styleOwnSca le|styleNoLabel|styleThick,0,200,0,-5,8);
//Plot(4,"",IIf(UP2,colorBlue,colorRed),styleOwnScal e|styleNoLabel|styleNoLine|styleDots,0,200);
//Plot(2,"",IIf(UP1,colorBlue,colorRed),styleOwnScal e|styleNoLabel|styleNoLine|styleDots,0,200);
_SECTION_END();

_SECTION_BEGIN("OBV Hi Lo");
Ob = OBV(); Hi = HHV(Ob,15); Lo = LLV(Ob,15);

B1 = Cross(Ob,Ref(Hi,-1)); S1 = Cross(Ref(Lo,-1),Ob);

B1 = ExRem(B1,S1); S1 = ExRem(S1,B1);

UP1 = Flip(B1,S1); DN1 = Flip(S1,B1);

Plot(40,"",IIf(UP1,colorBlue,colorRed),style OwnScale|styleNoLabel|styleThick,0,500,0,-5,8);
//Plot(4,"",IIf(UP2,colorBlue,colorRed),styleOwnScal e|styleNoLabel|styleNoLine|styleDots,0,200);
//Plot(2,"",IIf(UP1,colorBlue,colorRed),styleOwnScal e|styleNoLabel|styleNoLine|styleDots,0,200);
_SECTION_END();




On OBV pane

1) Ribbon Showing breakout combination (Both Price & OBV) on 15 Bars
2) Ribbon Showing breakout combination (Both Price & OBV) on 30 Bars
3) Ribbon Showing breakout combination (Both Price & OBV) on 60 Bars
Code:

//================================================== ================================================== =======================
GraphXSpace=5;
_SECTION_BEGIN("On Balance Volume");
Ob = OBV(); e36 = EMA(Ob,36); e200 = EMA(Ob,200);
Plot(Ob,"",colorWhite,styleNoTitle|styleThick);
Plot(0,"",colorWhite,styleNoLabel|styleNoRescale|s tyleDashed,0,0,5,-5);
Plot(e200,"",colorBrightGreen,styleNoLabel|styleNo Rescale);
Plot(e36, "",colorGold,styleNoLabel|styleNoRescale|styleDash ed);
_SECTION_END();


_SECTION_BEGIN("OBV & Price Hi Lo Breaks");
Ob = OBV();
H15 = HHV(Ob,15); L15 = LLV(Ob,15); B1 = Cross(Ob,Ref(H15,-1)); S1 = Cross(Ref(L15,-1),Ob);
H30 = HHV(Ob,30); L30 = LLV(Ob,30); B2 = Cross(Ob,Ref(H30,-1)); S2 = Cross(Ref(L30,-1),Ob);
H60 = HHV(Ob,60); L60 = LLV(Ob,60); B3 = Cross(Ob,Ref(H60,-1)); S3 = Cross(Ref(L60,-1),Ob);

B1 = ExRem(B1,S1); S1 = ExRem(S1,B1); UP1 = Flip(B1,S1); DN1 = Flip(S1,B1);
B2 = ExRem(B2,S2); S2 = ExRem(S2,B2); UP2 = Flip(B2,S2); DN2 = Flip(S2,B2);
B3 = ExRem(B3,S3); S3 = ExRem(S3,B3); UP3 = Flip(B3,S3); DN3 = Flip(S3,B3);

P15 = HHV(H,15); Q15 = LLV(L,15); X1 = Cross(C,Ref(P15,-1)); Y1 = Cross(Ref(Q15,-1),C);
P30 = HHV(H,30); Q30 = LLV(L,30); X2 = Cross(C,Ref(P30,-1)); Y2 = Cross(Ref(Q30,-1),C);
P60 = HHV(H,60); Q60 = LLV(L,60); X3 = Cross(C,Ref(P60,-1)); Y3 = Cross(Ref(Q60,-1),C);

X1 = ExRem(X1,Y1); Y1 = ExRem(Y1,X1); LG1 = Flip(X1,Y1); SH1 = Flip(Y1,X1);
X2 = ExRem(X2,Y2); Y2 = ExRem(Y2,X2); LG2 = Flip(X2,Y2); SH2 = Flip(Y2,X2);
X3 = ExRem(X3,Y3); Y3 = ExRem(Y3,X3); LG3 = Flip(X3,Y3); SH3 = Flip(Y3,X3);

B15 = UP1 AND LG1; S15 = DN1 AND SH1;
B30 = UP2 AND LG2; S30 = DN2 AND SH2;
B60 = UP3 AND LG3; S60 = DN3 AND SH3;

B15 = ExRem(B15,S15); S15 = ExRem(S15,B15); UP15 = Flip(B15,S15); DN15 = Flip(S15,B15);
B30 = ExRem(B30,S30); S30 = ExRem(S30,B30); UP30 = Flip(B30,S30); DN30 = Flip(S30,B30);
B60 = ExRem(B60,S60); S60 = ExRem(S60,B60); UP60 = Flip(B60,S60); DN60 = Flip(S60,B60);

Plot(30,"",IIf(UP15,colorBlue,colorRed),styleOwnSc ale|styleNoLabel|styleThick,0,500,0,0,3);
Plot(20,"",IIf(UP30,colorBlue,colorRed),styleOwnSc ale|styleNoLabel|styleThick,0,500,0,0,3);
Plot(10,"",IIf(UP60,colorBlue,colorRed),styleOwnSc ale|styleNoLabel|styleThick,0,500,0,0,3);

Title = "Varun's OBV & Price Breakout Ribbons, Topmost: 15 Minutes, Lowest: 60 Minutes & Middle 30 Minutes";
_SECTION_END();
//================================================== ================================================== =======================

Sir (1) i inserted price pane below price.
and (2) then i inserted OBV indicator below it.
after this i inserted OBV PANE below OBV

Sir am i correctly configured the setting for the require study.

but sir both price pane and obv pane showing errors in coding.
Please help me sir.

So i request you sir please check the code , and please help me by providing the corrected code. i will be very much thankful to you sir.

and also please guide me if anything i should more do.
Thanks for the guidance and help sir.
what error u r getting post the screen shot of that so one can help u.
 

vijkris

Learner and Follower
Good Evening sir,
And Thanks For The Reply,
Sir i getting the following problem,

On Price Pane

1) Ribbon for breakout on 15 minutes Hi/Lo of Price
2) Ribbon for breakout on 15 minutes Hi/Lo of OBV


Code:

_SECTION_BEGIN("Price Hi Lo");

HiP= HHV(H,15); LoP= LLV(L,15);

B2 = Cross(C,Ref(HiP,-1)); S2 = Cross(Ref(LoP,-1),C);

B2 = ExRem(B2,S2); S2 = ExRem(S2,B2);

UP2 = Flip(B2,S2); DN2 = Flip(S2,B2);

Plot(40,"",IIf(UP2,colorBlue,colorRed),styleOwnSca le|styleNoLabel|styleThick,0,200,0,-5,8);
//Plot(4,"",IIf(UP2,colorBlue,colorRed),styleOwnScal e|styleNoLabel|styleNoLine|styleDots,0,200);
//Plot(2,"",IIf(UP1,colorBlue,colorRed),styleOwnScal e|styleNoLabel|styleNoLine|styleDots,0,200);
_SECTION_END();

_SECTION_BEGIN("OBV Hi Lo");
Ob = OBV(); Hi = HHV(Ob,15); Lo = LLV(Ob,15);

B1 = Cross(Ob,Ref(Hi,-1)); S1 = Cross(Ref(Lo,-1),Ob);

B1 = ExRem(B1,S1); S1 = ExRem(S1,B1);

UP1 = Flip(B1,S1); DN1 = Flip(S1,B1);

Plot(40,"",IIf(UP1,colorBlue,colorRed),style OwnScale|styleNoLabel|styleThick,0,500,0,-5,8);
//Plot(4,"",IIf(UP2,colorBlue,colorRed),styleOwnScal e|styleNoLabel|styleNoLine|styleDots,0,200);
//Plot(2,"",IIf(UP1,colorBlue,colorRed),styleOwnScal e|styleNoLabel|styleNoLine|styleDots,0,200);
_SECTION_END();




On OBV pane

1) Ribbon Showing breakout combination (Both Price & OBV) on 15 Bars
2) Ribbon Showing breakout combination (Both Price & OBV) on 30 Bars
3) Ribbon Showing breakout combination (Both Price & OBV) on 60 Bars
Code:

//================================================== ================================================== =======================
GraphXSpace=5;
_SECTION_BEGIN("On Balance Volume");
Ob = OBV(); e36 = EMA(Ob,36); e200 = EMA(Ob,200);
Plot(Ob,"",colorWhite,styleNoTitle|styleThick);
Plot(0,"",colorWhite,styleNoLabel|styleNoRescale|s tyleDashed,0,0,5,-5);
Plot(e200,"",colorBrightGreen,styleNoLabel|styleNo Rescale);
Plot(e36, "",colorGold,styleNoLabel|styleNoRescale|styleDash ed);
_SECTION_END();


_SECTION_BEGIN("OBV & Price Hi Lo Breaks");
Ob = OBV();
H15 = HHV(Ob,15); L15 = LLV(Ob,15); B1 = Cross(Ob,Ref(H15,-1)); S1 = Cross(Ref(L15,-1),Ob);
H30 = HHV(Ob,30); L30 = LLV(Ob,30); B2 = Cross(Ob,Ref(H30,-1)); S2 = Cross(Ref(L30,-1),Ob);
H60 = HHV(Ob,60); L60 = LLV(Ob,60); B3 = Cross(Ob,Ref(H60,-1)); S3 = Cross(Ref(L60,-1),Ob);

B1 = ExRem(B1,S1); S1 = ExRem(S1,B1); UP1 = Flip(B1,S1); DN1 = Flip(S1,B1);
B2 = ExRem(B2,S2); S2 = ExRem(S2,B2); UP2 = Flip(B2,S2); DN2 = Flip(S2,B2);
B3 = ExRem(B3,S3); S3 = ExRem(S3,B3); UP3 = Flip(B3,S3); DN3 = Flip(S3,B3);

P15 = HHV(H,15); Q15 = LLV(L,15); X1 = Cross(C,Ref(P15,-1)); Y1 = Cross(Ref(Q15,-1),C);
P30 = HHV(H,30); Q30 = LLV(L,30); X2 = Cross(C,Ref(P30,-1)); Y2 = Cross(Ref(Q30,-1),C);
P60 = HHV(H,60); Q60 = LLV(L,60); X3 = Cross(C,Ref(P60,-1)); Y3 = Cross(Ref(Q60,-1),C);

X1 = ExRem(X1,Y1); Y1 = ExRem(Y1,X1); LG1 = Flip(X1,Y1); SH1 = Flip(Y1,X1);
X2 = ExRem(X2,Y2); Y2 = ExRem(Y2,X2); LG2 = Flip(X2,Y2); SH2 = Flip(Y2,X2);
X3 = ExRem(X3,Y3); Y3 = ExRem(Y3,X3); LG3 = Flip(X3,Y3); SH3 = Flip(Y3,X3);

B15 = UP1 AND LG1; S15 = DN1 AND SH1;
B30 = UP2 AND LG2; S30 = DN2 AND SH2;
B60 = UP3 AND LG3; S60 = DN3 AND SH3;

B15 = ExRem(B15,S15); S15 = ExRem(S15,B15); UP15 = Flip(B15,S15); DN15 = Flip(S15,B15);
B30 = ExRem(B30,S30); S30 = ExRem(S30,B30); UP30 = Flip(B30,S30); DN30 = Flip(S30,B30);
B60 = ExRem(B60,S60); S60 = ExRem(S60,B60); UP60 = Flip(B60,S60); DN60 = Flip(S60,B60);

Plot(30,"",IIf(UP15,colorBlue,colorRed),styleOwnSc ale|styleNoLabel|styleThick,0,500,0,0,3);
Plot(20,"",IIf(UP30,colorBlue,colorRed),styleOwnSc ale|styleNoLabel|styleThick,0,500,0,0,3);
Plot(10,"",IIf(UP60,colorBlue,colorRed),styleOwnSc ale|styleNoLabel|styleThick,0,500,0,0,3);

Title = "Varun's OBV & Price Breakout Ribbons, Topmost: 15 Minutes, Lowest: 60 Minutes & Middle 30 Minutes";
_SECTION_END();
//================================================== ================================================== =======================

Sir (1) i inserted price pane below price.
and (2) then i inserted OBV indicator below it.
after this i inserted OBV PANE below OBV

Sir am i correctly configured the setting for the require study.

but sir both price pane and obv pane showing errors in coding.
Please help me sir.

So i request you sir please check the code , and please help me by providing the corrected code. i will be very much thankful to you sir.

and also please guide me if anything i should more do.
Thanks for the guidance and help sir.
Hi, I am sorry, code is 1000% correct.
take a new blank sheet. Just click on tools-insert chart, in afl editor.
You are not supposed to insert price or obv indicator separately.
Everything is built-in in this afl.

Please improve your basic knkowledge in amibroker usage.

You have not posted the screenshot of the error as well. Hope you know using tinypic/imgur to upload pic.
 

Similar threads