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

Notification

Icon
Error

Options
Go to last post Go to first unread
TrendChange  
#1 Posted : Saturday, April 30, 2005 10:50:43 PM(UTC)
TrendChange

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 4/30/2005(UTC)
Posts: 13

I am looking at buying Meatstock but before I do I would like to know if I would be able to do the following: I want to create an indicator that would take a list of stocks, say the DOW 30 and calculate how many in this list have MACD bullish or bearish crossovers. I want the program to give me a number on a daily basis and plot it on a chart. I would also like to know if I could then build another indicator off the above value. Thanks for your speedy reply! Dave
Patrick  
#2 Posted : Saturday, April 30, 2005 10:54:24 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
It should be possible but only because it is a small list. Why don't you let me create this indicator and test it. Then I will give you a real answer not a supposition ... Patrick :mrgreen:
Patrick  
#3 Posted : Sunday, May 1, 2005 12:17:21 AM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
It's fairly easy to do but I'm affraid it will be slow. Not for real time users .... Could be usefull for an exploratio everynight though ... For others who are interrested to see how this would be possible ... Divide the total amount of securities by groups of ten. Here I want 30 so I will create 3/4 formulas for bullish and 3/4 for bearish. I will just look at bullish. Here names are very important make sure you remember what you name your indicators : {Name:BullishPart1of3} v1:=Security("XOM",C); V2:=Security("WMT",C); V3:=Security("UTX",C); v4:=Security("T",C); V5:=Security("SBC",C); v6:=Security("PG",C); V7:=Security("MSFT",C); V8:=Security("MRK",C); v9:=Security("MO",C); V10:=Security("JPM",C); Cross(Mov(V1,12,E)-Mov(V1,26,E),0)+ Cross(Mov(V2,12,E)-Mov(V2,26,E),0)+ Cross(Mov(V3,12,E)-Mov(V3,26,E),0)+ Cross(Mov(V4,12,E)-Mov(V4,26,E),0)+ Cross(Mov(V5,12,E)-Mov(V5,26,E),0)+ Cross(Mov(V6,12,E)-Mov(V6,26,E),0)+ Cross(Mov(V7,12,E)-Mov(V7,26,E),0)+ Cross(Mov(V8,12,E)-Mov(V8,26,E),0)+ Cross(Mov(V9,12,E)-Mov(V9,26,E),0)+ Cross(Mov(V10,12,E)-Mov(V10,26,E),0) The second in indicator will be the same same thing but with 10 other symbols and so on. In the end I should have 3 indicators : BullishPart1of3 BullishPart2of3 BullishPart3of3 So I will create one last indicator called : NAME : DJ30 MACD Bullish Count Formula : Fml("BullishPart1of3")+Fml("BullishPart2of3")+Fml("BullishPart3of3") If I wanted to use the total value in a indicator I would simply use the function : Fml("DJ30 MACD Bullish Count") Patrick :mrgreen:
wabbit  
#4 Posted : Sunday, May 1, 2005 1:06:12 AM(UTC)
wabbit

Rank: Advanced Member

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

Was thanked: 16 time(s) in 16 post(s)
This is a 'classic' example where the MSFL should be improved to allow Arrays[] and loops: stkArray=new Array["XOM","WMT".....] For Each stk in stkArray If Mov(C,12,E)>Mov(C,26,E) Then counter=+ End If Next stk aaahhh..... we can only dream! :wink: wabbit :D
Patrick  
#5 Posted : Sunday, May 1, 2005 1:18:25 AM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Wanna send me the code and I will compile it for you using the dev kit :D I guess we have a few programmers here, we could create some of these usefull functions, any takers? I'm not a programmer so it can't be me :wink: Patrick
wabbit  
#6 Posted : Sunday, May 1, 2005 1:24:02 AM(UTC)
wabbit

Rank: Advanced Member

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

