My System - My trades.

shri_r3

Active Member
Hi below is code for exploration and scanning. I dont have much knowledge in coding , only know changing colors and line styles.
If scanning code is wrong please correct it. I checked visually in few charts and looks correct. Done using trial and error method by seeing other afl's.
Only considering first 2 rules as given by Varun ji. Both price and ovb on 15 period to be in sync to get signal. Scan is good for daily charts I think.
For 3rd rule i.e OBV on 5 min chart should also be in sync with 1 min 15 period price and OBV , dint understand how to do it. Happy ji to rescue..:):)

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

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,colorLightBlue,colorRed),styleOwnScale|styleNoLabel|styleThick,0,200,0,-5,8);
//Plot(4,"",IIf(UP2,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleNoLine|styleDots,0,200);
//Plot(2,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleNoLine|styleDots,0,200);
_SECTION_END();
_SECTION_BEGIN("OBV Hi Lo");
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);
//Plot(4,"",IIf(UP2,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleNoLine|styleDots,0,200);
//Plot(2,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleNoLine|styleDots,0,200);

// To plot vertical lines at which OBV ribbon changes color
//Plot(IIf(B1,1,0),"",colorBlue,styleOwnScale|styleNoLabel|styleHistogram|styleDashed,0,1);
//Plot(IIf(S1,1,0),"",colorRed, styleOwnScale|styleNoLabel|styleHistogram|styleDashed,0,1);

// Exploration
Buy = UP1 AND UP2;
Sell = DN1 AND DN2;
b= ExRem(Buy,Sell);
s= ExRem(Sell,Buy);

Filter= b OR s;


_SECTION_END();
 
Last edited:
So guys remember i had told you not delete any ribbon in OBV 15/30/60. Well time has come to use them. So who is willing to backtest. Pls. I am not at all tech savvy so relying on you techies. Only on somebody's confirmation will i tell what to backtest.
 

vsaran

Well-Known Member
So guys remember i had told you not delete any ribbon in OBV 15/30/60. Well time has come to use them. So who is willing to backtest. Pls. I am not at all tech savvy so relying on you techies. Only on somebody's confirmation will i tell what to backtest.
I am very much interested,but I don't have amibroker.Just I am grasping the points/method.Please pardon me Sir.
 

Apacheindian

Well-Known Member
So guys remember i had told you not delete any ribbon in OBV 15/30/60. Well time has come to use them. So who is willing to backtest. Pls. I am not at all tech savvy so relying on you techies. Only on somebody's confirmation will i tell what to backtest.


I am in Sir..!

Just one request, i feel many members have either tweaked their AFL's or not using the revised one. So before going ahed please post your AFLs codes so that everyone gets same results simultaneously..!
 
I am in Sir..!

Just one request, i feel many members have either tweaked their AFL's or not using the revised one. So before going ahed please post your AFLs codes so that everyone gets same results simultaneously..!
Thanks Apache ji. I just want to backtest the results of the 60period OBV ribbon in 5min.charts from 1st January this year. So about 2 months data. Long on blue signals and short on red signals. No filter. No other condition. thanks
 

Apacheindian

Well-Known Member
I really dont go into minor, major kinda stuff, its not required really.

What I see from the chart, is pivots marked are within previous swing which was up.

As far as I know lower high is confirmed only when previous swing low is broken and Higher low is confirmed when previous swing high is broken.


Apache ji uptrend is defined by higher lows only (higher highs are just a by product). Hope you get the answer in this.


ST, sir what's your take on this situation..?
 

Similar threads