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

Notification

Icon
Error

Options
Go to last post Go to first unread
iwells  
#1 Posted : Sunday, October 31, 2004 1:02:00 AM(UTC)
iwells

Rank: Newbie

Groups ready for retrieval: Registered, Registered Users
Joined: 10/31/2004(UTC)
Posts: 6

I want to use a signal on the DJ30 index to setup a trade in a different security. I can't figure out how to code this in my system to test. Can anyone help me with the correct coding? An example would be that I want to initiate a long position in the SPY when the DJ30 hits the top of a bollinger band. Thanks.
Patrick  
#2 Posted : Monday, November 1, 2004 3:33:22 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 really depends on what version of MetaStock you have. If you own any version of MetaStock Profesional or MetaStock 9.0 You simply have to use the security function. Let's make an indicator as an example. I would create a Variable called V1 that will represent the price of the DOW JONES INDUSTRIAL ( Sorry I forgot what the Dow 30 symbol is :oops: ) I would Write : V1:=Security("SYMBOL", Price Array); or for this example V1:=Security(".DJI",Close); Then I can use the Variable V1 to calculate my Dow Jones Index Bollinger bands Value. The function for bollinger band top is : BBandTop(Data Array, Periods, E S T TRI VAR W, Deviations) The function for bollinger band Bottom is : BBandBot(Data Array, Periods, E S T TRI VAR W, Deviations) So I would Write : V1:=Security(".DJI",Close); BollingerTop:=BBandTop(V1, 20, E , 2) ; Then My condition is the price of the index crosses above the Top Bollinger band My final code would be : V1:=Security(".DJI",Close); BollingerTop:=BBandTop(V1, 20, E , 2) ; Cross(V1,BollingerTop) That's it, now apply this indicator on any chart you want. I know this might be confusing so do not hesitate to ask any questions you might have. Hope this helps :D
Patrick  
#3 Posted : Monday, November 1, 2004 4:30:06 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)
Sorry I had to move this thread to the Forumla Area
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.