My trades based on "new way of pivot trading" and vwap

XRAY27

Well-Known Member

vijkris

Learner and Follower
To do list for this weekend:

1. Incorporate 5 min , 60 period obv as the 4th ribbon.


1st task complete. :clap:
--------------------------------------------------------------------------
For all those whose brain can process 4 ribbons in OBV chart and does not want to change tf to 5 min manually to check for 15 period 5min obv, can use this code. :D

This is not a compulsion, those who don't want, pls don't curse me. ;)




Code:
SetChartOptions( 2,chartShowArrows+ chartShowDates |   chartWrapTitle );
Title = "Varun's OBV  Breakout Ribbons, Topmost: 15 Minutes, Lowest: 5 min 60period & 3rd from top:60 Minutes & 2nd from top: 30 Minutes";


GraphXSpace=10;
_SECTION_BEGIN("On Balance Volume");
Ob  = OBV();		e36 = EMA(Ob,36);		e200 = EMA(Ob,200);
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);
_SECTION_END();


_SECTION_BEGIN("OBV BO_BD 15");
n = Param("Period",15,5,500,5);
y = Param("Ribbon Y",45,0,500,5);
Ob = OBV();
Hi = HHV(Ob,n);		
Lo = LLV(Ob,n);		
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);
PlotOHLC(y,Y+5,y,y,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();


_SECTION_BEGIN("OBV BO_BD 30");
n = Param("Period",30,5,500,5);
y = Param("Ribbon Y",30,0,500,5);
Ob = OBV();
Hi = HHV(Ob,n);		
Lo = LLV(Ob,n);		
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);
PlotOHLC(y,Y+5,y,y,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();


_SECTION_BEGIN("OBV BO_BD 60");
n = Param("Period",60,5,500,5);
y = Param("Ribbon Y",15,0,500,5);
Ob = OBV();
Hi = HHV(Ob,n);		
Lo = LLV(Ob,n);		
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);
PlotOHLC(y,Y+5,y,y,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();
_SECTION_BEGIN("OBV  Hi Lo BO_BD 5mintf");
TimeFrameSet(in5Minute);
n60 = Param("Period",15,5,500,5);
y60 = Param("Ribbon Y",1,0,500,5);
Ob = OBV();
Hi = HHV(Ob,n60);		
Lo = LLV(Ob,n60);	
B60 = Cross(Ob,Ref(Hi,-1));		
S60 = Cross(Ref(Lo,-1),Ob);
B60 = ExRem(B60,S60);	
S60 = ExRem(S60,B60);	
UP60 = Flip(B60,S60);	
DN60 = Flip(S60,B60);
TimeFrameRestore();
up61 = TimeFrameExpand(up60,in5Minute);
PlotOHLC(y60,Y60+10,y60,y60,"",IIf(UP61,ParamColor("5tfup",colorGreen),ParamColor("5tfdown",colorDarkRed)),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();
 

vijkris

Learner and Follower
1st task complete. :clap:
--------------------------------------------------------------------------
For all those whose brain can process 4 ribbons in OBV chart and does not want to change tf to 5 min manually to check for 15 period 5min obv, can use this code. :D

This is not a compulsion, those who don't want, pls don't curse me. ;)




Code:
SetChartOptions( 2,chartShowArrows+ chartShowDates |   chartWrapTitle );
Title = "Varun's OBV  Breakout Ribbons, Topmost: 15 Minutes, Lowest: 5 min 60period & 3rd from top:60 Minutes & 2nd from top: 30 Minutes";


GraphXSpace=10;
_SECTION_BEGIN("On Balance Volume");
Ob  = OBV();		e36 = EMA(Ob,36);		e200 = EMA(Ob,200);
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);
_SECTION_END();


