Experiments with OBV

Status
Not open for further replies.

aja

Well-Known Member
#72
http://www.traderji.com/technical-analysis/103908-my-system-my-trades-72.html#post1210695

I agree, if noobs and rookie traders can adapt this system along with rally decline, mph/mpl taught by Subhadip Sir, loosa days will be over. Then challenges of next phase will come up (scaling up, MM, Position sizing, trade management) etc.

IMO, if person can't be profitable by trading with change of ribbon colors and PH/PL, price action is not suitable thing for them.

Posted test results earlier, very simplified strategy. TF 5 mts, first trade taken at 9.25 in most cases, trade in sync with OBV 15 in price pane and trailed, all trades closed at 3.10. See the profitability of the system. Results are AMI bar replay results no automated back testing.
Then y my back test results is not matching...? I m doing it for 1tf.
Maybe I don know how to back test.. huh..:annoyed:
Sirji, I tested it for 5tf, first trade at 9.25 as per ribbon color. Please download excel from the link, file is having entry/exit time date, price and tsl.
:thumb:
I checked all trades noted down by MB bhai in his excel sheet.As soon as ribbon changing its color on 5tf,he's taking trades.Nice results.

Xray Garu using Price Hi-Lo 15 BO Afl
MB Bhai using OBV Hi-Lo 15 BO Afl
Vijju Bhai using Both.
 

wisp

Well-Known Member
#73
This code for 2 day PDL/PDH was shared by XRAY bro. If we choose "All days" then the PDH/PDL/PDC 2 day lines are all connected. Vijkris bro or Happy ji, Could you please change the code so that the lines are not connected

Code:
_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
CurrBarTime = TimeNum();
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),"",colorDarkRed,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();
 

vijkris

Learner and Follower
#76
@ Wisp
use valuewhen , LastValue & LineArray (see ami help)
If you would be grateful and post the modifications..
My modification does not use any of the above , thus sacrifices the 1st bar. Values is displayed from 2nd bar onwards.

:thumb::thumb:

Waiting for Happy_singh ji or Vijikris to help me out with the code.
My chart now looks like this..



If its not urgent, then lets wait for a perfect code from happylife. :thumb:
 

HappyLife

Well-Known Member
#79
If you would be grateful and post the modifications..
My modification does not use any of the above , thus sacrifices the 1st bar. Values is displayed from 2nd bar onwards.
I am not interested in rectifying others code ……..
as you ask try the above formula in ami from parameter just change “Display Range For" to "Current Day” it will plot line from the current bar.

anyhow I didn’t get the meaning of writing such lengthy & complicated code for simple logic
here the code I use ….. drag it on price chart as many time as you want but don’t forget to change …. No of prev day value ………

Code:
Periods 	= Param("No PrevDay", 1, 1, 30, 1);
Style 	        = ParamStyle("Style", styleLine | styleDashed | styleThick | styleNoLabel | styleNoRescale );

PrevDayHigh	= TimeFrameGetPrice( "H", inDaily, -Periods );
PrevDayLow	= TimeFrameGetPrice( "L", inDaily, -Periods );
PrevDayClose	= TimeFrameGetPrice( "C", inDaily, -Periods );

LValueDHigh	= LastValue(PrevDayHigh);
LValueDLow	= LastValue(PrevDayLow);
LValueDClose	= LastValue(PrevDayClose);

NewDay 		= (Day()!= Ref(Day(), -1));
FirstBar 	= LastValue(ValueWhen(NewDay,BarIndex(),1));
EndBar 		= EndValue(BarIndex()); 

PDHLine		= LineArray(FirstBar, LValueDHigh, EndBar, LValueDHigh, 1);
PDLLine		= LineArray(FirstBar, LValueDLow, EndBar, LValueDLow, 1);
PDCLine		= LineArray(FirstBar, LValueDClose, EndBar, LValueDClose, 1);


Plot(PDHLine,"PDH",ParamColor( "ColorS", colorCycle ), ParamStyle("Style"));
Plot(PDLLine,"PDL",ParamColor( "ColorS", colorCycle ), ParamStyle("Style"));
Plot(PDCLine,"PDC",ParamColor( "ColorS", colorCycle ), ParamStyle("Style"));
 
Last edited:

VJAY

Well-Known Member
#80
I am not interested in rectifying others code ……..
as you ask try the above formula in ami from parameter just change “Display Range For" to "Current Day” it will plot line from the current bar.

anyhow I didn’t get the meaning of writing such lengthy & complicated code for simple logic
here the code I use ….. drag it on price chart as many time as you want but don’t forget to change …. No of prev day value ………

Code:
Periods 	= Param("No PrevDay", 1, 1, 30, 1);
Style 	        = ParamStyle("Style", styleLine | styleDashed | styleThick | styleNoLabel | styleNoRescale );

PrevDayHigh	= TimeFrameGetPrice( "H", inDaily, -Periods );
PrevDayLow	= TimeFrameGetPrice( "L", inDaily, -Periods );
PrevDayClose	= TimeFrameGetPrice( "C", inDaily, -Periods );

LValueDHigh	= LastValue(PrevDayHigh);
LValueDLow	= LastValue(PrevDayLow);
LValueDClose	= LastValue(PrevDayClose);

NewDay 		= (Day()!= Ref(Day(), -1));
FirstBar 	= LastValue(ValueWhen(NewDay,BarIndex(),1));
EndBar 		= EndValue(BarIndex()); 

PDHLine		= LineArray(FirstBar, LValueDHigh, EndBar, LValueDHigh, 1);
PDLLine		= LineArray(FirstBar, LValueDLow, EndBar, LValueDLow, 1);
PDCLine		= LineArray(FirstBar, LValueDClose, EndBar, LValueDClose, 1);


Plot(PDHLine,"PDH",ParamColor( "ColorS", colorCycle ), ParamStyle("Style"));
Plot(PDLLine,"PDL",ParamColor( "ColorS", colorCycle ), ParamStyle("Style"));
Plot(PDCLine,"PDC",ParamColor( "ColorS", colorCycle ), ParamStyle("Style"));
Thanks ...its better change colour of lines as High=red,lows=green/blue
also not showing lows in this afl when selected 2 days
 
Status
Not open for further replies.

Similar threads