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

Notification

Icon
Error

Options
Go to last post Go to first unread
henry1224  
#1 Posted : Tuesday, April 5, 2005 12:51:58 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 1 time(s) in 1 post(s)
Here is a formula that ranks stocks like the Ulcer Index Per1:= 200; Range:=ATR(1); A:=((10000/C)* (Mov(Range,Per1,S))/100); The higher the number, the better the buy signal, the lower the number, the better the sell signal
wabbit  
#2 Posted : Tuesday, April 5, 2005 1:16:24 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,106
Location: Perth, Western Australia

Was thanked: 12 time(s) in 12 post(s)
But each stock has a different value, dependent on its closing price. To be able to compare different stocks, the data needs to be normalised.... Every stock will then have a range 0-100 (inclusive). Buy and Sell levels can then be programatically / arbitrarily set. Per1:= 200; Range:=ATR(1); {removed redundant '000s from the Henry1224 formula} x:=Mov(Range,Per1,S)/C; y:=x-LastValue(Lowest(x)); normalisedData:=100*y/LastValue(Highest(y)); normalisedData; CAUTION: As with all normalised data, it changes with hindsight because of the use of the LastValue() function. Hope this helps. wabbit
henry1224  
#3 Posted : Wednesday, April 6, 2005 12:39:59 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 1 time(s) in 1 post(s)
Wabbit nice to see that you're posting here. I tried your formula and it plots just like mine, except that the scale is from 1-100, but if you merge or overlay it on top of mine it mirrors it exactlly. Also both the Ulcer Index and ADR aka bang for the buck should be used only to rank the securities that fire off a buy or sell signal Henry
wabbit  
#4 Posted : Wednesday, April 6, 2005 1:26:40 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,106
Location: Perth, Western Australia

Was thanked: 12 time(s) in 12 post(s)
Henry, First: If my code is correct the values should be between 0-100 (inclusive). If not then something is wrong! Try, with some more modifications, the following code for the indicator. Secondly: I am curious to find out how you use this indicator? You cannot just set a 'threshold level' at which to trigger buys and sells. As the stock price rises over time, the value of the indicator gets smaller (numerator/CLOSE) and vice versa for when the stock price gets progressively lower, the indicator gets larger. The only real way I see to use this indicator is to track it over time and see how it is 'performing' against "recent" history, either through the use of moving average bands or standard error bands. A buy signal could be generated when the indicator breaks through the top of the band, and sell if breaks down through the bottom of the band. The length and width of the bands may need some careful consideration. If you could shed some light, I would be interested. --8<--------------------------------------- {Modified Ulcer Index, with channels} {Original code from Henry1224} {Modified by wabbit 06 April 2005} pds1:= Input("Ulcer ATR Periods",1,100,10); pds2:= Input("Ulcer MA periods",1,2550,200); {removed redundant '000s from the Henry1224 formula} a:=Mov(ATR(pds1),pds2,S)/C; b:=a-LastValue(Lowest(a)); x:=100*b/LastValue(Highest(b)); pds3:=Input("Channel MA periods:",1,2560,100); ma:=Input("Channel MA type: 1-EMA 2-SMA",1,2,2); ma:=If(ma=1,Mov(x,pds3,E),Mov(x,pds3,S)); lookback:=Input("Channel SD lookback: 0-All History, User",0,252,0); pds4:=LastValue(If(lookback=0,1,lookback)); SD:=If(lookback=0,Sqrt(Cum(Power(x-ma,2))/Cum(1)),Sqrt(Sum(Power(x-ma,2),pds4)/pds4)); UL2:=If(ma+(2*SD)>100,100,ma+(2*SD)); LL2:=If(ma-(2*SD)<=0,0,ma-(2*SD)); UL3:=If(ma+(3*SD)>100,100,ma+(3*SD)); LL3:=If(ma-(3*SD)<=0,0,ma-(3*SD)); {Plot indicators} x; LastValue(Highest(x)); LastValue(Lowest(x)); ma; UL2;LL2; UL3;LL3; --8<--------------------------------------- Hope this helps wabbit :D
henry1224  
#5 Posted : Wednesday, April 6, 2005 1:37:44 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 1 time(s) in 1 post(s)
Wabbit, When I run an exploration, Say I get 4 assets tp pick from for a long Signal, The one asset with the highest ADR value for Bang for a Buck and the one with the lowest Ulcer Index would be the safest Choice Reverse the criteria for a sell signal The asset with the lowest ADR and The Highest Ulcer Index would be a safer choice for the sell signal
Users browsing this topic
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.