[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: script to add to watchlists



PureBytes Links

Trading Reference Links

--- In amibroker@xxxxxxxxxxxxxxx, "johncw_97" <johncw_97@xxx> wrote:
>
> --- In amibroker@xxxxxxxxxxxxxxx, "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



Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.20/664 - Release Date: 2/2/2007 3:42 PM