isWatchList()

ICE Data Services -

isWatchList()
Utility Functions


isWatchList()

Returns true if the script is running in a WatchList.

Parameters

none
this function has no input parameters


Notes

Only available in version 11.3 or later.


Usage

function preMain()
{
   if ( isWatchList() )
   {
      setDefaultBarBgColor(Color.yellow);
      setDefaultBarFgColor(Color.black);
   }
}

var bInit = false;
var xEMA = null;
function main()
{
   if ( !bInit )
   {
      xEMA = ema(10);
      bInit = true;
   }
   var vEMA0 = xEMA.getValue(0);
   var vEMA1 = xEMA.getValue(-1);
   if ( vEMA1 == null ) return;
   var bDOWN = (vEMA1>vEMA0);

   if ( isWatchList() )
   {
      return (bDOWN)? "DOWN" : "UP";
   }
   else
   {
       if (bDOWN) drawShapeAbsolute(0, vEMA0, Shape.DOWNARROW, null, Color.yellow, Shape.TOP, "dir" );
       else drawShapeAbsolute(0, vEMA0, Shape.UPARROW, null, Color.yellow, Shape.BOTTOM, "dir" );
       return vEMA0;
   }
}