My System - My trades.

wisp

Well-Known Member
Yes they are, but think it as a combined one? U can avoid many whips

DM
The original reason for going with OBV was because 200 ema was giving delayed entries, so this will defeat the purpose. Avoiding whips and missing out on moves run counter to each other, so need to find a balance.
 
Happy sir can you edit my afl as candles are overlapping on the bands .
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

UpCandleColor = ParamColor("Up Candle Color", colorDarkGreen );
DownCandleColor = ParamColor("Down Candle Color", colorRed );
Graph0BarColor = IIf( C > O,UpCandleColor ,DownCandleColor);
_SECTION_BEGIN("MA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
//Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();


if( ParamToggle("EMA200", "No|Yes", 1))Plot(EMA(Close,200), "EMA200", colorRed,styleLine|styleDashed|styleThick);
if( ParamToggle("EMA36", "No|Yes", 1))Plot(EMA(Close,36), "EMA36", colorBlue,styleLine|styleDashed|styleThick);

_SECTION_BEGIN("MA3");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
//Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();


_SECTION_BEGIN("OBV Hi Lo BO_BD");
n = Param("Period",15,5,500,5);
y = Param("Ribbon Y",10,0,500,5);
Ob = OBV();
Hi = HHV(Ob,n);
Lo = LLV(Ob,n);
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);
PlotOHLC(y,Y+5,y,y,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();


// RGST-VJAY-Lines AFL

/* afl that can plot lines for:
Monthly HL,
Weekly HL,
Yesterdays HLC,
Today's Open, HOD, LOD.
can turn these lines on/off from parameters
can change colour of these lines from parameters

Using parameters can plot HL lines for current month/week or last month/week.
Default is current month/week.
To plot lines for last month/week change the parameter "MonthSelected"/"WeekSelected" to -1.
*/












//===========================================================================================================================
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|styleDashed,0,0,5);
//Plot(e200,"",colorBrightGreen,styleNoLabel|styleNoRescale);
//Plot(e36, "",colorGold,styleNoLabel|styleNoRescale|styleDashed);
_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);

PlotOHLC( 5,10, 5, 50,"",IIf(UP60,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,150);
PlotOHLC(15,20,15,15,"",IIf(UP30,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,150);
PlotOHLC(25,30,25,25,"",IIf(UP15,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,150);

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

XRAY27

Well-Known Member

vijkris

Learner and Follower
Code:
_SECTION_BEGIN("OBV  Hi Lo BO_BD");
n = Param("Period",15,5,500,5);
y = Param("Ribbon Y",10,0,500,5);
Ob = OBV();
Hi = HHV(Ob,n);		
Lo = LLV(Ob,n);		
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);
PlotOHLC(y,Y+5,y,y,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();
Paste the above code on your OBV pane and configure the period and placement(y axis) . . .

The code can be used multiple time to get all 3 ribbons and you can configure it to the 15/30/60 etc.


Please Note that, this code will also work on older version, but currently not possible to do any update/queries for this code

Happy :)
Simple copy paste 3 times didin work for me... So did some changes to the code. In this one there is no price bo/bd component.
I think the modification done is correct, anyone else pls confirm.

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|styleDashed,0,0,5,-5);
Plot(e200,"",colorBrightGreen,styleNoLabel|styleNoRescale);
Plot(e36, "",colorGold,styleNoLabel|styleNoRescale|styleDashed);
_SECTION_END();


_SECTION_BEGIN("OBV  Hi Lo BO_BD");
n = Param("Period",15,5,500,5);
y = Param("Ribbon Y",35,0,500,5);
//Ob = OBV();
Hi = HHV(Ob,n);		
Lo = LLV(Ob,n);		
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);
PlotOHLC(y,Y+10,y,y,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();
_SECTION_BEGIN("OBV  Hi Lo BO_BD30");
n30 = Param("Period",30,5,500,5);
y30 = Param("Ribbon Y",20,0,500,5);
//Ob = OBV();
Hi = HHV(Ob,n30);		
Lo = LLV(Ob,n30);		
B30 = Cross(Ob,Ref(Hi,-1));		
S30 = Cross(Ref(Lo,-1),Ob);
B30 = ExRem(B30,S30);	
S30 = ExRem(S30,B30);	
UP30 = Flip(B30,S30);	
DN30 = Flip(S30,B30);
PlotOHLC(y30,Y30+10,y30,y30,"",IIf(UP30,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();
_SECTION_BEGIN("OBV  Hi Lo BO_BD60");
n60 = Param("Period",60,5,500,5);
y60 = Param("Ribbon Y",5,0,500,5);
//Ob = OBV();
Hi = HHV(Ob,n60);		
Lo = LLV(Ob,n60);		
B60 = Cross(Ob,Ref(Hi,-1));		
S60 = Cross(Ref(Lo,-1),Ob);
B60 = ExRem(B60,S60);	
S60 = ExRem(S60,B60);	
UP60 = Flip(B60,S60);	
DN60 = Flip(S60,B60);
PlotOHLC(y60,Y60+10,y60,y60,"",IIf(UP60,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();
 
Right Vijay :thumb:


Code:
GraphXSpace=10;
_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|styleDashed,0,0,5,-5);
Plot(e200,"",colorBrightGreen,styleNoLabel|styleNoRescale);
Plot(e36, "",colorGold,styleNoLabel|styleNoRescale|styleDashed);
_SECTION_END();


_SECTION_BEGIN("OBV BO_BD 15");
n = Param("Period",15,5,500,5);
y = Param("Ribbon Y",45,0,500,5);
Ob = OBV();
Hi = HHV(Ob,n);		
Lo = LLV(Ob,n);		
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);
PlotOHLC(y,Y+5,y,y,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();


_SECTION_BEGIN("OBV BO_BD 30");
n = Param("Period",30,5,500,5);
y = Param("Ribbon Y",30,0,500,5);
Ob = OBV();
Hi = HHV(Ob,n);		
Lo = LLV(Ob,n);		
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);
PlotOHLC(y,Y+5,y,y,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();


_SECTION_BEGIN("OBV BO_BD 60");
n = Param("Period",60,5,500,5);
y = Param("Ribbon Y",15,0,500,5);
Ob = OBV();
Hi = HHV(Ob,n);		
Lo = LLV(Ob,n);		
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);
PlotOHLC(y,Y+5,y,y,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();
now if you want you can set the ribbons even to the top of the charts instead of being at the bottom . . .


Happy :)
 

XRAY27

Well-Known Member
Simple copy paste 3 times didin work for me... So did some changes to the code. In this one there is no price bo/bd component.
I think the modification done is correct, anyone else pls confirm.
Checked this code in Bnf..same result 3 SL's last trade a minor profit !!!
 

Similar threads