Was thanked: 16 time(s) in 16 post(s)
Just thinkin' aloud (allowed :) ??)... I haven't tested this, but try reusing the variables, this means that instead of being restricted by the number of variable, the limit will be the length of the code, and the entire function is contained: v1:=Security("XOM",C); V2:=Security("WMT",C); V3:=Security("UTX",C); v4:=Security("T",C); V5:=Security("SBC",C); v6:=Security("PG",C); V7:=Security("MSFT",C); V8:=Security("MRK",C); v9:=Security("MO",C); V0:=Security("JPM",C); Group1:= Cross(Mov(V1,12,E)-Mov(V1,26,E),0)+ Cross(Mov(V2,12,E)-Mov(V2,26,E),0)+ Cross(Mov(V3,12,E)-Mov(V3,26,E),0)+ Cross(Mov(V4,12,E)-Mov(V4,26,E),0)+ Cross(Mov(V5,12,E)-Mov(V5,26,E),0)+ Cross(Mov(V6,12,E)-Mov(V6,26,E),0)+ Cross(Mov(V7,12,E)-Mov(V7,26,E),0)+ Cross(Mov(V8,12,E)-Mov(V8,26,E),0)+ Cross(Mov(V9,12,E)-Mov(V9,26,E),0)+ Cross(Mov(V0,12,E)-Mov(V0,26,E),0); v1:=Security("A",C); V2:=Security("B",C); V3:=Security("C",C); v4:=Security("D",C); V5:=Security("E",C); v6:=Security("F",C); V7:=Security("G",C); V8:=Security("H",C); v9:=Security("I",C); V0:=Security("J",C); Group2:= Cross(Mov(V1,12,E)-Mov(V1,26,E),0)+ Cross(Mov(V2,12,E)-Mov(V2,26,E),0)+ Cross(Mov(V3,12,E)-Mov(V3,26,E),0)+ Cross(Mov(V4,12,E)-Mov(V4,26,E),0)+ Cross(Mov(V5,12,E)-Mov(V5,26,E),0)+ Cross(Mov(V6,12,E)-Mov(V6,26,E),0)+ Cross(Mov(V7,12,E)-Mov(V7,26,E),0)+ Cross(Mov(V8,12,E)-Mov(V8,26,E),0)+ Cross(Mov(V9,12,E)-Mov(V9,26,E),0)+ Cross(Mov(V0,12,E)-Mov(V0,26,E),0); v1:=Security("K",C); V2:=Security("L",C); V3:=Security("M",C); v4:=Security("N",C); V5:=Security("O",C); v6:=Security("P",C); V7:=Security("Q",C); V8:=Security("R",C); v9:=Security("S",C); V0:=Security("T",C); Group3:= Cross(Mov(V1,12,E)-Mov(V1,26,E),0)+ Cross(Mov(V2,12,E)-Mov(V2,26,E),0)+ Cross(Mov(V3,12,E)-Mov(V3,26,E),0)+ Cross(Mov(V4,12,E)-Mov(V4,26,E),0)+ Cross(Mov(V5,12,E)-Mov(V5,26,E),0)+ Cross(Mov(V6,12,E)-Mov(V6,26,E),0)+ Cross(Mov(V7,12,E)-Mov(V7,26,E),0)+ Cross(Mov(V8,12,E)-Mov(V8,26,E),0)+ Cross(Mov(V9,12,E)-Mov(V9,26,E),0)+ Cross(Mov(V0,12,E)-Mov(V0,26,E),0); Group1+Group2+Group3 (You can have 20 variables defined, this code has used 13) To save a few characters, and allow more functions in the same length of code, try replacing Cross(Mov(V7,12,E)-Mov(V7,26,E),0)+ with Cross(Mov(V7,12,E),Mov(V7,26,E))+ its the same thing (someone might prove me wrong here?) and it saves 2 characters each time it is used. You might need this space for other things?? As I said, I havent tested this theory, perhaps someone might like to try it out and post the results here? Hope this helps wabbit :D
wabbit  
#7 Posted : Sunday, May 1, 2005 1:35:20 AM(UTC)
wabbit

Rank: Advanced Member

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

Was thanked: 16 time(s) in 16 post(s)
Patrick, Can you send me some source code of something written for the MSDK? It doesnt have to be too complex, just something showing 'typical' use. I have never seen any of the code and dont know how it 'works'. If you could provide some examples, then maybe I can assist to develop something here? Back to this thread, I think hard coding here might cause some troubles because the index constituents will change over time. I am sure there is a way for the MSDK to read an external file with the index stocks in it, and set this as an array? Then as time goes on, only the external data file need be updated for the new constiuents. The other way to do it, of course, is to loop through each stock in a particular directory, but this makes the assumption the user will have their data correctly sorted on their hard disc? This may not be the case, but then a little education might be able to solve this one? As I said, I can program, but am not sure how MS 'works' Hope this helps wabbit :D
TrendChange  
#8 Posted : Sunday, May 1, 2005 2:25:57 AM(UTC)
TrendChange

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 4/30/2005(UTC)
Posts: 13

Here is another question. Can Metastock be programmed to calculate say the percentage of stocks in a sector that have MACD above the 0 line? This would be for an EOD review. Again I want to calculate a value that is put in a graph form. Thanks for the help folks! I am getting more interested in this product! Dave
wabbit  
#9 Posted : Sunday, May 1, 2005 5:29:17 AM(UTC)
wabbit

Rank: Advanced Member

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

Was thanked: 16 time(s) in 16 post(s)
The short answer is yes..... but as always with computers there are several ways of doing it!! Some are more complicated than others! Hope this helps. wabbit :D
hayseed  
#10 Posted : Sunday, May 1, 2005 6:14:06 AM(UTC)
hayseed

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/7/2005(UTC)
Posts: 1,346

hey trend..... meta uses the term explore instead of the commonly used scan....... it took about 1 minute to explore my technology folder, 1422 securites, for macd()>0.... 18.6% are above 0, btw..... the s&p 500 takes about 10 seconds..... of course macd can be above 0 but be diving like a rock, so if your studying on something along the line of bullish percents, you might want to also know the % above 0 that also have macds above their own moving average...... and yes meta could tell you that in seconds also.....11.4% are ...... MACD()>0 AND MACD()>Mov(MACD(),9,EXPONENTIAL)........h
wabbit  
#11 Posted : Monday, May 2, 2005 12:56:35 PM(UTC)
wabbit

Rank: Advanced Member

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

Was thanked: 16 time(s) in 16 post(s)
Thanks Patrick... I will look through it when I get the chance and get back to you. wabbit :D
TrendChange  
#12 Posted : Saturday, May 7, 2005 9:36:46 PM(UTC)
TrendChange

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 4/30/2005(UTC)
Posts: 13

Hayseed, Sounds great. My final question is can I take that %number that metastock spits out on a daily basis and keep track of the values in a chart? I hope this makes sense. I want to keep a running tab of the values..... Dave
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.