here's the code which displays pdh and pdl of obv.
Code:
SetChartBkGradientFill( ParamColor("Inner panel upper",colorDarkGrey),ParamColor("Inner panel lower",colorGrey40 ));
SetChartBkColor(colorBlack);
SetChartOptions( 2,chartShowArrows+ chartShowDates | chartWrapTitle );
_SECTION_BEGIN("OBV");
Plot( OBV(), _DEFAULT_NAME(), ParamColor("Color", colorOrange ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA36");
P = OBV();
Periods = Param("Periods", 36, 2, 300, 1, 0 );
EMA36 = EMA(P,Periods);
Plot( EMA36, _DEFAULT_NAME(), ParamColor( "Color", colorBrightGreen ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("EMA1");
P = OBV();
Periods = Param("Periods", 200, 2, 300, 1, 0 );
EMA1 = EMA(P,Periods);
Plot( EMA1, _DEFAULT_NAME(), ParamColor( "Color", colorPink ), ParamStyle("Style",styleDashed|styleNoRescale) );
_SECTION_END();
impureUp = OBV()>EMA1;
impureDown = OBV()<EMA1;
Clr = IIf(impureUp,colorGreen,IIf(impureDown,colorRed,colorGrey40));
//Plot(8, "", Clr, styleArea|styleOwnScale, 0, 100, 0, -1) ;
Buy = Cross(OBV(),EMA1);
Sell = Cross(EMA1,OBV());
PlotShapes(Buy*shapeUpArrow,colorGreen,0,EMA1,-20);
PlotShapes(Sell*shapeDownArrow,colorRed,0,EMA1,-20);
/*
Buy1 = Cross(OBV(),EMA36) AND EMA36>EMA1;
Sell1 = Cross(EMA36,OBV())AND EMA36<EMA1;
PlotShapes(Buy1*shapeUpArrow,colorBlue,0,EMA36,-20);
PlotShapes(Sell1*shapeDownArrow,colorBlue,0,EMA36,-20);
*/
///////////////////////////////////////////////////////////////////////////////////////////////
Filterdaych = ParamToggle("Filter Day Change Connections", "No|Yes", 1) ;
dt = DateTime() ;
dtnum = DateTimeConvert(2, dt,TimeNum()) ;
newdt = dtnum != Ref(dtnum, -1);
Lastbar = H-H ;
if (Filterdaych)
Lastbar = dtnum != Ref(dtnum, 1) ;
strnday = "day";
///////////////////////opening range//////////////
NewDay = Day()!= Ref(Day(), -1);
highestoftheday = refhigh = HighestSince(newday,OBV(),1);
Lowestoftheday =Reflow = LowestSince(newday,OBV(),1);
////////////////////prevday obv//////////////
dt = DateTime() ;
dtnum = DateTimeConvert(0, dt) ;
newdt = dtnum != Ref(dtnum, -1) ;
Lastbar = H-H ;
if (Filterdaych)
Lastbar = dtnum != Ref(dtnum, 1) ;
Refobvhigh = Refhigh;
Refobvlow = Reflow;
shift = Param("Shift", 0, -1, 0, 1) ;
prevdayvalueH = prevdayobvhigh = ValueWhen(Ref(newdt,1), Refobvhigh, 1);
prevdayvalueL = prevdayobvlow = ValueWhen(Ref(newdt,1), Refobvlow,1);
if (shift == -1)
{
prevdayvaluehigh = prevdayobvH;
prevdayvaluelow = prevdayobvL;
}
Plot(IIf(Lastbar,Null, prevdayvalueH),"Yesterday obvHigh",colorBlue,ParamStyle("yh style",styleThick| styleNoRescale));//+styleOwnScale);
Plot(IIf(Lastbar,Null, prevdayvalueL),"Yesterday obvLow",colorRed,ParamStyle("yh style", styleThick|styleNoRescale));//+styleOwnScale);