Skip to main content

Clear and Scan into Watchlist for Amibroker (AFL)

Tyke over 9 years ago Amibroker (AFL)

  • Rating:
    3 / 5 (Votes 2)
  • Tags:
    scan, watchlist, Analysis, amibroker

1.) On first pass will clear a defined Watchlist.
2.) Based on the “Apply to” will iterate tickers and
scan for conditions.
3.) Load the results into the previously cleared Watchlist.

Indicator / Formula

Copy & Paste Friendly
/*-- Tyke --*/

listnum = 6;	// watchlist to use

if ( Status( "stocknum" ) == 0 )
{
    oldlist = CategoryGetSymbols( categoryWatchlist, listnum );
    for ( i = 0; ( sym = StrExtract( oldlist, i ) ) != ""; i++ )
    {
        CategoryRemoveSymbol( sym, categoryWatchlist, listnum );
    }
}

longEMA = EMA( C, 100 );
MidEma = EMA( C, 50 );
shortEma = EMA( C, 10 );

Condition1 = shortEma > MidEma
	AND MidEma > longEMA
	;

Filter = Condition1;

AddColumn( Close, "Close" );
AddColumn( ROC( Close, 14 ), "ROC" );
AddColumn( Volume, "Volume" );
AddColumn( ATR(100), "ATR(14)" );

if ( LastValue( Cum( Filter AND Status( "barinrange" ) ) )  )
    CategoryAddSymbol( "", categoryWatchlist, listnum );

0 comments

Leave Comment

Please login here to leave a comment.