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

[amibroker] Re: can you put script into a procedure



PureBytes Links

Trading Reference Links

Dingo
Thanks for having a look
Andrew
--- In amibroker@xxxxxxxxxxxxxxx, "dingo" <dingo@xxxx> wrote:
> After a little experimentation it looks like it doesn't support 
script
> within a procedure.
>  
> This Runs syntax free:
>  
> procedure WLTickerAdd(sTicker,WL)
> {
>  
> Ticker = sTicker; 
> WLNumber = WL;
>  
> }
>  
> WLTickerAdd("AAA",20);
> 
> Buy = 0;
> Sell = 0;
> Short = 0;
> Cover = 0;
> 
> -----------------------------------------------
>  
> But just adding the enabled script won't:
> 
> procedure WLTickerAdd(sTicker,WL)
> {
>  
> Ticker = sTicker; 
> WLNumber = WL;
> EnableScript("jscript");
> <%
> 
> %>
>  
> }
>  
> WLTickerAdd("AAA",20);
> 
> Buy = 0;
> Sell = 0;
> Short = 0;
> Cover = 0;
>  
> Have you read the docs and all of the tutorials?  jk
>  
> A note directly to TJ may be in order.
>  
> d
> 
> -----Original Message-----
> From: Andrew [mailto:ae_perrin@x...] 
> Sent: Thursday, September 11, 2003 8:39 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: can you put script into a procedure
> 
> 
> Dingo
> This is the error I get running the procedure:
> 
> Line 18, Column 1:
> Ticker = sTicker; //? is this required
> WLNumber = WL; //? this also
> EnableScript("jscript");
> <
> ^
> Error 23.
> Syntax error
> 
> Procedure is:
> 
> procedure WLTickerAdd(sTicker,WL)
> {
> Ticker = sTicker; //? is this required
> WLNumber = WL; //? this also
> EnableScript("jscript");
> <%
> AB = AFL.CreateObject("Broker.Application");
> AB.Stocks( AFL("Ticker" ) ).WatchListBits |= 1 << AFL
( "WLNumber" );
> %>
> }
> 
> WLTickerAdd("OSH",20);
> Buy = 1;
> 
> Appreciate any help you can give.
> Andrew
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "dingo" <dingo@xxxx> wrote:
> > It would be helpful if you would post the error that you're 
> getting...
> >  
> > d
> > 
> > -----Original Message-----
> > From: Andrew [mailto:ae_perrin@x...] 
> > Sent: Thursday, September 11, 2003 6:04 PM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] can you put script into a procedure
> > 
> > 
> > Can someone point out whether you can put the following 
> > Script (adds ticker to watchlist) into a procedure. My effort 
> > follows but I continually get an error.
> > 
> > Ticker = "OSH";
> > WLNumber = 20;
> > EnableScript("jscript");
> > <%
> > AB = AFL.CreateObject("Broker.Application");
> > AB.Stocks( AFL("Ticker" ) ).WatchListBits |= 1 << AFL
> ( "WLNumber" );
> > %>
> > 
> > My Procedure effort:
> > 
> > procedure WLTickerAdd(sTicker,WL)
> > {
> > Ticker = sTicker; //? is this required
> > WLNumber = WL; //? this also
> > EnableScript("jscript");
> > <%
> > AB = AFL.CreateObject("Broker.Application");
> > AB.Stocks( AFL("Ticker" ) ).WatchListBits |= 1 << AFL
> ( "WLNumber" );
> > %>
> > }
> > 
> > WLTickerAdd("OSH",20);
> > Buy = 1;
> > 
> > And while we're on the subject, has anyone got a script that 
will 
> > clear a watchlist. I found this by TJ -"You can erase watch 
lists 
> > by assigning zero to both WatchListBits and WatchListBits2 in 
ALL 
> > stocks."- Can anyone elaborate?
> > Thanks
> > Andrew
> > 
> 
> 
> 
> 
> Yahoo! Groups Sponsor	
> 
> ADVERTISEMENT
>  
> 
<http://rd.yahoo.com/M=251812.3856299.5103760.1261774/D=egroupweb/S=1
705
> 
632198:HM/A=1754452/R=0/SIG=11tjeu2hk/*http://www.netflix.com/Default
?mq
> so=60178324&partid=3856299> click here	
>  
> <http://us.adserver.yahoo.com/l?
M=251812.3856299.5103760.1261774/D=egrou
> pmail/S=:HM/A=1754452/rand=984964259> 	
> 
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> 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
> <http://docs.yahoo.com/info/terms/> .


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
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/