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 : Monday, August 29, 2011 10:50:51 PM(UTC)
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 : Wednesday, August 31, 2011 9:25:37 AM(UTC)
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 : Wednesday, August 31, 2011 2:30:05 PM(UTC)
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 : Thursday, September 1, 2011 1:39:35 AM(UTC)
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 4/15/2024 2:12:07 AM(UTC)
Attention: Delays Processing New Orders and Changes to Accounts (Product Alerts)
by MS Support 8/13/2022 1:50:39 AM(UTC)
!! URGENT - Delay Processing MetaStock XENITH, MetaStock RT, and MetaStock DC Entitlements (Product Alerts)
by MS Support 11/16/2021 11:37:02 PM(UTC)
May 2018: RocketRSI – A Solid Propellant For Your Rocket Science Trading (2018)
by MS Support 11/5/2019 5:39:29 PM(UTC)
Where is the Manual for the Red Rock Pattern Strategies Add-on Installed? (MetaStock Add-Ons)
by MS Support 5/22/2017 8:56:22 PM(UTC)
What versions of MetaStock will the Red Rock Pattern Strategies Add-on work with? (MetaStock Add-Ons)
by MS Support 5/22/2017 8:55:04 PM(UTC)
What is installed with the Red Rock Pattern Strategies Add-on? (MetaStock Add-Ons)
by MS Support 5/22/2017 8:53:21 PM(UTC)
How much data is needed to run the Red Rock Pattern Strategies exploration? (MetaStock Add-Ons)
by MS Support 5/22/2017 8:51:22 PM(UTC)
JH Kitchens Rochdale (Formula Assistance)
by selenajabris 2/16/2017 4:10:57 PM(UTC)
C-h-e-a-p K-i-t-c-h-e-n-s For Sale Rochdale (Data Related Questions)
by freewowo 1/23/2017 2:54:44 PM(UTC)
ChEaP K-i-T-c-H-e-N-s UnItS FoR SaLe In Rochdale Area UK (MetaStock)
by yohoikaji 11/21/2016 2:55:59 PM(UTC)
Wood Rocking Horse Derby UK (Formula Assistance)
by croscuy 4/6/2016 2:50:00 AM(UTC)
Rocking Horse Leicester UK (Forum Feedback)
by croscuy 4/6/2016 2:48:45 AM(UTC)
Cheap Solid Wood Beds For Sale Rochford UK (Forum Feedback)
by semarcuy 3/18/2016 3:42:20 AM(UTC)
ROC % for back months (Formula Assistance)
by julianc 11/11/2015 1:28:27 AM(UTC)
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.