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

[amibroker] WatchListBits - how to remove a ticker from a list in vbscript ?



PureBytes Links

Trading Reference Links

I have the following code that ADDs a ticker to a watchlist using 
VBScript:

MyBit = oNewlyAdded.WatchListBits Or GetWatchListBits(iWatchList)
oNewlyAdded.WatchListBits = MyBit

Function GetWatchListBits(WatchListNumber)
Dim i 'Integer
Dim j 'DOuble

i = 0
j = 1
If WatchListNumber > 0 Then
    For i = 0 To WatchListNumber - 1
        j = j * 2
    Next
End If
 
If j = 2147483648# Then
    j = j * -1
End If
GetWatchListBits = j
End Function


This works but can anyone assist me with the code to REMOVE a ticker 
from the n list ?

Thanks!

--- In amibroker@xxxxxxxxxxxxxxx, "dingo" <dingo@xxx> wrote:
>
> Are you trying to use AB.WatchListBits |=1<<8; to place a ticker 
in a
> watchlist? or?
>  
> and I'm not familiar with  |=1<<8  - could you explain in words?
>  
>  
> d
> 
> 
>   _____  
> 
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] 
On Behalf
> Of bchris888au
> Sent: Monday, February 27, 2006 6:16 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] WatchListBits
> 
> 
> Hello All,
> 
> Just read back my first message and it doesn't explain my question
> properly.
> 
> Below I have a batch script that runs a group of explorations, as 
they
> find candidate stocks I want them automatically placed in a 
watchlist,
> am I right to use the command:
> 
> AB.WatchListBits |=1<<8;
> 
> The above is not quite right as the object is not defined.....
> 
> regards,
> 
> Chris.
> 
> 
> /*****************************
> *
> * BatchTest.js
> *
> * Batch testing sample script
> * Shows how to use JScript and new AmiBroker 4.23
> * 'Analysis' object to perform batch backtesting
> * and generate reports
> *
> * Created: Dec 21, 2002 TJ
> * Last modification: Dec 22, 2002 TJ
> *
> * Copyright (C)2002 Amibroker.com
> *
> * Status: Freeware
> * You can use/modify/adopt this code freely
> *
> */
> 
> /* The directory where AFL files are stored
> ** Also reports generated by the bactest
> ** will be saved here
> */
> 
> AFLFolder = "C:\\Program
> Files\\AmiBroker\\Formulas\\Custom\\Explorations\\Favorites"; //
> MODIFY TO FIT YOUR SETUP
> 
> WScript.Echo("Batch testing of all AFL files stored in " + 
AFLFolder );
> 
> var AB, AA;
> var fso, f, f1, fc, s;
> var filename;
> 
> /* Create AmiBroker object and get Analysis object */
> 
> AB = new ActiveXObject("Broker.Application");
> AA = AB.Analysis;
> 
> /* backtest over symbols and all quotes*/
> AA.ClearFilters();
> AA.ApplyTo = 0; // use symbols
> AA.RangeN = 1;
> AA.RangeMode = 3; // all quotes
> 
> /* to use filters you should uncomment lines below
> 
> AA.ApplyTo = 2; // use filters
> AA.Filter(0,"watchlist") = 5 /* watch list number */;
> // AA.Filter(0,"group") = 0 /* group number */;
> 
> /* Create FileSystemObject */
> fso = new ActiveXObject("Scripting.FileSystemObject");
> 
> /* Iterate through all files in the folder */
> f = fso.GetFolder(AFLFolder);
> fc = new Enumerator(f.files);
> for (; !fc.atEnd(); fc.moveNext())
> {
>      // we need to add empty string to make sure that filename is a
> string object
>      filename = "" + fc.item();
> 
>   /* check the AFL extension */
>   if( filename.substr( filename.length - 4 ).toUpperCase() 
== ".AFL" )
>   {
>    if( AA.LoadFormula( filename ) )
>    {
>     AA.Explore();
>     AB.WatchListBits |=1<<8;
>     exportname = filename.substr( 0, filename.length - 3 ) 
+ ".csv" ;
> 
>     AA.Export( exportname ); // generate report
>    }
>   }
> }
> 
> WScript.Echo("Batch backtest finished");
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Please note that this group is for discussion between users only.
> 
> To get support from AmiBroker please send an e-mail directly to 
> SUPPORT {at} amibroker.com
> 
> For other support material please check also:
> http://www.amibroker.com/support.html
> 
> 
> 
> 
> 
> 
> SPONSORED LINKS 
> Investment
> <http://groups.yahoo.com/gads?
t=ms&k=Investment+management+software&w1=Inves
> 
tment+management+software&w2=Real+estate+investment+software&w3=Inves
tment+p
> 
roperty+software&w4=Software+support&w5=Real+estate+investment+analys
is+soft
> ware&w6=Investment+software&c=6&s=200&.sig=_XXUzbE9l5lGlZNcMu4KNQ>
> management software 	Real
> <http://groups.yahoo.com/gads?
t=ms&k=Real+estate+investment+software&w1=Inve
> 
stment+management+software&w2=Real+estate+investment+software&w3=Inve
stment+
> 
property+software&w4=Software+support&w5=Real+estate+investment+analy
sis+sof
> 
tware&w6=Investment+software&c=6&s=200&.sig=5_sgDczz3ArKGMtJ9tFSJA> 
estate
> investment software 	Investment
> <http://groups.yahoo.com/gads?
t=ms&k=Investment+property+software&w1=Investm
> 
ent+management+software&w2=Real+estate+investment+software&w3=Investm
ent+pro
> 
perty+software&w4=Software+support&w5=Real+estate+investment+analysis
+softwa
> re&w6=Investment+software&c=6&s=200&.sig=_N6zcwefgp4eg5n6oX5WZw> 
property
> software 	
> Software
> <http://groups.yahoo.com/gads?
t=ms&k=Software+support&w1=Investment+manageme
> 
nt+software&w2=Real+estate+investment+software&w3=Investment+property
+softwa
> 
re&w4=Software+support&w5=Real+estate+investment+analysis+software&w6
=Invest
> ment+software&c=6&s=200&.sig=MJ2jP31F3n64RDZkDadU8w> support 	Real
> <http://groups.yahoo.com/gads?
t=ms&k=Real+estate+investment+analysis+softwar
> 
e&w1=Investment+management+software&w2=Real+estate+investment+softwar
e&w3=In
> 
vestment+property+software&w4=Software+support&w5=Real+estate+investm
ent+ana
> 
lysis+software&w6=Investment+software&c=6&s=200&.sig=GmF8PlAJASx0wrSa
X5-Zlw>
> estate investment analysis software 	Investment
> <http://groups.yahoo.com/gads?
t=ms&k=Investment+software&w1=Investment+manag
> 
ement+software&w2=Real+estate+investment+software&w3=Investment+prope
rty+sof
> 
tware&w4=Software+support&w5=Real+estate+investment+analysis+software
&w6=Inv
> estment+software&c=6&s=200&.sig=aMgGsKT4w29dMAYUzQUKzg> software 
	
> 
>   _____  
> 
> YAHOO! GROUPS LINKS 
> 
> 
> 	
> *	 Visit your group "amibroker
> <http://groups.yahoo.com/group/amibroker> " on the web.
>   
> 
> *	 To unsubscribe from this group, send an email to:
>  amibroker-unsubscribe@xxxxxxxxxxxxxxx
> <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe> 
>   
> 
> *	 Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service
> <http://docs.yahoo.com/info/terms/> . 
> 
> 
>   _____
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/