[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: Remember This?



PureBytes Links

Trading Reference Links

/*Adaptive Zones OB/OS OSCILLATOR*/
/*Automatically Adjusts the overbought and oversold levels based on past
performance*/
/*Interpreted and coded by Anthony Faragasso*/
/*Can be used with PrePackaged indicators,RSI,CCI,STOCHK,STOCHD,MFI,ULTIMATE
*/
/*For ROC add the Close. ex.ROC(C,pds);*/

MaxGraph=20;

/*Input */
Lookback=60;
PerCent=95;
Pds =8;

/****Dimitri Code***********/
/*N-Day RSI of MACD()*/ 
//t=14; Replaced with pds= statement
Var=MACD(); 
Up=IIf(Var>Ref(Var,-1),abs(Var-Ref(Var,-1)),0); 
Dn=IIf(Var<Ref(Var,-1),abs(Var-Ref(Var,-1)),0); 
Ut=Wilders(Up,Pds); 
Dt=Wilders(Dn,Pds);
RSIt=100*(Ut/(Ut+Dt)); 
/************End Code*************************/

/********Add Custom Formulas Here******/
//PsychIndex
LookBack2=60;
UpDay= IIf(Close > Ref(Close,-1), 1, 0);
PsychIndex= Sum(UpDay,LookBack2) / LookBack2 * 100;
//****Beta***********************/ 
Mkt="^NDX";/*Base Market: must be enclosed with "..."*/
P=Foreign(Mkt,"c");
periods=21;//Periods of Observation
Beta=(( Periods * Sum(ROC( C,1) * ROC(P,1),Periods )) - (Sum(ROC(C,1)
Periods) * Sum(ROC( P,1),Periods))) / ((Periods * Sum((ROC(P,1)^2 )
Periods)) - (Sum(ROC(P,1 ),Periods)^2 ));
/*********************************/
//ATR
AverageTrueRange=ATR(pds);
/*************************************/
//Trend intensity index
x=10;//Set this to desired Variable.
MA1=MA(C,2*x);
sdp=Sum(IIf(C-MA1 > 0, C-MA1,0),x);
sdm=Sum(IIf(MA1-C > 0, MA1-C,0),x);
TII=(sdp/(sdp + sdm))*100;
/********************************/
//Ease of Movement
MM=((H+L)/2)-((Ref(H,-1)+Ref(L,-1))/2);
Box_ratio=(V/10000)/(H-L);
EVM=EMA((MM/box_ratio),pds);
/************************************/
//% R
R = ((HHV(H,pds) - C) /(HHV (H,pds) -LLV (L,pds))) *-100;
/************************************/
//Balance Of Power - BOP
ThL1=IIf(H-L==0,.00001,H-L);//{Reward Based on the Open}
BuRBoO=(H-O)/(ThL1);
BeRBoO=(O-L)/(ThL1);//{Reward Based on the Close}
BuRBoC=(C-L)/(ThL1);
BeRBoC=(H-C)/(ThL1);//{Reward Based on the Open-Close}
BuRBoOC=IIf(C>O,(C-O)/(ThL1),0);
BeRBoOC=IIf(C>O,0,(O-C)/(ThL1));
BOP=(BuRBoO+BuRBoC+BuRBoOC)/3 - (BeRBoO+BeRBoC+BeRBoOC)/3;
BOP=EMA(BOP,pds);
/**********************************/
//CandleCode II
Bdy=abs(O-C);
Lshd=IIf(C>=O,O-L,C-L);
Ushd=IIf(C>=O,H-C,H-O);
ThBotB=BBandBot(Bdy,55,0.5);
ThTopB=BBandTop(Bdy,55,0.5);
ThBotL=BBandBot(Lshd,55,0.5);
ThTopL=BBandTop(Lshd,55,0.5);
ThBotU=BBandBot(Ushd,55,0.5);
ThTopU=BBandTop(Ushd,55,0.5);
CCode=IIf(C==O,1,0) *IIf(Ushd>=Lshd,64,48)+IIf(C==O,0,1)*(IIf(C>O,1
0)*(IIf(Bdy<=ThBotB,80,0)+IIf(Bdy>ThBotB AND Bdy<=ThTopB,96,0)+
IIf(Bdy>ThTopB,112,0)) + IIf(C<O,1,0)*(IIf(Bdy<=ThBotB,32,0)+IIf(Bdy>ThBotB
AND Bdy<=ThTopB,16,0)))+(IIf(Lshd==0,3,0)+ IIf(Lshd<ThBotL AND Lshd>0,2,0)+
IIf(Lshd>ThBotL AND Lshd<=ThTopL AND Lshd>0,1,0))+(IIf(Ushd>0 AND
Ushd=ThBotU,4,0)+IIf(Ushd>ThbotU AND Ushd<=ThTopU,8,0)+IIf(Ushd>ThTopU,12
0));
/***********************************************/
//Candle Strength Index
/*Pds input suggested is: 2 to 13 pds.*/
Candle_Strength_Index=MA(MA(MA(Ccode,Pds),Pds),Pds);
/*********************************/
//Chaiken Oscillator
//The periods are fixed.
Chaiken_Oscillator=EMA(AccDist(),3)-EMA(AccDist(),10);
/*********************************/
//Chaiken Volatility Oscillator
//10 is recommended for both periods
period=10;
Chaiken_Volatility=ROC(MA((H-L),period),period);
/**********************************/

/*******Variables******************/
A1=RSIt;//Dimitri RSI of MACD
B2=RSI(pds); 
C3=CCI(pds); 
D4=StochK(pds); 
E5=StochD(pds);
F6=MFI(pds); 
G7=Ultimate(pds); 
H8=ROC(C,pds);
I9=PsychIndex;//PsychIndex
J10=Beta;//Beta
K11=AverageTrueRange;//Atr
L12=TII;//Trend intensity Index
M13=EVM;//Ease of Movement
N14=R;//Williams %R
O15=BOP;//Balance of Power
P16=OBV();//ON Balance Volume
Q17=CCode;//Candle Code II
R18=Candle_Strength_Index;
S19=PVI();//Positive Volume Index
T20=NVI();//Negative Volume Index
U21=PVI()-NVI();
V22=AccDist();//Accumulation/Distribution
W23=Chaiken_Oscillator;
X24=Chaiken_Volatility;
/****************************************/

Osc=x24; /*insert variable by Identifier*/ 

/****************************************/
/*Value of Osc*/
Value1 = Osc;

/*Highest AND Lowest Values of Osc during Lookback Period*/
Value2 = HHV(Value1,Lookback);
Value3 = LLV(Value1,Lookback);

/*Range of Osc during Lookback Period*/
Value4 = Value2 - Value3;

/*Define PerCent of Range to determine OB AND OS levels*/
Value5 = Value4 * (PerCent / 100);

/*Calculate OB AND OS levels*/
Value6 = Value3 + Value5;
Value7 = Value2 - Value5;
baseline=(value2 + value3)/2; 

Header=WriteIf(Osc==A1," RSI Of MACD",WriteIf(Osc==b2," RSI",WriteIf(Osc==C3
" CCI",WriteIf(Osc==D4,"STOCHK",WriteIf(Osc==E5,"STOCHD",WriteIf(Osc==F6,"
MONEY FLOW INDEX",WriteIf(Osc==G7," ULTIMATE",WriteIf(Osc==H8," ROC(CLOSE)"
WriteIf(Osc==I9," PsychIndex ",WriteIf(Osc==j10," Beta",WriteIf(Osc==K11,
ATR"+"("+WriteVal(pds,1)+")",WriteIf(Osc==L12,"Trend_Intensity_Index"+"(
+WriteVal(x,1)+")",WriteIf(Osc==M13,"Ease_Of_Movement"+"("+WriteVal(pds,1)+
)",WriteIf(Osc==N14,"Williams %R"+"("+WriteVal(pds,1)+")",WriteIf(Osc==O15,
Balance_Of_Power"+"("+WriteVal(pds,1)+")",WriteIf(Osc==P16,
On_Balance_Volume",WriteIf(Osc==Q17,"Candle_Code II",WriteIf(Osc==R18,
Candle_Strength_Index"+"("+WriteVal(pds,1)+")",WriteIf(Osc==S19,
Positive_Volume_Index",WriteIf(Osc==T20,"Negative_Volume_Index"
WriteIf(Osc==U21,"PVI-NVI",WriteIf(Osc==V22,"Accumulation/Distribution"
WriteIf(Osc==Chaiken_Oscillator,"Chaiken_Oscillator"
WriteIf(Osc==Chaiken_Volatility,"Chaiken_Volatility"+"("+WriteVal(period,1)+
)",""))))))))))))))))))))))));

Plot(Value1, Header,6,1+4); /*BLUE*/
Plot(Value6," O/B",4,1+4); /*RED -TOP(SELL)*/
Plot(Value7," O/S",5,1+4); /*GREEN-BOT(BUY)*/
Plot(Baseline," Baseline",7,1+4); /* yellow*/
 
 
-------Original Message-------
 
From: amibroker@xxxxxxxxxxxxxxx
Date: Thursday, May 22, 2003 9:10:45 PM
To: amibroker@xxxxxxxxxxxxxxx
Cc: jeff davis
Subject: Re: [amibroker] Re: Remember This?
 
   Anthony, I would appreciate your posting it.  .  Ron D
----- Original Message ----- 
From: Anthony Faragasso 
To: amibroker@xxxxxxxxxxxxxxx 
Sent: Thursday, May 22, 2003 5:03 PM
Subject: Re: [amibroker] Re: Remember This?
 
 
Jim,
 
What are your specific questions concerning the Adaptive Zones Oscillator...
.It does not only apply
to built in Indicators....Your can create your own custom indicators  and
substitute it in the OSC= line.
 
Check this....This version contains 24 indicators....If you or anyone is
interested I will post this version.
 
A1=RSIt;//Dimitri RSI of MACD
B2=RSI(pds); 
C3=CCI(pds); 
D4=StochK(pds); 
E5=StochD(pds);
F6=MFI(pds); 
G7=Ultimate(pds); 
H8=ROC(C,pds);
I9=PsychIndex;//PsychIndex
J10=Beta;//Beta
K11=AverageTrueRange;//Atr
L12=TII;//Trend intensity Index
M13=EVM;//Ease of Movement
N14=R;//Williams %R
O15=BOP;//Balance of Power
P16=OBV();//ON Balance Volume
Q17=CCode;//Candle Code II
R18=Candle_Strength_Index;
S19=PVI();//Positive Volume Index
T20=NVI();//Negative Volume Index
U21=PVI()-NVI();
V22=AccDist();//Accumulation/Distribution
W23=Chaiken_Oscillator;
X24=Chaiken_Volatility;
 
Anthony
-------Original Message-------
 
From: amibroker@xxxxxxxxxxxxxxx
Date: Thursday, May 22, 2003 4:17:40 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Remember This?
 
I was looking at that just last night! How do you use it seeing as it 
applies to built in indicators, and it seems to apply to several of 
them???
 
Thanks
Jim
 
--- In amibroker@xxxxxxxxxxxxxxx, "MarkF2" <feierstein@xxxx> wrote:
> Steve- Anthony posted an Adaptive Zones O/B & O/S Oscillator to the
> AFL Library.  
> 
> http://www.amibroker.com/library/detail.php?id=144
> 
> Mark
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Fred" <fctonetti@xxxx> wrote:
> > Steve,
> > 
> > Although I don't believe Rina makes products for AB, try looking 
here 
> > for general ideas at least ... 
> > http://www.rinafinancial.com/DynamicZonesAnalysisPack.asp 
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "steve_almond" <steve@xxxx> 
wrote:
> > > Whilst reading (thousands of) older messages a few weeks ago, I 
cam 
> > > across this system:
> > > 
> > > use an oscillator, but instead of (for example) buying when the 
> > > oscillator crosses 60 and selling when it crosses below 40, the 
new 
> > > system had a variable trigger value.
> > > 
> > > For some reason I remembered the word "Zone" connected with 
this 
> > > system, but a search for "Zone" found no leads.
> > > 
> > > Can anyone help?
> > > 
> > > Thanks,
> > > 
> > > Steve
 
 
Yahoo! Groups Sponsor
 
 
 
 
 
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq
html 
 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
 
 
 
 
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq
html 
 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
 
Yahoo! Groups Sponsor
ADVERTISEMENT
 
 
 
 
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq
html 
 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
 
 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/uetFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/