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

Notification

Icon
Error

Options
Go to last post Go to first unread
smator  
#1 Posted : 14 years ago
smator

Rank: Newbie

Groups: Registered, Registered Users
Joined: 8/30/2011(UTC)
Posts: 2

Hi

I'm new to using metastock. I'm wanting to create a search in the explorer to identify stocks which are increasing at a greater rate then the overal index in an uptrend and decreasing at a greater rate than the overal index in a downtrend. I was planning on manually identifying whether the trend is up or down and then using the explorer to do the rest.

I was thinking of using the ROC, but I am unsure how to get the actual numerical rate of change of the index needed to compare against the stocks. Can anyone help me or point me in the right direction in how to go about this? Or if there is a better way to achieve what I'm wanting?

Many thanks!
jjstein  
#2 Posted : 14 years ago
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
It sounds like you want "Beta". You can use the SECURITY() function:

ind:=Security("\MetaStock Data\INDEX\.SPX",C);
Period:=Input("Period",1,500,21);
Lookback:=Input("Lookback",1,500,1);
(
(Period*Sum(ROC(CLOSE,Lookback,%)*ROC(IND,Lookback,%),Period))-
(Sum(ROC(CLOSE,Lookback,%),Period)*Sum(ROC(IND,Lookback,%),Period))
)
/
(
(Period*Sum(Pwr(ROC(IND,Lookback,%),2),Period))-
Pwr(Sum(ROC(IND,Lookback,%),Period),2)
)


mstt  
#3 Posted : 14 years ago
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Hi smator As Johnathan has said it seems that Beta may be what you're looking for. Look for the Beta indicator in the Indicator dropdown list. To use the basic code with an exploration you should be able to modify my variation of that indicator and use it for several indices in one exploration (if that's useful). {Beta Updated} {Roy Larsen, 2009} {User settings} N:=Input("Beta Updated, periods",1,100,21); X:=Input("Index, 1=DJIA 2=US$ 3=FTSI 4=HS 5=SPX",1,5,1); {Referenced index options} S1:=Security("C:\Equis\Stocks\World Indices\$DJ",C); {DJIA} S2:=Security("C:\Equis\Stocks\World Indices\$DX",C); {US Dollar} S3:=Security("C:\Equis\Stocks\World Indices\$FT",C); {FTSI 100} S4:=Security("C:\Equis\Stocks\World Indices\$HS",C); {Hang Seng} S5:=Security("C:\Equis\Stocks\World Indices\$SP",C); {S&P 500} I:=If(X=1,S1,If(X=2,S2,If(X=3,S3,If(X=4,S4,S5)))); {Beta} P1:=N*Sum(ROC(C,1,%)*ROC(I,1,%),N); P2:=Sum(ROC(C,1,%),N)*Sum(ROC(I,1,%),N); P3:=N*Sum(Pwr(ROC(I,1,%),2),N)- Pwr(Sum(ROC(I,1,%),N),2); (P1-P2)/(P3+(P3=0)); You would need to modify the data pathnames and securities for S1 to S5 variables to match the location of the appropriate indices (the existing pathnames work for me but wouldn't work for you). For a basic exploration you could then use.. {Column A} Fml("Beta Update") It's an easy matter to sort exploration column results - simply click on the column header, and click again to reverse the order. To include more than one index in your exploaration make a copy of the indicator, change the default settings so that it points to the required index and then set up the next column as below. {Column B} Fml("Beta Update(2)") Unfortunately I cannot anticipate all of the areas where you might get into trouble with this procedure, but that's the way it is with most new users. See how you go and get back to us when you get stuck. Roy
smator  
#4 Posted : 14 years ago
smator

Rank: Newbie

Groups: Registered, Registered Users
Joined: 8/30/2011(UTC)
Posts: 2

Thank you both for your very quick responses! They are both very helpful and should accomplish what I want to achieve. I'll go and try them out and let you know when I get stuck. Thanks again.


Users browsing this topic
Guest (Hidden)
Similar Topics
Correlation formula (or process) ? (Formula Assistance)
by TomHam 12 months ago
Attention: Delays Processing New Orders and Changes to Accounts (Product Alerts)
by MS Support 3 years ago
!! URGENT - Delay Processing MetaStock XENITH, MetaStock RT, and MetaStock DC Entitlements (Product Alerts)
by MS Support 3 years ago
May 2018: RocketRSI – A Solid Propellant For Your Rocket Science Trading (2018)
by MS Support 5 years ago
Where is the Manual for the Red Rock Pattern Strategies Add-on Installed? (MetaStock Add-Ons)
by MS Support 8 years ago
What versions of MetaStock will the Red Rock Pattern Strategies Add-on work with? (MetaStock Add-Ons)
by MS Support 8 years ago
What is installed with the Red Rock Pattern Strategies Add-on? (MetaStock Add-Ons)
by MS Support 8 years ago
How much data is needed to run the Red Rock Pattern Strategies exploration? (MetaStock Add-Ons)
by MS Support 8 years ago
JH Kitchens Rochdale (Formula Assistance)
by selenajabris 8 years ago
C-h-e-a-p K-i-t-c-h-e-n-s For Sale Rochdale (Data Related Questions)
by freewowo 8 years ago
ChEaP K-i-T-c-H-e-N-s UnItS FoR SaLe In Rochdale Area UK (MetaStock)
by yohoikaji 8 years ago
Wood Rocking Horse Derby UK (Formula Assistance)
by croscuy 9 years ago
Rocking Horse Leicester UK (Forum Feedback)
by croscuy 9 years ago
Cheap Solid Wood Beds For Sale Rochford UK (Forum Feedback)
by semarcuy 9 years ago
ROC % for back months (Formula Assistance)
by julianc 9 years ago
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.

information You have 1 unread message(s) in your Inbox.