# Experiments with OBV

#### XRAY27

##### Well-Known Member
Started this thread to tell my understanding of OBV,thanks to Varun sir for introducing this to the forum ,this will be step wise,so i thought it will be better in members area and it is not good to hijack vijkris thread and to have clean flow before any queries!!!

This is beginners guide to OBV..i'm adding definition of OBV for reference which is vital before jumping into trading !!!

What is 'On-Balance Volume (OBV)'

On-balance volume (OBV) is a momentum indicator that uses volume flow to predict changes in stock price. Joseph Granville developed the OBV metric in the 1960s. He believed that, when volume increases sharply without a significant change in the stock's price, the price will eventually jump upward, and vice versa.

The OBV is a running total of volume (positive and negative). There are three rules implemented when calculating the OBV. They are:

1. If today's closing price is higher than yesterday's closing price, then: Current OBV = Previous OBV + today's volume

2. If today's closing price is lower than yesterday's closing price, then: Current OBV = Previous OBV - today's volume

3. If today's closing price equals yesterday's closing price, then: Current OBV = Previous OBV

Never forget the bold and underline one !!!

Source :investopedia

Tomorrow i will post the chart (which is almost same as ribbon method) but with small changes and also rules of it !!!

Last edited:

#### XRAY27

##### Well-Known Member
Time scale i 'm experimenting is 3 mins and people at will can use it for 1 min also

My EMA/s are 20 EMA and 240EMA in 3 min which represent 5EMA and 14EMA in hourly chart !!!
Extra is previous two days DP , PDH,PDL,PDC,2PDH,2PDL...

in case of 1 min 20 EMA represent 20 period and 240 min represent 4 hour chart !!!

OBV with PDC close isfor bias which is very important !!!

Last edited:

#### XRAY27

##### Well-Known Member
PRICE PLANE AFL

Code:
``````_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", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

_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,"",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();

Plot( EMA( C, 20 ), "CONFIRMATION LINE", colorBlue,styleThick );
Plot( EMA( C, 240 ), " TREND LINE", colorCustom12,styleThick );

_SECTION_BEGIN("Two Day Range");

// Get Previous Day's High low and Close
PrevHigh = TimeFrameGetPrice("H", inDaily, -1);
PrevLow = TimeFrameGetPrice("L", inDaily, -1);
PrevClose = TimeFrameGetPrice("C", inDaily, -1);

// Get Previous 2 Day's High low and Close
Prev2High = TimeFrameGetPrice("H", inDaily, -2);
Prev2Low = TimeFrameGetPrice("L", inDaily, -2);
Prev2Close = TimeFrameGetPrice("C", inDaily, -2);

// Calculate 2 days range
TwoDayRes = Max(PrevHigh, Prev2High);
TwoDaySup = Min(PrevLow, Prev2Low);

// Check bar's time
DayStartTime = 91500;
DayEndTime = 153000;

// Check range condition
IsAllDay = CurrBarTime >= DayStartTime AND CurrBarTime <= DayEndTime;
IsToday = Day() == LastValue(Day()) AND Month() == LastValue(Month());

// Check user selection
ShowRange = ParamToggle("Display Range For", "Current Day|All Day", 0);
if(ShowRange)
{
RangeCodition = IsAllDay;
}
else
{
RangeCodition = IsToday;
}

ShowPrevHLC = ParamToggle("Show Previous day Range", "Yes|No", 1);
ShowTwoDayRange = ParamToggle("Show Two Day Range", "Yes|No", 1);
ColorTwoDayRange = ParamColor("Two Day Range Color", colorWhite);

// Show 2 Day Range
if(ShowTwoDayRange AND Interval() <= 9000)
{
Plot(IIf(RangeCodition,Prev2High ,Null),"",ColorTwoDayRange,styleLine|styleDashed|styleNoRescale|styleNoLabel);
Plot(IIf(RangeCodition,Prev2Low,Null),"",ColorTwoDayRange,styleLine|styleDashed|styleNoRescale|styleNoLabel);
PlotText("2 PDH - " + NumToStr(Prev2High ,1.11), BarCount+1, LastValue(Prev2High ),colorYellow);
PlotText("2 PDL - " + NumToStr(Prev2Low,1.11), BarCount+1, LastValue(Prev2Low),colorYellow);
}

// Show Prev Day HLC
if(ShowPrevHLC AND Interval() <= 3600)
{
Plot(IIf(RangeCodition,PrevHigh,Null),"",ColorTwoDayRange,styleLine|styleThick|styleDashed|styleNoRescale|styleNoLabel);
Plot(IIf(RangeCodition,PrevLow,Null),"",ColorTwoDayRange,styleLine|styleThick|styleDashed|styleNoRescale|styleNoLabel);
Plot(IIf(RangeCodition,PrevClose,Null),"",ColorTwoDayRange,styleLine|styleThick|styleDashed|styleNoRescale|styleNoLabel);
PlotText("PDH - " + NumToStr(PrevHigh,1.11), BarCount+1, LastValue(PrevHigh),colorWhite);
PlotText("PDL - " + NumToStr(PrevLow,1.11), BarCount+1, LastValue(PrevLow),colorWhite);
PlotText("PDC - " + NumToStr(PrevClose,1.11), BarCount+1, LastValue(PrevClose),colorWhite);
}

_SECTION_END();``````
OBV PLANE WITH PDC

Code:
``````_SECTION_BEGIN("On Balance Volume");
Ob = OBV();
Plot(Ob,"",colorWhite,styleNoTitle|styleThick);
nd = Day()!=Ref(Day(),-1);
lb = Day()!=Ref(Day(),1);
ob = OBV();
zero = ValueWhen(lb,ob);
Plot(zero,"",colorWhite,styleNoLabel|styleNoRescale|styleStaircase|styleDashed);
_SECTION_END();``````

Last edited:

#### XRAY27

##### Well-Known Member
RULES :

1.Check the bias with PDC line in OBV.., if OBV is above it is bullish and if below bearish

2.Follow the price chart basing on the bias of OBV

3.React to price on important supports like PDC,PDH,PDL,2PDH,2PDL irrespective of price hi lo color

Last edited:

#### XRAY27

##### Well-Known Member
PLAY AREA: it can be defined as visual distance between two dynamic support/resistance lines

when ever these lines are very near to each other it will act as support or hold resistance to a large extent ..

Last edited:

#### XRAY27

##### Well-Known Member
Example 15 march bnf

Apply 1 st ..first opening candle confirms positive bias with OBV PDC..later it went below PDC but price has not cracked Play area !!! ..so expect surge in up side 9.45 candle moved along with OBV moved above PDC..still ribbon color is red ,but apply rule 3 and 4..

Buy was above 9.45 high with sl below 9.42 candle low First trade hit tsl at 12.03 candle !!!

check the rules for second trade

1. OBV-PDC is bullish

2.12.09 candle closed above 20 EMA (confirmation line) and ribbon color is green (bullish)

Last edited:

#### XRAY27

##### Well-Known Member
Finished all my rules and will post charts !!! as example by evening

Last edited:

#### XRAY27

##### Well-Known Member
Please note that i'm only using price flip of 15 min period !!! these ribbons are not OBV ribbons in price pannel!!!

PDC of OBV is more then enough for trading for me in 3 mins

#### XRAY27

##### Well-Known Member
Today was no trade day !!!

Price never went above the DH and play area between two dynamic lines offered no trade and OBV was above OBV-PDC

Just observe the dynamic support points and test your self !!!

Last edited: