Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

BoH Risk Aversion Indicator for Amibroker (AFL)
genkumag
about 13 years ago
Amibroker (AFL)

Rating:
4 / 5 (Votes 4)
Tags:
oscillator, amibroker

Betting on Harmonics replicated RGE’s Risk Aversion Indicator which is a macro approach for measuring investors’ risk appetite. The indicator is computed by taking the correlation between rank of returns and volatility in the market over the past 21 days. Being a correlation, the indicator oscillates between -1 and 1.

This is an excellent addition to one’s tool box for gauging risk appetite using market volatility.

http://genkumag.wordpress.com/

Screenshots

Similar Indicators / Formulas

Febo RSI ..real indicator
Submitted by abhinavsingh about 13 years ago
Trading Volume Statistic
Submitted by tuanstock1 over 10 years ago
Ergodic Oscillator
Submitted by dljtrader about 14 years ago
3 Days Track
Submitted by janet0211 over 14 years ago
Chande Momentum Oscillator
Submitted by klimpek about 14 years ago

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN( "BoH Risk Aversion Indicator" );

//MyPercentRank Function as Coded by Ramon Cummins
function MyPercentRank( Data, Periods )
{
    Count = 0;
    for( i = 1; i < Periods + 1 ; i++ )
    {
        Count = Count + IIf( Ref( Data, 0 ) > Ref( Data, -i ), 1, 0 );
    }
    return 100 * Count / Periods;
}

function RAI( Length )
{
    PCHG		= ( C / Ref( C, -1 ) );
    xRR		 	= MyPercentRank( PCHG, 252 );
    Vol			= StDev( PCHG, 252 ) * 3.1;
    xRAI		= Correlation( xRR, Vol, Length );
    return xRAI;
}

//RAI Plot
Length	= Param( "Correlation Period", 21, 1, 300, 1 );
xRAI	= RAI( Length );
Plot( xRAI, "", colorGreen, styleThick );
Plot( 0, "", colorDarkRed, styleThick | styleNoLabel );
Plot( 0.2, "", colorDarkRed, styleDashed | styleNoLabel );
Plot( -0.2, "", colorDarkRed, styleDashed | styleNoLabel );

_SECTION_END();

6 comments

1. genkumag

Values above 0.20 correspond to RISK TAKING
Values below -0.20 correspond to RISK AVERSE
Values between -0.20 and 0.20 correspond to RISK NEUTRAL

2. ole

Get error unless change name of PercentRank() which is a built-in function but it is not needed as it is exactly the same result as the built-in.

3. anandnst

AFL NOT WORKING IN 5.40 VERSION OF AMIBROKER.

4. chetan ninganiya

@admin

dear sir, can you please correct the code…it ain’t working sir.

i’ll be very grateful of you .

thanks.

5. administrator

Try it now. I have renamed the rank function from ‘PercentRank’ to ‘MyPercentRank’. If your Amibroker version is not ancient you can remove the function altogether and use the built in version.

6. chetan ninganiya

@admin

thanks sir. it worked and was really helpful.

Leave Comment

Please login here to leave a comment.

Back