[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Metastockusers] Writing code for "the first time an event happens"



PureBytes Links

Trading Reference Links

Thank you, the list of important functions is very helpful. I'll go over it 
carefully. Meanwhile, I could be mistaken, but I don't think that the ALERT 
function is the one I need.

My understanding is that ALERT would tell me that EventA took place during 
the lookback period. Example:
ALERT(EventA, 5) --> sometime during/within the last 5 periods EventA did 
in fact take place.

This stuff can be tricky. It's never as clear to the other guy as it is to 
oneself. So let me try to clarify. I'm trying to write this:

Sometime in the past condition1 began (say, the EMA(55) started to decline).

Condition1 continues to be true on the current bar. EMA(55) is still 
declining today.

During the period where condition1 has been true -- in others words from 
the first bar where the EMA(55) started to decline -- to the bar 
immediately preceeding the present bar, EventA did not take place. Today, 
however, while condition1 continues to be true, while the EMA(55) continues 
to decline, EventA HAS finally taken place. So this is the first time, the 
first bar, since the bar on which the EMA(55) began to decline that EventA 
has occurred. Ever since EMA(55) has been declining (from the first bar on) 
EventA  (say, cross(EMA(8), EMA(13)) has not taken place -- UNTIL TODAY, 
that is, until the present bar. And today (cross(EMA(8), EMA(13).

Since everybody loves a bull market, let me use a further example. For 
stock XYZ the EMA(55) began to rise in the first week of June, 2003. It's 
still rising on December 3, 2003 (that's some run, huh?). But I'm not 
interested any more in identifying occurrences of EventA at this stage of 
XYZ's stellar performance. I see now, with 20-20 hindsight, that the time 
to identify EventA would have been the very first time it occurred after 
the EMA(55) had begun to rise. Perhaps that was sometime in early July, or 
sometime in August. It doesn't matter. Just so long as it's the first time 
EventA occurred since XYZ starting moving up according to whatever trend 
definition I'm using, in this case that's a rising EMA(55).

So tonight, based on my experience with XYZ, I'm going to sit down and 
explore for stocks/futures where EventA has taken place today for the first 
time since my trend definition began to be true -- which could have been 
the day after Labor Day, or Halloween or Thanskgiving.

There, have I succeeded in confusing matters beyond repair?  :-)

Again, your list of functions brings me a step further. I'd never boiled it 
down that way, and there a couple of functions I definitely need to look into.

Thanks,
Philip


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/zMEolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
Metastockusers-unsubscribe@xxxxxxxxxxx

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/