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

Notification

Icon
Error

Options
Go to last post Go to first unread
Larado424  
#1 Posted : Tuesday, January 24, 2012 6:12:34 PM(UTC)
Larado424

Rank: Newbie

Groups: Registered, Registered Users
Joined: 1/24/2012(UTC)
Posts: 2

Hi folks, I'm a newer user of Metastock and not very good with computer code. I'm working on reading the formula primer, but I would really like to get started on doing some explorations. Can anybody help me out with writing a new explorer to find stocks that have "Crossed and Closed" above their 200 Day SMA that day. I hope that makes sense. I'm an end of day trader, so I want my critera to have happened that day. Any help would be great. No to mention, I learn better by seeing. So it would also help me learn the code. I don't know if this would be a long complex code, but I sure hope not. Also, everything I have read in the formula primer keeps referring to indicators. Is the indicator code the same as the explorer code? Thank You, Larado
wabbit  
#2 Posted : Wednesday, January 25, 2012 3:13:21 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)
Keep working through the Primer; take particular note of Formula 28 and/or Formula 38.



wabbit [:D]

henry1224  
#3 Posted : Wednesday, January 25, 2012 5:51:50 AM(UTC)
henry1224

Rank: Advanced Member

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

Was thanked: 2 time(s) in 2 post(s)
Larado, Code is Code!

how you use it is up to you,

Starting with indicators, You can show the indicator as an indicator or plot it as a system with entry and exit signals. As an indicator, you can plot the indicator,a signal line, overbought and oversold levels.
You can then take all of the above and create a system of entry and exit signals and then plot it as an indicator on the chart.
to take it a step further, you can add a variable in the indicator on how to plot it on the chart: 1 as an indicator, or 2: as a system

once plotted on a chart you can change the appearance of the indicator, color of lines, and style of lines.

In explorations, You can have it show the current value of the indicator or you can show the signals of a system. You can add filters to eliminate securities in your search.

In the expert section, which you attach to your chart, you can create commentary,highlights,symbols and alerts that show up on your chart

Again, Code is Code.
How you use it is up to you.

A Chart is a visual representation of an asset in time, What helps you make a decision and how it is displayed is up to you
jjstein  
#4 Posted : Wednesday, January 25, 2012 8:36:21 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)
Hi Larado -- MetaStock has a lot of horsepower, and sometimes it's a bit much for a newbie. You will find it helps to be VERY clear and concise in your thinking, and in making requests here in the Forum.

What you asked for is a BINARY result, Yes or No, which is a 1 or 0 in math terms. Since MetaStock deals in formulas, that's just what you want.

It is a good idea to test a formula idea visually, on a chart, before using an Exploration, so you can SEE that it does exactly what you want.

I'm going to assume you can plot a 200-day simple moving average on a chart, using the standard built-in indicator. What you need to do is create a Custom Indicator, so use TOOLS -- INDICATOR BUILDER, and click the NEW button. Give it a name, like "My Indicator", and add this:
Code:
Cross(CLOSE,mov(Close,200,Simple));


Close the dialogs. Look at the drop-down Indicator list, on the menu bar -- "My Indicator" should be there.

Click & drag it into the Chart, or all the way down to the X-Axis, if you want it in a sub-window.

There's your "visual". If it does what you want, fine; otherwise, fix it.

Now, to run an Exploration, you now have two choices to make:

1. Copy the code or "call" the indicator you just made. "Call" (using the FML function) has the advantage that any changes you make later to the original will be reflected in the Exploration. If you just copy the formula, then you will have to re-copy to the Exploration.

A "call", using the FML() function looks like this:
Code:
FML("My Indicator");




2. Do you want to "see" the value of the indicator in the Exploration Report? If you just want results, put the code or call in the FILTER tab. If you want to "see" the value, you must ALSO put it in one of the COLUMN tabs. You again have two choices:

Put code or FML in the first tab, "Column A". Then, you can either do the same in the FILTER tab, or use the shortcut, "ColA". You could say ColA=1, but since MetaStock views "1" as TRUE and "0" as FALSE, using the "=1" is redundant.


Hope that helps,

Larado424  
#5 Posted : Wednesday, January 25, 2012 5:47:45 PM(UTC)
Larado424

Rank: Newbie

Groups: Registered, Registered Users
Joined: 1/24/2012(UTC)
Posts: 2

I just wanted to say thank you to the folks that replied to my post about making an explorer to search for stocks that have crossed the 200 day SMA. The help is greatly appreciated. I look forward to spending more time in this area to learn all I can. Thanks again. Larado424
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.