--- In [email protected], "johncw_97" <[EMAIL PROTECTED]> wrote:
>
> --- In [email protected], "murthysuresh" <money@> wrote:
> >
> > Hello
> > I was planning to script adding to watchlist based on hotkeys. for 
> > somereason, this script does not add to the watchlist. i get no
errors. 
> > can someone point the mistake. 
> > 
> > 
> > var oShell = WScript.CreateObject("WScript.Shell");
> > var oAB = new ActiveXObject("Broker.Application");
> > 
> > 
> > //get the ticker currently active in AmiBroker
> > Ticker = oAB.ActiveDocument.Name;
> > WScript.Echo(Ticker );
> >  Ticker.WatchListBits |=10;
> >  oAB.SaveDatabase();
> > 
> > thanks in advance.
> >
> 
> How about this:
> 
> var oShell = WScript.CreateObject("WScript.Shell");
> var oAB = new ActiveXObject( "Broker.Application");
> 
> //get the ticker currently active in AmiBroker
> Ticker = oAB.ActiveDocument.Name;
> oAS = oAB.Stocks;
> oAT = oAS.Item(Ticker);
> watchlist = 10;
> 
> if (watchlist <= 32)
>         oAT.WatchListBits |= 1 << watchlist;
> else
>         oAT.WatchListBits2  |= 1 << ( watchlist - 32 );
> oAB.refreshall();
>

Thanks for your response. It works for me now. What is the syntax to
remove a symbol from watchlist using a script. Is there one?

Thanks in advance.

Seede


Reply via email to