Skip to content

Instantly share code, notes, and snippets.

@smnuman
Last active August 29, 2015 14:04
Show Gist options
  • Save smnuman/3c7518ae5330cdb52f93 to your computer and use it in GitHub Desktop.
Save smnuman/3c7518ae5330cdb52f93 to your computer and use it in GitHub Desktop.
An indicator to find the strength of an issue for Buy-ing and Sell-ing. Just drag-and-drop on a chart to analyse.

NMN-Strength Finding

A simple yet very usefull indicator-help that shows the strength of an issue of a market.

_SECTION_BEGIN("NMN-Strength Finding");
    //============== A/D ==============
    TRH = IIf( Ref( C, -1 ) > H, Ref( C, -1 ), H );
    TRL = IIf( Ref( C, -1 ) < L, Ref( C, -1 ), L );
    ad = IIf( C > Ref( C, -1 ), C - TRL, IIf( C < Ref( C, -1 ), C - TRH, 0 ) );
    WAD = Cum( ad );
    wu = wad > Ref( wad, -1 );
    wd = wad < Ref( wad, -1 );

    //============== WILLIAM'S %R ==============
    WR = ( ( HHV( H, 14 ) - C ) / ( HHV ( H, 14 ) - LLV ( L, 14 ) ) ) * -100;

    // Following variables collect values based on their respective indicator
    //    to express Overbaught ( = -1), ranging ( = 0) or Oversold ( = 1).
    AccDst = IIf( wu, -1, IIf( wd, 1, 0));
	RSI_14 = IIf( RSI(14) > 30 AND RSI(14) < 70, 0, IIf( RSI(14) < 30, 1, -1 ) );
	CCI_14 = IIf( CCI(14) > -100 AND CCI(14) < 100, 0, IIf( CCI(14) < -100, 1, -1 ) );
	ROC_14 = IIf( ROC(C,14) > -10 AND ROC(C,14) < 10, 0, IIf( ROC(C,14) <= -10, 1, -1 ) );
	WR__14 = IIf( WR > -80 AND WR < -20, 0, IIf( WR < -80, 1, -1 ) );

	// Strength thus holds a value within, and including, -5 and 5 giving 'Overbaught' or 'Oversold' conditions
	Strength = AccDst + RSI_14 + CCI_14 + ROC_14 + WR__14;
	//----------------------------------------------------
_SECTION_END();

Usage

Simply download to your Formula folder of your AmiBroker installation. Drag it to the 'chart in concern'. Use the variable Strength in your script like this:

AddColumn( Strength, "5", 1, BuySellFG, BuySellBG);

Go to your AA window. Start watching your analysis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment