Trading with OBV - for Beginners only !!

vijkris

Learner and Follower
#1
Hi,
First would like to thank Varun ji for coming in this forum and sharing his immense knowledge and trading ideas in this sticky thread.

Also would like to thank Happy ji for creating the relevant afls.
:thanx:


Purpose of this thread :
1. To help beginners in trading to use a simple and effective trading method.

2. To compile all the required rules and afls in the 1st page of the thread, so that one need not search it in the original thread.

3. A dedicated place for slow learners, without disturbing the professionals who are currently discussing in the original thread.




Please consider the posts in this thread as notes taken by students. :thumb:
 

vijkris

Learner and Follower
#2
First Method:

Use of 200ema in Obv and Price :

Summary of the Method :

Buy Setup: Wait for both Price and OBV to come on the same side of 200 ema.
Fresh Cross of obv above its 200 ema is preferred.

SL: Pivot low below 36 ema(price).

Short Setup: Wait for both Price and OBV to come on the same side of 200 ema.
Fresh Cross of obv below its 200 ema is preferred.

SL: Pivot high above 36 ema(price).

Re-entry/adds: long eg: When price touches or crosses below 36 ema and again comes back above 36 ema, then buy at the break of last pivot high which was made before the touch/cross.

Thanks for reading!!!

_________________________________________________________________
Long Summary of the 1st method:
J
Introduction :

It is a trend trading method which uses price and On Balance Volume indicator.

Tools required :
1. Price chart- candles/bar/line chart.
2. EMA on Price : 200EMA and 36 EMA both are compulsory.
3. OBV indicator in separate pane.
4. 200EMA overlayed on OBV is compulsory.
5. 36 EMA overlayed on OBV is optional.

Timeframe : 1 min only.

Basic Principle : Ok, According to VarunKochar ji, we have to be on the dominant side always while trading.
So EMA 200 on PRICE and EMA 200 on OBV is that border which decides which side is dominating.

We are mere followers, not leaders. So simply we will change our loyalty according to the situation. :p

IF price and obv is above 200 ema, All Hail bull brothers !!!
No matter what, we will wait for long opportunity or else SOH.

IF price and OBV is below ema 200, bear brothers ki Jai Ho!!!
No matter what, we will wait for SHORT opportunity or else SOH.

36ema :

36 ema overlaid on price is compulsory, as it gives us adds/reentry or profit taking levels.
36ema overlaid on OBV is optional. It can be used only when there is established trend and 200 ema is far away.

Entry Setup : Valid for both long and short.

1. OBV crossed 200 ema. Price also crossed 200 ema .
Both crosses can happen simultaneously or there may be delay, but wait for both to come in the same side.

2. Buy : Last/recent pivot break above 36 ema. i mean the previous pivot should have formed above 36 ema.
SL = Last pivot low below 36 ema..
Target = Since this entry happens in good trending scenario, atleast keep 1:2 or use trailing stop method.

3. Short: Last/recent pivot break below 36 ema. I mean the previous pivot should have formed below 36 ema.
SL = Last pivot high above 36 ema.
Target = Since this entry happens in good trending scenario, atleast keep 1:2 or use trailing stop method.

Note: Sometimes 200 ema is not touched for days even in 1tf. So at that time, only 36 ema is used for entry.

2nd Best entry setup: Sometimes it does happen that in pivot break above/below 36 ema has already happened but price and obv comes to one side later.
At that time usually vertical bars can be seen.
So instead of chasing the price, wait for "aggressive pivot" to form or wait for pullback to 36 ema and enter at pivot break above/below 36 ema.

SL, target is same as above.

Re-entry/add: When price touches or crosses above/below 36 ema and crossses back up above the last pivot high/low before making the touch.

Conclusion : No method is perfect. Each one has its own strengths and weaknesses.
In case of reversal or tuk tuk, it is prone to whipsaws..
Key to survival is Large capital and robust risk management. (Xitija ji's viewpoint)
Thanks for reading !! :)
( I think i am missing some points, if anyone can figure it out, pls post it)

Rule 3. Trade only after breach of last pivot above/below 200 EMA.
Some more charts.





Long signal in crude..





Code:
SetChartOptions( 2,chartShowArrows+ chartShowDates |   chartWrapTitle );
Title = "OBV 1st method: 200 ema";

GraphXSpace=5;
_SECTION_BEGIN("On Balance Volume");
Ob = OBV();	e36 = EMA(Ob,36);	e200 = EMA(Ob,200); e3 = EMA(Ob,3);
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);
Plot(e3, "",colorViolet,styleNoLabel|styleNoRescale|styleDashed);
_SECTION_END();

//Buy = Cross(OBV(),e200);
Buy = Cross(e3,e200);
//Sell = Cross(e200,OBV());
Sell = Cross(e200,e3);

PlotShapes(Buy*shapeUpArrow,colorGreen,0,e200,-20);
PlotShapes(Sell*shapeDownArrow,colorRed,0,e200,-20);

//Buy1 = Cross(OBV(),E36) AND E36>E200;
//Sell1 = Cross(E36,OBV())AND E36<E200;
Buy1 = Cross(e3,E36) AND E36>E200;
Sell1 = Cross(E36,e3)AND E36<E200;

PlotShapes(Buy1*shapeUpArrow,colorBlue,0,E36,-20);
PlotShapes(Sell1*shapeDownArrow,colorBlue,0,E36,-20);

_SECTION_BEGIN("alerts");
RequestTimedRefresh(20);
AlertIf(Buy,"SOUND C:\\Windows\\Media\\Ding.wav", "buy"+Name(),1,1+2+4); 
AlertIf(Sell,"SOUND C:\\Windows\\Media\\Ding.wav", "Sell"+Name(),2,1+2+4);
//AlertIf(Buy1,"SOUND C:\\Windows\\Media\\Ding.wav", "B Reentry"+Name(),4,1+2+4);
//AlertIf(Sell1,"SOUND C:\\Windows\\Media\\Ding.wav", "S Reentry"+Name(),3,1+2+4);
_SECTION_END();
 

vijkris

Learner and Follower
#4
Another frequently asked Question:

How to set up OBV in Kite/Pi ?


Thanks to Tuna ji for the explanation and Yachusai ji for digging up the link for this info. :thumb:

Its all same thing. Overlaying approach is:

1. Get the underlying indicator done first
2. Select the overlay indicator from study menu and change the deault setting (source) on the pop-up (which is "Close") to the indicator you created on point # 1

Once done you will see the main chart area shrink and indicator (2nd one coming at very bottom) of the price chart box. single click on it to select it (you will see mini square all over it). Drag it and drop it over indicator 1.

Let me show you EMA200 over OBV on 1 min char

1. Get the OBV plotted first, you can change the color (blue or Indigo)



2. Then select EMA same way and change the setting of the source field. Also change the color to make easy to identify as the slower one (I generally use red or yellow)



3. Then it will come and bottom like this. You need to single click on it to get the squares and then drag over OBV:



And the final product:

 

yachusai

Well-Known Member
#6
Nice start Bro , i wish this thread achieve its purpose . i want to say more but my language barrier restrict me . i hope english teacher start seperate thread for me :lol:
 

vijkris

Learner and Follower
#7
Second Method of trading with obv:

This method is applicable only for amibroker users or for someone who is intelligent enough to identify Bo/Bd in Obv chart visually.

For normal people like us, Amibroker will do the job of identifying bo/bd and we can trade in a relaxed way.

Please don't drag and drop these afls.. Instead save it in afl editor, and use insert chart/double click and insert it in a new sheet.

Code:
SetChartBkGradientFill( ParamColor("Inner panel upper",colorDarkGrey),ParamColor("Inner panel lower",colorGrey40 ));
SetChartBkColor(colorBlack);

