Random stock chart generator

Hello,

Back in the days of EquityTrader.com I included a really neat feature. If you left the site alone for more than a minute it would serve you a new chart at random and keep on doing so until you interacted with it again. Is it possible to do something similar in AB? I.e., serve charts at random?

Why would you want this? Because it helps give you an unbiased view of the market and alerts you to opportunities you might not see otherwise.

Best,

 John

PS Might be useful to limit the selections to those drawn from a watch list(s).

1 Like

Searched “slideshow” on this board. A couple popped up. Haven’t tried above but looked interesting. Their was a few more results that may offer another solution.

1 Like

Ah, slideshow. Should have thought of that search term. Thanks, John.

1 Like

Answering my own question. Enjoy!

_SECTION_BEGIN("Slideshow of stock charts");

// Slideshow of stock charts
function getRandomInt( minimum, maximum )
{
  minimum = ceil( minimum );
  maximum = floor( maximum );
  return floor( random() * ( maximum - minimum ) + minimum ); //The maximum is exclusive and the minimum is inclusive
}

// get watch list
WLNum = Param( "WatchList Number", 5, 0, 64, 1 );			
List = CategoryGetSymbols( categoryWatchlist, WLNum );
ListQty = StrCount( List, "," ) + 1; 

// set up chart refresh
RefreshRate = Param( "Chart Update rate (seconds)", 5, 0, 60, 1 );		
RequestTimedRefresh( RefreshRate );
TimerTick = Status( "RedrawAction" );

if( TimerTick ) {
    TickerNum = getRandomInt( 0, ListQty );
	Ticker = StrExtract( List, TickerNum[0] );
	SetForeign( Ticker );
	Plot( C, "", 1, 128 );
	Title = FullName() + "\n#" + NumToStr( TickerNum, 1.0, False ) + " " + Ticker;
}

_SECTION_END();

5 Likes

I actually kind of love that idea John!

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.