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

Notification

Icon
Error

Options
Go to last post Go to first unread
AnarchyJim  
#1 Posted : Wednesday, November 23, 2005 5:04:44 PM(UTC)
AnarchyJim

Rank: Newbie

Groups: Registered, Registered Users
Joined: 11/23/2005(UTC)
Posts: 4

Is there a guide online for writing forumulas for the Explorer? I'm new to Metastock and the help section on programming is, uh, not exactly robust. I'm familiar with Javascript, Visual Basic, and C/C++ so programming isn't a problem, but I do need some sort of good reference guide. For example, how does one compare prices between two days? If I'm looking for stocks that have had a price jump of 5% and have a negative MACD delta what's the syntax? In another program I use you'd write it as: HIGH > (Close1 *1.05) and MACD_D < 0 (Close1 being the close of the prior day, Close2 the close two days before, etc.) Anyways... any help would be appreciated or just point me in the direction of a reference guide. thanks! Jim
StorkBite  
#2 Posted : Wednesday, November 23, 2005 5:12:57 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Quote:
just point me in the direction of a reference guide
http://forum.equis.com/drm_main.php?mode=drm_file_view&cat=10&file=1
AnarchyJim  
#3 Posted : Wednesday, November 23, 2005 10:02:02 PM(UTC)
AnarchyJim

Rank: Newbie

Groups: Registered, Registered Users
Joined: 11/23/2005(UTC)
Posts: 4

In the Explorer, is there a way to scan several months worth of data? Right now I can only get it to scan the last day. Is there an easy way to specify the dates to search? Or if not, is it possible to use a For loop or something to scan backwards in time? thanks... Jim
DOC  
#4 Posted : Wednesday, November 23, 2005 10:30:23 PM(UTC)
DOC

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/9/2004(UTC)
Posts: 107
Location: Salt Lake City, UT

Jim This depends on what you are trying to accomplish. Could you give me a little more detail about what you are trying to do. If you edit an Exploration and select options you can specify a date to run the exploration on, but this may not be really what you want to do. Regards Doc
AnarchyJim  
#5 Posted : Wednesday, November 23, 2005 10:49:59 PM(UTC)
AnarchyJim

Rank: Newbie

Groups: Registered, Registered Users
Joined: 11/23/2005(UTC)
Posts: 4

I'm essentially trying to backtest a theory on the entire market. On any given day it may generate 6 or so signals scanning all stocks. I can't use System Tester because they aren't buy/sell signals. They're more like buy/sell possibilities that need to be graphed and examined. The problem I'm running into is that most scanners are designed to scan the most recent day. They aren't designed to scan a range of days. I can get explorer to do what I want by manually setting the date (e.g. Ref(L, -45) ), but I have to do this for each date which is tedious. Ideally I could set the date range or script a For loop. (e.g. For x = -45 to -1) Any help would be appreciated... thanks, Jim
mstt  
#6 Posted : Wednesday, November 23, 2005 10:52:13 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)
Jim Each exploration has an option to set the date. The default is probably "Most Recent Date", but it can be changed to "Specific Date". An explorationt can scan us much data as you want it to by changing the "Explorer Options" from "Load Minimum Records" to "Load [censored]X Records". However, each column can only report 1 value, and typically that will be the column value as at the last bar scanned. Don't confuse Options for the Explorer tool overall for the Options available for each individual exploration Think of each exploration column as a non-visual indicator where the reported value is the value (of that indicator) for the last bar of scanned data. Values from any previous bar or event can be captured as long as certain rules are followed. 1) The event must be properly defined, and 2) the exploration must scan sufficient bars to include said event. ValueWhen(1,"event","required value or data array") will show the value of your signa when the defined event took place. The ValueWhen() function "remembers" the value and reports that value on the last bar scanned. It's also possible to accumulate a series of values and report a total as at the last scanned bar. For example I have some "Trade Equity" explorations that summarize a trading systems perofmance across several years of data and thousands of securities. The Explorer is a very powerful tool and it can do much more than is at first apparent. However there are a number of tricks to getting the most from it. Roy MetaStock Tips & Tools
AnarchyJim  
#7 Posted : Wednesday, November 23, 2005 11:26:10 PM(UTC)
AnarchyJim

Rank: Newbie

Groups: Registered, Registered Users
Joined: 11/23/2005(UTC)
Posts: 4

>>Don't confuse Options for the Explorer tool overall for the Options available for each individual exploration Ah. Thanks, I hadn't noticed the Option button for the individual Exploration. That makes things a bit easier. However, I'm still not clear on how to scan a range of dates for a signal and have them all show up in the Report. I can now have it produce signals for Oct. 10th, but not Oct. 10th through Nov. 10th. It would be nice if it could go through that date range day-by-day and report back a list of each stock that generated a signal on each day. thanks in advance... Jim
mstt  
#8 Posted : Thursday, November 24, 2005 12:33:22 AM(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)
Jim The problem is that an exploration can only report one value per column. It's a time-slice if you like. It can take a sample of whatever you want on any given bar, but it can only report one value per column. It's up to you to think of ways to extract what you want given the "one value per column" restriction. If you want to catalog up to six events then the best you can probably do is use one column each for the 1st, 2nd, 3rd, 4th, 5th and 6th events. I've set up the following exploration to report the "PS Fractal Entry" in reverse order. That is, the date for the most recent event appears on column F, the second most recent event in Column E and so on. If column F doesn't report the event then no other column will either and that security is filtered out. The exploration will run a little faster if you define the event in each column rather than call it as an indicator. You MUST define the event as a leading edge so that it's only true for one bar rather than several bars. If you don't then you'll essentially be capturing the same event several times (on successive bars while the event remains true). MetaStock can only sum up to about 6 digits (preferably whole numbers) before it introduces "single digit precision" errors. Thus, adding Day, Month and Year to give 8 accurate digits is rather tricky. Errors may still occur with the method I've used but they should be few and far between. I ran this exploration on 500 bars of the ASX 300 and it appears to work OK. There are other ways that you can capture the timing of events but each method has it's limitations. Col A: Event:=Fml("PS Fractal Entry"); ValueWhen(6,Event,Month()*100) + ValueWhen(6,Event,DayOfMonth()) + ValueWhen(6,Event,If(Year()=2005,.05,.04)); Col B: Event:=Fml("PS Fractal Entry"); ValueWhen(5,Event,Month()*100) + ValueWhen(5,Event,DayOfMonth()) + ValueWhen(5,Event,If(Year()=2005,.05,.04)); Col C: Event:=Fml("PS Fractal Entry"); ValueWhen(4,Event,Month()*100) + ValueWhen(4,Event,DayOfMonth()) + ValueWhen(4,Event,If(Year()=2005,.05,.04)); Col D: Event:=Fml("PS Fractal Entry"); ValueWhen(3,Event,Month()*100) + ValueWhen(3,Event,DayOfMonth()) + ValueWhen(3,Event,If(Year()=2005,.05,.04)); Col E: Event:=Fml("PS Fractal Entry"); ValueWhen(2,Event,Month()*100) + ValueWhen(2,Event,DayOfMonth()) + ValueWhen(2,Event,If(Year()=2005,.05,.04)); Col F: Event:=Fml("PS Fractal Entry"); ValueWhen(1,Event,Month()*100) + ValueWhen(1,Event,DayOfMonth()) + ValueWhen(1,Event,If(Year()=2005,.05,.04)); Filter colF>0 Filter enabled Yes Periodicity Daily Records required 500 Hope this helps Roy MetaStock Tips & Tools
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.