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

[amibroker] Re: add stock to wachtlist via AFL-code



PureBytes Links

Trading Reference Links

Hello William,
thats a good point I missed (upto now every ticker in my database 
belongs only to one watchlist).

But I have a logical problem with this (beeing no expert with jscript 
or vbscript):
How can I assign two values to one variable ?
Ok, your souce-code excerpt shows it should be possible, and I will 
try this later (after work).

Thanks.
Bye
Stefan 

--- In amibroker@xxxxxxxxxxxxxxx, "William Peters" 
<williampeters1@xxxx> wrote:
> Stefan,
> 
> Very glad you could gleen something from sample. That sample was 
for both you and Jayson so it had some functionality that maybe was 
not necessary for you. One potential problem with your code below is 
with the way you are setting the watchlistbits for the tickers (ie. 
oAB.Stocks(ticker).WatchListBits=1; )
> 
> If you just do this and you have the same ticker in multiple 
watchlist it is not going to work. You need to perform a logical OR 
on the value of Watchlistbits..
> 
> Now with jscript I am not 100% positive but maybe something like 
this:
> 
> ie.
> 
> Watchlistlistnumber = 5;
> oAB.Stocks(ticker).WatchListBits = oAB.Stocks(ticker).WatchListBits 
| ( 1 << Watchlistlistnumber );
> 
> 
> Regards,
> William
> 
> -----Original Message-----
> From: Stefan S <stefan.schellhaus@xxxx>
> [mailto:stefan.schellhaus@x...]
> Sent: February 10, 2003 12:01 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: add stock to wachtlist via AFL-code
> 
> 
> Hello William,
> thank you for your example. It helped me solving my problem.
> But the add-to-watchlist can be done within the AA-window. So at 
> least for my simple application, it is not necessary to store a 
file 
> and call an external script. I am no OLE/SCript specialist - maybe 
> this approach could cause errors. But with my database (600+ 
stocks) 
> it works.
> 
> Bye
> Stefan
> 
> ...
> ticker = Name();
> jscriptFilter = LastValue(jscriptFilter);
> flag = LastValue(IIf(FilterCond2 > 0, 1,0));   
> EnableScript("jscript");
> <%
> jscriptFilter = AFL("jscriptFilter");
> if(jscriptFilter > 0)
> {
>    ticker = AFL("ticker");
>    flag = AFL("flag");
>    var oAB = new ActiveXObject("Broker.Application");
>    if(flag > 0)
>    {
>       oAB.Stocks(ticker).WatchListBits=1;
>    }
>    else
>    {
>       oAB.Stocks(ticker).WatchListBits=2;
>    }
>    oAB.RefreshAll();
> }
> %>
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "William Peters" 
> <williampeters1@xxxx> wrote:
> > Hi Jayson,
> > 
> > Ive created a routine that is run outside of Amibroker (just 
double-
> click
> > the vbs file, its simular to a jscript file). There is also a 
> sample afl
> > file you will have to customise that will be the basis of your 
> sector to
> > watchlist code, you must put this AFL file in your Amibroker 
> **Database**
> > directory before running the code.
> > 
> > So the steps are:
> > 
> > 1 Place the "MyAFLFormula.afl" file in the relevent Amibroker 
> *Database*
> > directory
> > 2 Customise the AFL code to suit your requirements and save.
> > 3 Place the "RunAFLExplore.vbs" file in your Amibroker Scripts 
> directory and
> > double click to run.
> > 
> > There are many other things you could do with this type of code, 
> the sky is
> > the limit when you think about it.
> > 
> > If you have any questions please fire away.
> > 
> > Regards,
> > William Peters
> > 
> > ps. There might be a way to run the whole thing from inside of 
> Amibroker,
> > i'll think about that.
> > 
> > 
> > -----Original Message-----
> > From: Jayson [mailto:jcasavant@x...]
> > Sent: Thursday 6, February 2003 7:44 AM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: RE: [amibroker] add stock to wachtlist via AFL-code
> > 
> > 
> > William,
> > could you elaborate? Spefically what I would like to do is run a 
> basket of
> > stocks then assign the results to specific watch lists based on 
> thier Sector
> > assignments. So from the list of say 500 stocks send all the Cap 
> goods
> > candidates to watchlist "A", the Retail Candidates to 
watchlist "B" 
> etc.
> > 
> > TIA
> > 
> > Jayson
> > -----Original Message-----
> > From: William Peters [mailto:williampeters1@x...]
> > Sent: Thursday, February 06, 2003 12:51 PM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: RE: [amibroker] add stock to wachtlist via AFL-code
> > 
> > 
> > Stephan,
> > 
> > You could do it via the AA window using AFL and jscript or 
vbscript.
> > 
> > Regards,
> > William
> > 
> > -----Original Message-----
> > From: Jayson [mailto:jcasavant@x...]
> > Sent: Thursday 6, February 2003 6:34 AM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: RE: [amibroker] add stock to wachtlist via AFL-code
> > 
> > 
> > Stefan,
> > I do not believe there is though it would save me a lot of time 
> updating on
> > a weekly basis. AB is like the weather in New England ( Eastern 
> US)....If
> > you don't like it just give it a minute, it will surely change....
> > 
> > Jayson
> > -----Original Message-----
> > From: Schellhaus Stefan [mailto:stefan.schellhaus@x...]
> > Sent: Thursday, February 06, 2003 3:42 AM
> > To: 'amibroker@xxxx'
> > Subject: [amibroker] add stock to wachtlist via AFL-code
> > 
> > 
> > Good Morning Everybody,
> > is it possible to add a stock to a watch list via afl-code in the 
> automatic
> > analyser ?
> > Best regards
> > Stefan
> > 
> > 
> > 
> > 
> > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > 
> > Check group FAQ at:
> > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > 
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.
> > 
> > 
> > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > 
> > Check group FAQ at:
> > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > 
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.
> > 
> > 
> > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > 
> > Check group FAQ at:
> > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > 
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.
> > 
> >       Yahoo! Groups Sponsor
> >             ADVERTISEMENT
> > 
> > 
> > 
> > 
> > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > 
> > Check group FAQ at:
> > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > 
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.
> 
> 
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> 
> Check group FAQ at: 
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> Your use of Yahoo! Groups is subject to 
http://docs.yahoo.com/info/terms/


------------------------ Yahoo! Groups Sponsor ---------------------~-->
DVD Rentals with No Late Fees - Try Netflix for FREE!
http://us.click.yahoo.com/PdoN7C/pEZFAA/46VHAA/GHeqlB/TM
---------------------------------------------------------------------~->

Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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