another version of the Bongo Indicator
Normal
0
false
false
false
EN-US
X-NONE
X-NONE
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}
==============
Bongo strategy
==============
---8<---------------------------------------
{Bongo Daily/Weekly signals for daily charts.
RSI(8) > RSI(14) > RSI(19) AND C>Mov(C,9,S)
Strategy derived from webinar at:
http://www.dtitrader.com/media/davesteckler10-5-09.wmv
Copyright © 2004-2010 Jose Silva.
All Weekly RSI code remains the intellectualCoded and tested with the VSTpro platform:
http://www.metastocktools.com/vst
}
{User inputs}
tFrame:=Input("Timeframe:
[2]Weekly",1,2,2); pds1:=Input("RSI 1 periods",2,260,8);
pds2:=Input("RSI 2 periods",2,260,14); pds3:=Input("RSI 3
periods",2,260,19); pds4:=Input("SMA periods",2,260,9);
plot:=Input("Display:
[2]RSIs
{Calendar counter engine}
x:=Year()-(Month()<3);
leap:=Int(x/4)-Int(x/100)+Int(x/400);
mth:=Int((2+153*(Month()-3+12*(Month()<3)))/5);
dayNr:=DayOfMonth()+mth+x*365+leap-730425;
dayNr:=
{End of Week signals}
End:=PeakBars(1,DayOfWeek(),1)=0
{Week's Close}
Cl:=ValueWhen(1,End,C);
prevCl:=ValueWhen(2,End,C);
{RSI 1}
pds1:=If(Cum(1)<pds1,Cum(1),pds1);
x:=(Cl>prevCl)*(Cl-prevCl);
up:=PREV*If(End,1-1/pds1,1)+If(End,x/pds1,0);
x:=(Cl<prevCl)*(prevCl-Cl);
dw:=PREV*If(End,1-1/pds1,1)+If(End,x/pds1,0);
Rsi1:=100-100/Max(1+up/Max(dw,.00001),1);
Rsi1:=If(tFrame=1,RSI(C,LastValue(pds1)),
{RSI 2}
pds2:=If(Cum(1)<pds2,Cum(1),pds2);
x:=(Cl>prevCl)*(Cl-prevCl);
up:=PREV*If(End,1-1/pds2,1)+If(End,x/pds2,0);
x:=(Cl<prevCl)*(prevCl-Cl);
dw:=PREV*If(End,1-1/pds2,1)+If(End,x/pds2,0);
Rsi2:=100-100/Max(1+up/Max(dw,.00001),1);
Rsi2:=If(tFrame=1,RSI(C,LastValue(pds2)),
{RSI 3}
pds3:=If(Cum(1)<pds3,Cum(1),pds3);
x:=(Cl>prevCl)*(Cl-prevCl);
up:=PREV*If(End,1-1/pds3,1)+If(End,x/pds3,0);
x:=(Cl<prevCl)*(prevCl-Cl);
dw:=PREV*If(End,1-1/pds3,1)+If(End,x/pds3,0);
Rsi3:=100-100/Max(1+up/Max(dw,.00001),1);
Rsi3:=If(tFrame=1,RSI(C,LastValue(pds3)),
{SMA}
x:=Cum(End*Cl);
Sma:=If(tFrame=1,Mov(C,pds4,S),
{Close}
Cl:=If(tFrame=1,C,Cl);
{Signals}
entry:=Rsi1>Rsi2 AND Rsi2>Rsi3 AND Cl>Sma;
x:=Rsi1<Rsi2 AND Rsi2<Rsi3 AND Cl<Sma;
{Plot in own window}
If(plot=1,entry-x,If(plot=2,Rsi1,Sma));
If(plot=1,entry-x,If(plot=2,Rsi2,Sma));
If(plot=1,entry-x,If(plot=2,Rsi3,Sma));
---8<---------------------------------------