_SECTION_BEGIN("Price");
SetChartOptions( 2,chartShowArrows+ chartShowDates |   chartWrapTitle );

_N(Title = StrFormat("OBV 2nd Method : {{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", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
Layer = Param("Layer", 0, -5, 5, 1) ;
//Plot( C, "Close",  colorTeal, styleNoTitle |styleCandle,0,0,0 ); 
HiVolume = IIf(V > (2 * MA(V,10)), True, False); 
PlotShapes(shapeSmallCircle * HiVolume, IIf(C > O, colorRed, colorWhite), 0, (O+C)/2, 0);
ToolTip = "Open = " + O + "\nHigh = " + H + "\nLow = " + L + "\nClose = " + C ;

_SECTION_BEGIN("Price Hi Lo"); 
y = Param("Ribbon Y",15,0,500,5);

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(12,"p",IIf(UP2,colorGreen,colorOrange),styleOwnScale|styleNoLabel|styleThick,0,200,0,-5,8); 
PlotOHLC(y,Y+10,y,y,"",IIf(UP2,colorGreen,colorOrange),styleOwnScale|styleNoLabel|styleCloud,0,500);
//Plot(IIf(b2,1,0),"",colorBlue,styleOwnScale|styleNoLabel|styleHistogram|styleDashed,0,1);
//Plot(IIf(s2,1,0),"",colorRed, styleOwnScale|styleNoLabel|styleHistogram|styleDashed,0,1);

_SECTION_END();
_SECTION_BEGIN("OBV Hi Lo"); 
y = Param("Ribbon Y",5,0,500,5);

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(10,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleThick,0,500,0,-5,8); 
PlotOHLC(y,Y+10,y,y,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
showVerticalObvlines15 = ParamToggle("Show vertical line for 15 ribbon change", "No|Yes", 0) ;
if (showVerticalObvlines15)
{
Plot(IIf(B1,1,0),"",colorBlue,styleOwnScale|styleNoLabel|styleHistogram|styleDashed,0,1);
Plot(IIf(S1,1,0),"",colorRed, styleOwnScale|styleNoLabel|styleHistogram|styleDashed,0,1); //vertical lines
}
_SECTION_BEGIN("Alerts");
bluetored = s1;
redtoblue = b1;

RequestTimedRefresh(20);
AlertIf(redtoblue,"SOUND C:\\Windows\\Media\\Ding.wav", "buy"+Name(),1,1+2+4); 
AlertIf(bluetored,"SOUND C:\\Windows\\Media\\Ding.wav", "Sell"+Name(),2,1+2+4);
_SECTION_END();

_SECTION_BEGIN("OBV hi/lo and Supp/Res");


ro = ParamField("Open", 0) ;
rh = ParamField("High", 1) ;
rl = ParamField("Low", 2) ;
rc = ParamField("Close", 3) ;


P = (rH+rL+rC)/3 ;
// = Param("Fast", 1, 1, 100, 1) ;
// = Param("Slow", 3, 1, 100, 1) ;

isemapvts = ParamToggle("Want Pivots ", "No|Yes", 1) ;
pvttype = ParamToggle("Pvt type", "Price|Obv",1);
periodtype = ParamToggle("15 period or 60 period lines?","60 period|15 period",1);


ismph = H-H ;
ismpl = L-L ;


if (isemapvts)
{

 if(pvttype)
{
 if(periodtype)
{
upcross = b1 ; // 15 obv
downcross = s1 ;
}
else
{
upcross = b60; //60obv
downcross = s60;
}
}

else
{
upcross = b2; // price
downcross = s2;
}
bi = BarIndex() ;

mphbar = HighestSinceBars(upcross, rH) ;
mplbar = LowestSinceBars(downcross, rL) ;

mphbi = ValueWhen(downcross, bi, 0) - ValueWhen(downcross, mphbar, 0) ;
ismph = mphbi == bi ;

mplbi = ValueWhen(upCross, bi, 0) - ValueWhen(upCross, mplbar, 0) ;
ismpl = mplbi == bi ;

ismph = IIf(downCross AND mphbar == 0, True, ismph) ;
ismpl = IIf(upcross AND mplbar == 0, True, ismpl) ;

}

_SECTION_BEGIN("OBV Sup/res lines Plot");
showobvSupResline = ParamToggle("Show Obv Sup/Res line", "No|Yes", 1) ;
if (showobvSupResline)
{
//Ch = Param("ch", 5,1,15,1);
bi = Cum(1)-1;
cbar = Param("cbar",2,2,50,1);



P1 = ismph;//GetTop(Ch);
V1 = ismpl;//GetValley(Ch);
P1 = IIf(P1,IIf(ValueWhen(P1,bi,2) < ValueWhen(V1,bi),P1,IIf(ValueWhen(P1,H,2) > H,False,P1)),P1);
P1 = IIf(P1 AND ValueWhen(P1,bi,0) > bi,IIf(ValueWhen(P1,bi,0) < ValueWhen(V1,bi,0),IIf(ValueWhen(P1,H,0) >= H,False,P1),P1),P1);
V1 = IIf(V1,IIf(ValueWhen(V1,bi,2) < ValueWhen(P1,bi),V1,IIf(ValueWhen(V1,L,2)<L,False, V1)),V1);
V1 = IIf(V1 AND ValueWhen(V1,bi,0) > bi ,IIf(ValueWhen(V1,bi,0) < ValueWhen(P1,bi,0),IIf(ValueWhen(V1,L,0) <= L, False,V1),V1),V1); 
RF=ValueWhen(P1,H);
SF=ValueWhen(V1,L);
RF1 = IIf(RF AND BarsSince(P1) <=cbar,RF,Null);
SF1 = IIf(SF AND BarsSince(V1) <=cbar,SF,Null);
Plot(RF1,"",colorBlue,styleDots | styleNoLine|styleNoRescale);
Plot(SF1,"",colorBlue,styleDots | styleNoLine|styleNoRescale); 
Plot(RF,"",ParamColor("Resistance",colorRed),40+16+2048);//2048 is stylenorescale
Plot(SF,"",ParamColor("Support",colorGreen),40+16+2048);
PlotShapes(IIf(P1, shapeSmallSquare,shapeNone),colorGreen,0,H,10);
PlotShapes(shapeSmallCircle*P1,colorBlack,0,H,10);
PlotShapes(IIf(V1, shapeSmallSquare,shapeNone),colorGreen,0,L,-10);
PlotShapes(shapeSmallCircle*V1,colorCustom12,0,L,-10);
}
_SECTION_END();  

_SECTION_BEGIN("EMA1");
P = C;
Periods = Param("Periods", 200, 2, 300, 1, 0 );
EMA1 = EMA(P,Periods);
Plot( eMA1, _DEFAULT_NAME(), ParamColor( "Color", colorPink ), ParamStyle("Style",styleDashed|styleNoRescale) );
The above code is in the price pane and the 1st method's code in the bottom pane.



Simple explanation by Happyji:

Ok, so here goes . . .

Its Varun's concept that a breakout of last 15 Minutes High/Low on OBV levels indicates an change in trend

Also if a break happens around the same time on price, it gives extra confirmation . . .

So we look for Breakout on both Price and OBV (separately one by one)

As soon as one happens (OBV/Price) we start look for other and when we get that we change the color of the ribbon . . .

So a blue ribbon color indicates that an upside breakout has happened . . . (on both one followed by other)
and a Red color indicates and downside BO has occurred . . . (on both one followed by other)

As with all BO/BDs failures will happen, the ribbon does not monitor or bother about all that

A trader has to make a note of this aspect,
with the ribbon we are reducing the information to the minimum (on/off)
so the extra information coming from the OBV chart is not available

this can be both an advantage or otherwise, however keeping this in mind is important


Happy :)
 

Similar threads