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

CYBER STOCH for Amibroker (AFL)

Rating:
3 / 5 (Votes 7)
Tags:
oscillator, amibroker

From John Ehler’s book
Rocket Science for Traders

AFL By Robert Dunbar

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("CYBER STOCH");

Arrows = ParamToggle( "Buy/Sell Arrows", "No|Yes", 1 );
alpha = Param( "Alpha", 0.07, 0.01, 0.4, 0.01, 0.01 );
Len = Param( "Length", 8, 1, 25, 1, 1 );
BullSig = BearSig = Trigger = Cycle = MaxCycle = MinCycle = Value1 = Value2 =
0;
PriceIn = ( ( H + L ) / 2 );

SmoothX = ( PriceIn + 2 * Ref( PriceIn, -1 ) + 2 * Ref( PriceIn, -2 ) + Ref(
PriceIn, -3 ) ) / 6;


for ( i = 6; i < BarCount; i++ )
{
    Cycle[i] = ( ( 1 - 0.5 * alpha ) ^ 2 ) * ( SmoothX[ i ] - 2 * SmoothX[ i - 1
] + SmoothX[ i - 2] ) + 2 * ( 1 - alpha ) * Cycle[ i - 1 ] - ( ( 1 - alpha ) ^ 2
) * Cycle[ i - 2 ];

    if ( i < 7 )
        Cycle[i] = ( PriceIn[i] - 2 * PriceIn[i-1] + PriceIn[i-2] ) / 4;
}

MaxCycle = HHV( Cycle, Len );

MinCycle = LLV( Cycle, Len );

Value1 = IIf( MaxCycle != MinCycle, ( Cycle - MinCycle ) / ( MaxCycle - MinCycle
), Value1 );

Value2 = ( 4 * Value1 + 3 * Ref( Value1, -1 ) + 2 * Ref( Value1, -2 ) + Ref(
Value1, -3 ) ) / 10;

Value2 = 2 * ( Value2 - 0.5 );

Trigger = ( 0.96 * ( Ref( Value2, -1 ) + 0.02 ) );

BullSig = IIf( Cross( Value2, Trigger ), True, False );
BearSig = IIf( Cross( Trigger, Value2 ), True, False );


Plot( Value2, "CyberCycle", colorLightBlue );
Plot( Trigger , "Trigger", colorRed );
Plot( 0 , "", colorWhite, styleDashed );

if ( Arrows )
{
    PlotShapes( shapeUpArrow*BullSig, colorBrightGreen );
    PlotShapes( shapeDownArrow*BearSig, colorRed );
}
_SECTION_END();

4 comments

1. anandnst

i m using this one since many years…

Good one

2. vijayss

Hi,

Can someone please modify it to add backtesting and scan/exploration which is not working.
So while it looks good, I am unable to comment with good basis.

Thanks
Vijay

3. kanavai

Hi, seems to be good one. But,If you explain, how can we use it ? and What Time Frame is best for Intraday., it will be useful for all.

4. sal157011

This is from John Ehler’s book
Cybernetic Analysis for Stocks and Futures

Leave Comment

Please login here to leave a comment.

Back