_SECTION_BEGIN("OBV BO_BD 15");
n = Param("Period",15,5,500,5);
y = Param("Ribbon Y",45,0,500,5);
Ob = OBV();
Hi = HHV(Ob,n);		
Lo = LLV(Ob,n);		
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);
PlotOHLC(y,Y+5,y,y,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();


_SECTION_BEGIN("OBV BO_BD 30");
n = Param("Period",30,5,500,5);
y = Param("Ribbon Y",30,0,500,5);
Ob = OBV();
Hi = HHV(Ob,n);		
Lo = LLV(Ob,n);		
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);
PlotOHLC(y,Y+5,y,y,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();


_SECTION_BEGIN("OBV BO_BD 60");
n = Param("Period",60,5,500,5);
y = Param("Ribbon Y",15,0,500,5);
Ob = OBV();
Hi = HHV(Ob,n);		
Lo = LLV(Ob,n);		
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);
PlotOHLC(y,Y+5,y,y,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();
_SECTION_BEGIN("OBV  Hi Lo BO_BD 5mintf");
TimeFrameSet(in5Minute);
n60 = Param("Period",15,5,500,5);
y60 = Param("Ribbon Y",1,0,500,5);
Ob = OBV();
Hi = HHV(Ob,n60);		
Lo = LLV(Ob,n60);	
B60 = Cross(Ob,Ref(Hi,-1));		
S60 = Cross(Ref(Lo,-1),Ob);
B60 = ExRem(B60,S60);	
S60 = ExRem(S60,B60);	
UP60 = Flip(B60,S60);	
DN60 = Flip(S60,B60);
TimeFrameRestore();
up61 = TimeFrameExpand(up60,in5Minute);
PlotOHLC(y60,Y60+10,y60,y60,"",IIf(UP61,ParamColor("5tfup",colorGreen),ParamColor("5tfdown",colorDarkRed)),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();


In the task it was 60 period 5 min obv, but based on manoj ji's reply i changed the default to 15.
Still in parameters settings u can change it to 60 as well.
 

vijkris

Learner and Follower
Added Alert for 1st method of obv ema crossover.

Have to experiment tomo in realtime

Code:
//================================================== ================================================== =======================
SetChartBkGradientFill( ParamColor("Inner panel upper",colorDarkGrey),ParamColor("Inner panel lower",colorGrey40 ));
SetChartBkColor(colorBlack);
SetChartOptions( 2,chartShowArrows+ chartShowDates |   chartWrapTitle );
Title = "Varun's OBV 200 ema method + Alert Version 2, 

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("OBV  Hi Lo BO_BD");
n = Param("Period",15,5,500,5);
y = Param("Ribbon Y",45,0,500,5);
//Ob = OBV();
Hi = HHV(Ob,n);		
Lo = LLV(Ob,n);		
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);
PlotOHLC(y,Y+10,y,y,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();
_SECTION_BEGIN("OBV  Hi Lo BO_BD30");
n30 = Param("Period",30,5,500,5);
y30 = Param("Ribbon Y",30,0,500,5);
//Ob = OBV();
Hi = HHV(Ob,n30);		
Lo = LLV(Ob,n30);		
B30 = Cross(Ob,Ref(Hi,-1));		
S30 = Cross(Ref(Lo,-1),Ob);
B30 = ExRem(B30,S30);	
S30 = ExRem(S30,B30);	
UP30 = Flip(B30,S30);	
DN30 = Flip(S30,B30);
PlotOHLC(y30,Y30+10,y30,y30,"",IIf(UP30,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();
_SECTION_BEGIN("OBV  Hi Lo BO_BD60");
n60 = Param("Period",60,5,500,5);
y60 = Param("Ribbon Y",15,0,500,5);
//Ob = OBV();
Hi = HHV(Ob,n60);		
Lo = LLV(Ob,n60);		
B60 = Cross(Ob,Ref(Hi,-1));		
S60 = Cross(Ref(Lo,-1),Ob);
B60 = ExRem(B60,S60);	
S60 = ExRem(S60,B60);	
UP60 = Flip(B60,S60);	
DN60 = Flip(S60,B60);
PlotOHLC(y60,Y60+10,y60,y60,"",IIf(UP60,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();

_SECTION_BEGIN("OBV  Hi Lo BO_BD300");
n60 = Param("Period",300,5,500,5);
y60 = Param("Ribbon Y",1,0,500,5);
//Ob = OBV();
Hi = HHV(Ob,n60);		
Lo = LLV(Ob,n60);		
B60 = Cross(Ob,Ref(Hi,-1));		
S60 = Cross(Ref(Lo,-1),Ob);
B60 = ExRem(B60,S60);	
S60 = ExRem(S60,B60);	
UP60 = Flip(B60,S60);	
DN60 = Flip(S60,B60);
PlotOHLC(y60,Y60+10,y60,y60,"",IIf(UP60,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();
_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();
 
Last edited:

vijkris

Learner and Follower
To do list for this weekend:

1. Incorporate 5 min , 60 period obv as the 4th ribbon.

2. Put Sound/text alert for 1st method, 200 ema crossover.

3. Put sound/text alert when 3 ribbons show the same color.

4. Create scanner suggested by niftytaurus and another member. I forgot the conditions now.

5. Cepetrader's scalping strategy to be coded and tested.

Edit:

6. Try to create horizontal Sup/Res lines for naked obv trading.


This is what i remember. If I missed anything, kindly point it out.

Thanks.

5th and 6th are the toughest ones.
STatus Update:

1st and 2nd task completed.
3rd- Ribbon rules not yet set. So wont do it now.
4th. - Niftytaurus/others didn tell me what conditions and i was too lazy to dig it out. so didn do. :D

5th- Plotted the arrows partly..

6th- didn touch yet.
 

vijkris

Learner and Follower
5th task.



Coding part is done i think. Only entry arrows plotted.
Testing part is pending.
Still 1st glance does not look promising. :(
May be 40 % accurate. It missed many good moves.
Additional filter must be explored.
 

vijkris

Learner and Follower
Added Alert for 1st method of obv ema crossover.

Have to experiment tomo in realtime

Code:
//================================================== ================================================== =======================
SetChartBkGradientFill( ParamColor("Inner panel upper",colorDarkGrey),ParamColor("Inner panel lower",colorGrey40 ));
SetChartBkColor(colorBlack);
SetChartOptions( 2,chartShowArrows+ chartShowDates |   chartWrapTitle );
Title = "Varun's OBV 200 ema method + Alert Version 2, 

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("OBV  Hi Lo BO_BD");
n = Param("Period",15,5,500,5);
y = Param("Ribbon Y",45,0,500,5);
//Ob = OBV();
Hi = HHV(Ob,n);		
Lo = LLV(Ob,n);		
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);
PlotOHLC(y,Y+10,y,y,"",IIf(UP1,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();
_SECTION_BEGIN("OBV  Hi Lo BO_BD30");
n30 = Param("Period",30,5,500,5);
y30 = Param("Ribbon Y",30,0,500,5);
//Ob = OBV();
Hi = HHV(Ob,n30);		
Lo = LLV(Ob,n30);		
B30 = Cross(Ob,Ref(Hi,-1));		
S30 = Cross(Ref(Lo,-1),Ob);
B30 = ExRem(B30,S30);	
S30 = ExRem(S30,B30);	
UP30 = Flip(B30,S30);	
DN30 = Flip(S30,B30);
PlotOHLC(y30,Y30+10,y30,y30,"",IIf(UP30,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();
_SECTION_BEGIN("OBV  Hi Lo BO_BD60");
n60 = Param("Period",60,5,500,5);
y60 = Param("Ribbon Y",15,0,500,5);
//Ob = OBV();
Hi = HHV(Ob,n60);		
Lo = LLV(Ob,n60);		
B60 = Cross(Ob,Ref(Hi,-1));		
S60 = Cross(Ref(Lo,-1),Ob);
B60 = ExRem(B60,S60);	
S60 = ExRem(S60,B60);	
UP60 = Flip(B60,S60);	
DN60 = Flip(S60,B60);
PlotOHLC(y60,Y60+10,y60,y60,"",IIf(UP60,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();

_SECTION_BEGIN("OBV  Hi Lo BO_BD300");
n60 = Param("Period",300,5,500,5);
y60 = Param("Ribbon Y",1,0,500,5);
//Ob = OBV();
Hi = HHV(Ob,n60);		
Lo = LLV(Ob,n60);		
B60 = Cross(Ob,Ref(Hi,-1));		
S60 = Cross(Ref(Lo,-1),Ob);
B60 = ExRem(B60,S60);	
S60 = ExRem(S60,B60);	
UP60 = Flip(B60,S60);	
DN60 = Flip(S60,B60);
PlotOHLC(y60,Y60+10,y60,y60,"",IIf(UP60,colorBlue,colorRed),styleOwnScale|styleNoLabel|styleCloud,0,500);
_SECTION_END();
_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();

:lol::lol::lol:

Kept the ami open for 5th task and in background alerts is continuously generated.
Something seriously wrong.. :p
Anyway will see in realtime tomo.
 

vijkris

Learner and Follower
5th task.



Coding part is done i think. Only entry arrows plotted.
Testing part is pending.
Still 1st glance does not look promising. :(
May be 40 % accurate. It missed many good moves.
Additional filter must be explored.
Was about to sleep, but somehow did a rough test.
Scrip: BNF
Test period: 7th Feb to 23rd Feb.
No. of trades: 24;
Winners = 15;
Loosers = 9;

= 60% winners.
Amount of each win is less than 1R i think. Only 2 or 3 winners gave 2R or more..
 

Similar threads