[MAS-announce] Re: New Question
Brought to you by:
jcochrane
From: Jim C. <jt...@di...> - 2003-02-25 21:58:56
|
> If I want mas to give me a list of stock that crossed a buy or sell trigger > yesterday, and only list the one from yesterday. How do I do that? > > I tried setting the analysis date to yesterday, and run. I got nothing. > > I tried setting it for 1 week, I got an email with listed triggers that > happened yesterday, plus triggers that happened earlier in the week. Hi Stephen. [Note: I'm CCing this reply to the mas discussion list, since I believe it's relevant for other MAS users, too.] MAS does something that may come close enough to what you want to be acceptable, with a couple caveats that I'll mention later. When mas performs a market analysis, it saves all triggered events in a history file so that the next time it runs, those same events will not be re-reported - only new events will be reported. (So the first time you run it you will get some events that go back several days, depending on the start-date you set; but on subsequent runs, you will not get many "stale" events.) The first caveat is that sometimes a signal will seemingly reappear again the next day. The reason for this is that sometimes the current day's data will affect the mathematics such that an anomaly occurs where yesterday's signal is no longer a signal - the signal now occurs "today". I believe this phenomenon appears in many trading systems. (And the ones where it doesn't are probably modified to eliminate it; I'm not sure if that is a wise decision, though.) The second caveat is that there is a bug in the current version (which I have not yet released) where each day's analysis overwrites the history file from the previous day. This bug, of course, removes the feature of not producing duplicate signals. This is on my list of important bugs to fix. I think the 1.6.5 version you are using does not have this bug, but I have not yet had a chance to verify this. If you find that it does have the bug, I'd appreciate it if you would let me know. (The easiest way to tell is by looking at the history file: If before a run it has records for the previous day's signals in it and after the run it only has today's signals, then the bug is present in your version. The history file is that ...history* file we were discussing in a previous email of yours.) I have my system configured to run mas every day, telling mas to process the last 3 or 4 days of data. The result is (when using a version where the above-described bug is not present) that most signals are for the last 2 days - today and yesterday, with a small number for a day or two before (due to the anomaly described above). I find that a signal for the day before is often useful because it will often point out a tradable that has not yet moved - that is, the potential trade may still be available. (I've recently had the idea, though not the time/energy to try it out, of including intraday data processing for the signal generation. My thinking is that if a stock is in a long-term trend (according to the criteria I've set up in mas), the short-term criteria (that it's oversold - for an uptrend) will sometimes be too late when EOD data is used - for example, I often receive signals that are too late by one day - the stock has already moved too much to get in on. But if the analysis is done a few times during the day, rather than at the end of the day, the chances are a lot greater for the signal to be generated in time for a trader to act on it. This scheme is, of course, for those who can trade during the day; it wouldn't work for those who are not able to place trades until evening.) [Tip: If you have some intellectual stamina, Jack Hershey's posts on misc.invest.futures and misc.invest.technical are often full of somewhat cryptic, but very useful, if you can decipher it, information about powerful trading techniques. You might want to use google.com to check out some of his past posts.] > > Once I get this figured out, I would like run a cron job so when I get up > every morning there is an email in my box with buy and sell recommendations. > > How would I do that? I can give you some pointers. First, if you don't already, you should read up a bit on cron and how to set up a crontab file. Then you'll need to write a script or two to drive mas to do what you want. (Adding the ability in mas itself to do such scheduled processing is on things I've been considering, but this is not a trivial feature to add.) You can take a look at the following scripts in the scripts*.tar.gz file for an example of how to drive mas: run_market_analysis analyze_watch_lists analyze_stocks Here is the cron entry I use to run mas every day: 50 17 * * 1-5 ~/bin/run_market_analysis If you need more guidance, I may be able to help; but I can't devote a lot of time to it - at least not without charging a fee :-) Good luck - Jim |