PureBytes Links
Trading Reference Links
|
Jose, thank you very much for your response.
Two physicists go to a parimutual horse track to apply their
considerable skills towards wagering (presumably winning) on the
ponies. As the two physicists walk towards the ticketing booth one
says to the other, "O.K. Here's what we will do ... first we assume
the horses are spheres...".
Clearly, your construction {Sum(C/Cum(1),11)} satisfies (and solves)
the arithmetical situation I proposed. I admit I "foisted myself on
my own petard" by erring on the side of simplicity for the sake of
clarity (for me). Let me be more direct - I am trying to devise some
sort of analogue of a "For" loop(or similar) within the constraints
of the Metastock Formula Language. I did not want to simply ask how
one might "easily" implement a "For Loop", because obviously, that is
(in general) an amusing proposition. However, "For loops", in some
special circumstances, can be created via "recursion" without the use
of some "index counter" that is incremented. Metastock
has "recursive" possibilities via the PREV construct.
The more I think about it (and I appreciate the opportunity to "think
out loud") what I seem to be struggling with is the problem of
creating an analogue to:
For j:= 1 to k
For i:= j to n-k
"do stuff with price(i+j)"
***using ONLY recursion to generate i & j***
[where 'n' prices (O,H,L,C) are loaded in a 'chart']. I suspect
(actually I know) that implementing generalized 'For Loops' via
recursion IS possible (and simple) in languages like LISP and
SmallTalk but the "Metastock Formula Language" presents interesting
mysteries (for me at least). HEY! Here's a thought ... why not
REPLACE the Metastock Formula Language with a Lisp-like methodology
in a future release - say Metastock 17.0? That would be an
interesting, nay, fascinating project. (But I digress...)
Anyway, if you can demonstrate a "recursive" version of the
nested "for loops" above I'll offer (gratis) some "formulas" that do
parabolic and higher order regressions to "replace" the linear stuff
in Metastock. I freely admit my gratis offer is the very easy part.
How would (can one?) one generate (in MSFL) the sequence (Fibonacci)
1,1,2,3,5,8,13,...,Fn to use as "weights" for a moving weighted
average (where n is user selectable)? HMMMMM?
I think I will beam back to planet DLL so my dog can take me for a
walk.
Best Regards and Thanks,
Bosco
--- In equismetastock@xxxxxxxxxxxxxxx, "Jose" <josesilva22@xxxx>
wrote:
>
> You could start with something simple such as:
> Sum(C/Cum(1),11)
>
>
> jose '-)
> http://www.metastocktools.com
>
>
>
> --- In equismetastock@xxxxxxxxxxxxxxx, "Bosco Santini"
<rr4ever@xxxx>
> wrote:
> >
> >
> > I've been banging my brain-pan on this for weeks and have decided
I
> > must write a DLL to acomplish the task. I suspect that I am
missing
> > (as usual) one tiny piece of information. Suppose I load a chart
> > with 133 days of prices. (The numbers are arbitrary and chosen
only
> > to fix the idea.) I want to generate a sequence of consecutive
> > integers, say, 1,2,3,...,11 and use them in some arithmetic on,
say,
> > the closing prices. As a purely illustrative example - let C1 be
the
> > first or earliest Close, C2 be the next, C3 next, etc. I want to
> > calculate, for example: C1/1+C2/2+C3/3+...+C11/11 AND THEN
> > C2/1+C3/2+C4/3+...+C12/11 AND THEN C3/1+C4/2+C5/3+...+C13/11 and
so
> > on until finally C123/1+C124/2+C125/3+...+C133/11. Each of the
sums
> > would be plotted as my "formula". I am simultaneously praying
that
> > there is AND is not a simple solution. Why? Because if such is
not
> > possible then I am not as stupid my dog thinks I am. If there is
> > then my curiosity will be satisfied, I will learn something, and
> > certainly achieve total enlightenment and, well, maybe not the
last
> > part ...
> > Any comments would be,like, totally and seriously appreciated .
> > Regards,
> > Bosco
------------------------ Yahoo! Groups Sponsor --------------------~-->
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/BefplB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|