logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
StorkBite  
#1 Posted : Monday, March 27, 2006 2:35:24 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
I've been checking out the APE article in TASC Apr 2006. It's pretty interesting. Here's a combination of the first 3 indicators mentioned. I can't figure out how to correct the Alpha reading to truly return a value between 0-1. I tried using a couple of different methods (including an external dll), but no success. So, what I wound up doing was normalizing the original method and plotting that instead. Here's what I came up with. Original [code:1:a0f0183825]{ User Input } i1:=Input("APE periods",2,252,20); i2:=Input("Plot smoothing periods",1,100,1); i3:=Input("Plot (APE=1 Ratio=2 Alpha=3)",1,3,1); { Calculations } APE1:=Max(Abs(H-O),Abs(L-O)); APEn:=Max(Abs(HHV(H,i1)-Ref(O,-(i1-1))),Abs(LLV(L,i1)-Ref(O,-(i1-1)))); APEratio:=APEn/APE1; APEalpha:=Log(APEratio)/Log(i1); { Plot } If(i3=1,Mov(APEn,i2,E), If(i3=2,APEratio, If(i3=3,APEalpha,0)));[/code:1:a0f0183825] Normalized [code:1:a0f0183825]{ User Input } i1:=Input("APE periods",2,252,20); i2:=Input("Plot smoothing periods",1,100,1); i3:=Input("Plot (APE=1 Ratio=2 Alpha=3)",1,3,1); i4:=Input("Normalize Alpha (No=1 Yes=2)",1,2,2); { Calculations } APE1:=Max(Abs(H-O),Abs(L-O)); APEn:=Max(Abs(HHV(H,i1)-Ref(O,-(i1-1))),Abs(LLV(L,i1)-Ref(O,-(i1-1)))); APEratio:=APEn/APE1; APEalpha:=Log(APEratio)/Log(i1); APEalphaN:=(APEalpha-Lowest(APEalpha))/Max(Highest(APEalpha)-Lowest(APEalpha),0.0001); { Plot } If(i3=1,Mov(APEn,i2,E), If(i3=2,APEratio, If(i4=1,APEalpha,APEalphaN)));[/code:1:a0f0183825]
StorkBite  
#2 Posted : Monday, March 27, 2006 2:38:33 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
For the Explorer, I use these codes. These include the Rate of Return Time Frame function that is mentioned at the end of the article. Sorry, I could not figure out how to plot it and make it have the same meaning as shown in the Figure. Column A: APE1 i1:=1; APEn:=Max(Abs(HHV(H,i1)-Ref(O,-(i1-1))),Abs(LLV(L,i1)-Ref(O,-(i1-1)))); APEn Column B: APE5 i1:=5; APEn:=Max(Abs(HHV(H,i1)-Ref(O,-(i1-1))),Abs(LLV(L,i1)-Ref(O,-(i1-1)))); APEn Column C: APE20 i1:=20; APEn:=Max(Abs(HHV(H,i1)-Ref(O,-(i1-1))),Abs(LLV(L,i1)-Ref(O,-(i1-1)))); APEn Column D: Ratio20 i1:=20; APEn:=Max(Abs(HHV(H,i1)-Ref(O,-(i1-1))),Abs(LLV(L,i1)-Ref(O,-(i1-1)))); APE1:=Max(Abs(H-O),Abs(L-O)); Ratio:=APEn/APE1; Ratio Column E: Alpha20 (non-normalized) i1:=20; APEn:=Max(Abs(HHV(H,i1)-Ref(O,-(i1-1))),Abs(LLV(L,i1)-Ref(O,-(i1-1)))); APE1:=Max(Abs(H-O),Abs(L-O)); Ratio:=APEn/APE1; Alpha:=Log(Ratio)/Log(i1); Alpha Column F: ROR20 i1:=20; APEn:=Max(Abs(HHV(H,i1)-Ref(O,-(i1-1))),Abs(LLV(L,i1)-Ref(O,-(i1-1)))); ROR:=APEn/i1; ROR Filter (Can be anything. these are some of the values that I tried) colB>colA*2 AND colC>colB*2 AND colD>10 AND colE>0.89 AND colF>0.4
StorkBite  
#3 Posted : Monday, March 27, 2006 2:48:14 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Regarding the Rate of Return Time Frame, Chris Young states, "Although it is interesting to consider the potential returns for a trade, the real interest should be in the return rate for a trade. A trade that returns 5% in five days should be much more interesting tahn a trade that returns 5% in a year. The APE plot can be modified to look at relative return rates... I have taken the APE curves for the three stocks, subtracted 1.5% for commissions and slippage (as an example), and divided the result for each day by the number of days. For example, for the value of the five-day average peak excursion, I subtracted 1.5% and divided the result by five to give the relative return rate for five-day excursions." It sounds deceptively simple, and it may well be very simple, but trying to match anything that resembles Figure 7 on p. 46 eluded me. Sorry, I don't have a way to scan the figure for this thread. I think it would be a pretty easy Excel plot.
Jose  
#4 Posted : Monday, March 27, 2006 10:44:16 PM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
George, have you checked out the annualized % profit indicators in your URSC tool-kit? It sounds to me like the rate of return indicator is possibly a poor cousin to the real McCoy... :wink: jose '-)
StorkBite  
#5 Posted : Monday, March 27, 2006 11:39:43 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
A third cousin once removed? Hmm... I know about them guys... Thanks, I'll look it over!
FormulaPrimer  
#6 Posted : Tuesday, March 28, 2006 7:11:48 PM(UTC)
FormulaPrimer

Rank: Advanced Member

Groups: Registered, Registered Users, Unverified Users
Joined: 8/12/2005(UTC)
Posts: 73

i'm getting a log overflow with the APE alpha. How do I fix this??
StorkBite  
#7 Posted : Tuesday, March 28, 2006 7:24:15 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
I cannot reproduce this. What security are you loading? What are your user input values?
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.