PureBytes Links
Trading Reference Links
|
Preston
It seems that the formula below for predicting the closing price
needed for the signal line to cross the MACD is not as accurate as
it could be. The reason, at least with my version of MS (7.03), is
that the MACD in MetaStock is based on EMA's that are slightly off
the assumed 12/26 periods. The MACD EMA's are calculated using
proportions of 0.075 and 0.15 instead of 2/13 and 2/27. The latter
is what the code you posted uses for the 'top' variable, hence the
small errors that occur when tested against the MS canned MACD.
I've taken the liberty of revamping the code so that the predictive
prices work for my version of MS.
Roy
{MACD MS Look Ahead}
x:=0.15; y:=0.075;
a:=If(Cum(1)=1,C,PREV*(1-x)+C*x);
b:=If(Cum(1)=1,C,PREV*(1-y)+C*y);
a:=a*(1-x); b:=b*(1-y); top:=b-a;
{C required for signal/MACD crossover}
(Mov(MACD(),9,E)+top)/(x-y);
--- In equismetastock@xxxxxxxxxxxxxxx, pumrysh <no_reply@xxxx> wrote:
> This is from another group. See if it gives you any ideas.
>
> Preston
>
> a user asked if the tommorows close could calculated which would
> cause the MACD to cross the 0 line, or the trigger line. we
worked
> it out and got:
>
> a:=12;b:=26;x:=2/(1+a);y:=2/(1+b);
> top:=Mov(C,b,E)*(1-y)-Mov(C,a,E)*(1-x);
>
> {C required for trigger line crossover}
> (Mov(MACD(),9,E)+top)/(x-y);
>
> {C required for 0 value MACD}
> top/(x-y)
>
>
>
>
> --- In equismetastock@xxxxxxxxxxxxxxx, "will65shak" <nexus42@xxxx>
> wrote:
> > > to point out that a little lateral thinking goes a long way
> >
> > I'm almost horizontal, and I _still_ don't get it!-)
> >
> > I'm sure I'm missing something obvious, but:
> >
> > I'm not calculating the distance between two events, but instead
> > from the _current bar_ until the next event. Knowing this
distance,
> > I then plan to calculate & plot a value _at each_ current bar,
and
> > this value will change for every bar since distance (and price)
> > changes at each bar. If I 'wait' with the calculation until the
> next
> > event, I can only plot a value at that event, but not at the
dozens
> > of bars between events.
> >
> > Is this even possible in MS? Or is it just impossible to make me
> get
> > it?-)
> >
> > Cheers!Kristian
> >
> >
> > > How to create a BarsFuture(), i.e. a BarsSince() that finds
the
> > next true bar instead of the last true bar?
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/CNxFAA/BefplB/TM
---------------------------------------------------------------------~->
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/
|