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

Re: [amibroker] AFL and Meisels Indicator



PureBytes Links

Trading Reference Links

Hello Peter,

You was close but you have used Cum() function that calculates cumulative
sum for ALL bars instead of Sum() function that calculates a moving sum over specified
number of bars. You have also calculated 10-day change instead of 1-day change.

"The calculation of the Meisels indicator involves counting the number of days for which the instrument price has risen or fallen
over the selected moving period (usually 10 days). The number of days when the price fell is subtracted from the number of days
when the price rose. The resultant surplus (or deficit) is plotted as a positive or negative number on the chart."


So 10-day Meisels indicator in AFL would look like this:

change = IIF( close > ref( close, - 1 ), 1,
IIF( close < ref( close, -1 ), -1, 0 ) ) ;

Meisels = Sum( change, 10 );

graph0 = Meisels;

And that's it.

for "change" variable you can also use the following:

change = IIF( roc( close, 1 ) > 0, 1,
IIF( roc( close, 1 ) < 0, -1, 0 ) ) ;


Best regards,
Tomasz Janeczko
===============
AmiBroker - the comprehensive share manager.
http://www.amibroker.com

----- Original Message -----
From: "Peter Carr" <pcarr@xxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, January 26, 2001 8:10 PM
Subject: [amibroker] AFL and Meisels Indicator


> Hello everyone,
>
> Meisels - here was an indicator that I thought was going to be a
> 'doddle' (easy). Looking at the definitions in the books I decided to
> give it a go. Here they are:
>
> "The sum of the plus or minus observations day to day."
>
> "... the net number of times the market has closed up and down over the
> past 'n' periods (default is 10)."
>
>
> Unfortunately, despite hours of pouring over it, trying CUM()'s and a
> variety of nested IIF()'s I cannot get it to look quite right. Here's
> my most recent attempt...
>
> ===========================================================
> /* Meisels Indicator (10 Day)
> NOT FULLY CHECKED OR TESTED YET */
>
> days = 10 ;
> lastclose = REF( close, days * -1 ) ;
> change = IIF( close > lastclose, 1,
> IIF( close < lastclose, -1, 0 ) ) ;
>
> graph0 = CUM( change ) ;
> ===========================================================
>
> I don't think the CUM() function is doing what I expect it to. Can
> anyone throw any light on how to improve this?
>
> Knowing my luck, I bet it's something simple that just escapes me :-)
>
> Thanks in advance for any suggestions.
>
> Peter
> --
> ======================================================================
> Peter Carr
> Email: pcarr@xxxx ICQ: 22586379
> ======================================================================
>
>
>
>