|
>From what i see HaOpen calculated in e-signal
uses (open+close)/2
>previous bar and afl formula does it with close only/2??? I am not >afl programmer, No. It is perfectly the same.
It uses:
HAOpen = prev(Haclose)/2 + prev(HAOpen)/2;
This is the way how AMA function works
AMA function works so it implements recursive algorithm.
output = AMA( input, factor )
is equivalent to the following looping code:
for( i = 1; i < BarCount; i++ )
{
output[ i ] = factor[ i ] * input[ i ] + ( 1 - factor[ i ] ) *
output[ i - 1 ];
}
In Heikin-Ashi code you see this:
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
So, now replace input with YesterdayHAClose, factor with 0.5 and
output with HAOpen and you will
get:
for( i = 1; i < BarCount; i++ )
{
HaOpen[ i ] = 0.5 * YesterdayHAClose[ i ] + ( 1 - 0.5 ) *
HaOpen[ i - 1 ];
}
Where HAOpen[ i ] is current bar value of HAOpen, and HAOpen[ i - 1 ] is
PREVIOUS bar value of HAOpen.
So it is exactly equivalent to:
HAOpen = AMA( YesterdayHAClose, 0.5 );
And since YEsterdayHAClose is Ref( HAClose, -1 ) we can
write:
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
Quod erat demonstrandum.
Best regards, Tomasz Janeczko amibroker.com
|
- [amibroker] Heikin-Ashi code modification as per e-signal ... nebt1
- Re: [amibroker] Heikin-Ashi code modification as per ... Tomasz Janeczko
- Re: [amibroker] Heikin-Ashi code modification as ... Tomasz Janeczko
- [amibroker] Re: Heikin-Ashi code modification... nebt1
- Re: [amibroker] Re: Heikin-Ashi code modi... Tomasz Janeczko
