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

RE: An Easy Solution to BarsSinceEntry, EntryPrice, PREV, etc.



PureBytes Links

Trading Reference Links

Joel,

You are correct.  A .dll cannot access any Metastock function.

I'm suggesting that those functions (Cum(), Mov(), BarsSince()...) all
be used in the Metatock formula language to calculate a value.  That
value would be passed to the .dll.  So from the .dll's point of view,
it receives only numbers.

For example, -1 and 50.35 would be the result of a Signal and
ValueWhen() function--calculated in Metastock--passed to the .dll.
Passing values occurs all the time with things like Mov(Close, 5, E),
where you've passed three values for processing to the Moving Average
function--two text and one constant.

So, the .dll gets two constants in this case, -1 and 50.35.  If it
hasn't received either a +1 or -1 since it last got a 0 for an exit,
it will store the value 50.35.  Now for every subsequent bar on the
chart it returns 50.35 until it gets sent a zero for an exit symbol,
at which point it returns a zero.

Following my Mov(Close, 5, E) example, you've passed the Moving
Average function three values, and it returns some number, calculated
for each bar--presumably that number is the exponential 5 bar moving
average of the close.  This .dll would operate in the same way,
although even more simply because all it's doing is repeating what
you've told it to repeat, until you tell it to stop.  Almost like a
game of "Simon says."

================
Dave Nadeau
Fort Collins, CO

> -----Original Message-----
> From: owner-metastock@xxxxxxxxxxxxx
> [mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of Joel Reymont
> Sent: Sunday, September 02, 2001 10:21 PM
> To: metastock@xxxxxxxxxxxxx; Metastock
> Subject: Re: An Easy Solution to BarsSinceEntry,
> EntryPrice, PREV, etc.
>
>
> I was under the impression that you could not have
> access to internal MS functions from external DLLs.
> That is you would need to reimplement all functions
> like Cum(), Mov(), etc. Am I wrong?
>
>     Joel
>
> ----- Original Message -----
> From: "Dave Nadeau" <dave_nadeau@xxxxxxxxx>
>
>
> > Through the Metastock Formula Language, there are functions which
> > could provide the information to a .dll that would hold
> any value from
> > the start of a trade:  Cum(1), ValueWhen(),BarsSince(),
> to name a few.
>
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com