+91-0000000000

}

Monday – Friday : 9:00 AM – 6:30 PM

Ehler CGO

Ehler CGO in Amibroker might represent indicators or strategies based on the Ehler Center of Gravity concept. Utilizing the Amibroker data feed, these tools aim to provide signals or insights into market trends and potential reversals based on price movement around the center of gravity line.

/_SECTION_BEGIN("EhlerCGO");
//	EhlerCGO.afl
//
// John Ehlers, Cybernetic Analysis for Stocks and Futures.
//	Wiley, 2004.
// Chapter 5, p. 47. Code on p. 49.

SetBarsRequired( 200, 0 );

function CGOscillator( array, length )
{
    CGOValue = array;

    for ( i = length; i < BarCount; i++ )
    {
        num = 0;
        denom = 0;

        for ( j = 0; j < length; j++ )
        {
            num = num + ( 1 + j ) * array[i - j];
            denom = denom + array[i - j];
        }

        if ( denom != 0 )
            CGOValue[i] = -num / denom + ( length + 1 ) / 2;
    }

    return CGOValue;
}

med = ( H + L ) / 2;
LookBack = Param( "LookBack", 10, 1, 250, 1 );

dd = CGOscillator( med, LookBack );

Plot( C, "C", colorBlack, styleCandle );
Plot( dd, "CG Oscillator", colorRed, styleLine | styleOwnScale );
_SECTION_END();

Open chat
1
Hi, how can I help you?