[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









 

I’m probably only a few steps ahead
on the learning curve, but I’m pretty sure you need to use the ALERT
function.

What helped me learn a lot was the publication
called “Formula Primer” – it’s free through EQUIS.com

Once you understand what functions are at
your disposal, writing code becomes a lot easier.

 

It’s a good feeling to help out
someone after being a newbie myself. And I will continue to help within my
capabilities.

[I thank guys like Henry and Roy for the
hand-holding along the way]

 

Here’s my short list of functions
you should know about:

Absolute Value

Alert

BarsSince

Cross

Cumulate

DayofMonth

DayofWeek

Formula Call

Formula Variable Call

Highest Bars Ago

Highest High Value

Highest High Value Bars Ago

Highest Since

Highest Since Bars Ago

If

Input

Lowest Bars Ago

Lowest Low Value

Lowest Low Bars Ago

Lowest Since

Lowest Since Bars Ago

Maximum

Minimum

Month

Reference

Security Data

 

<span
>-----Original Message-----
From: Philip
[mailto:pschmi02@xxxxxxxxxxx] 
Sent: Wednesday, December 03, 2003
11:34 AM
To: Metastockusers@xxxxxxxxxxxxxxx
Subject: [Metastockusers] Writing
code for "the first time an event happens"

<span
> 

<span
>Greetings All,<font size=2
face="Courier New">

My coding ability is still elementary and the
following idea has me 
stumped. Could you show me how to write it?

"While condition1 continues to be true today,
today represents the first 
time that Event A has occurred since condition1
began to obtain." More 
specifically, I'd like to identify the first time
certain events occur 
during a trend.

Example 1: TRENDUP (any definition of trend)
obtains today, and today is 
the first time that there have been three
consecutively lower closes (Event 
A) *since* TRENDUP has been true.

Example 2: the EMA(55) is falling, and today is
the first time that the 
EMA(8) has risen above the EMA(13) (Event A) since
the EMA(55) began to fall.

Within a relatively modest framework I'm OK with
most of the variations on 
the theme of Event A, but it's the *since* part
that I can't put together.

Philip





<font size=2
face="Courier New">To unsubscribe from this
group, send an email to:<span
>
Metastockusers-unsubscribe@xxxxxxxxxxx



Your use of
Yahoo! Groups is subject to the Yahoo!
Terms of Service. 










Yahoo! Groups Sponsor


  ADVERTISEMENT 









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





Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.