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

Re: [amibroker] JScripts - some debugging help needed



PureBytes Links

Trading Reference Links




William,
 
You can call broker object from AB itself. It has been widely 
used in tens of scripts including
ones posted in the past in the newsletter.
 
Best regards,Tomasz Janeczkoamibroker.com
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  <A title=williampeters@xxxxxxxxxxxx 
  href="">William Peters 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Wednesday, December 31, 2003 3:10 
  AM
  Subject: RE: [amibroker] JScripts - some 
  debugging help needed
  
  Herman,
   
  I think the problem is that 
  you are trying to create and work with a broker object from within AmiBroker 
  itself. I don't think you can do this successfully. You should be running 
  scripts that work with the AB object model from outside of AmiBroker but 
  that probably wont suit your requirements.
   
  
  Regards,William Peters<A 
  href="">www.amitools.com
  <FONT face=Tahoma 
  size=2>-----Original Message-----From: Herman vandenBergen 
  [mailto:psytek@xxxxxxxx]Sent: Tuesday December 30, 2003 6:22 
  PMTo: AmiBrokerSubject: [amibroker] JScripts - some 
  debugging help needed
  <SPAN 
  class=780530123-30122003>Dale,
  <SPAN 
  class=780530123-30122003> 
  i decided I'd 
  rather look stupid then waste more time. The RemoveAllQuotes() works fine but 
  my DeleteComposite() doesn't want to work, can somebody help correct the 
  code?
  <SPAN 
  class=780530123-30122003> 
  Many 
  thanks!
  <SPAN 
  class=780530123-30122003>herman
  <SPAN 
  class=780530123-30122003> 
  <FONT 
  size=2>Buy<FONT 
  color=#000000>=Sell<FONT 
  color=#000000>=Short<FONT 
  color=#000000>=Cover<FONT 
  color=#000000>=0<FONT 
  size=2>; <FONT 
  color=#ff0000>Filter=<FONT 
  color=#ff00ff>1<FONT 
  color=#000000>; AddToComposite<FONT 
  color=#000000>(1<FONT 
  color=#000000>,"~Test1"<FONT 
  color=#000000>,"x"<FONT 
  size=2>); <FONT 
  color=#0000ff>AddToComposite(<FONT 
  color=#ff00ff>1,<FONT 
  color=#ff00ff>"~Test2",<FONT 
  color=#ff00ff>"X"<FONT 
  color=#000000>); EnableScript<FONT 
  color=#000000>("jscript"<FONT 
  size=2>); <% <FONT 
  color=#ff0000>function 
  RemoveAllQuotes( Name<FONT 
  size=2> )    { 
     AB = new ActiveXObject(<FONT 
  color=#ff00ff>"Broker.Application"<FONT 
  face=Arial>);    iQty = AB.Stocks( 
  Name<FONT 
  face=Arial> ).Quotations.Count; 
     <FONT 
  color=#ff0000>for( i = iQty - 
  1; i >= <FONT 
  color=#ff00ff>0<FONT 
  color=#000000>; i-- ) 
        { 
  <FONT 
  size=2><FONT 
  color=#000000>      AB.Stocks( <FONT 
  color=#0000ff>Name<FONT 
  color=#000000> ).Quotations.Remove( i ); 
        }    } 
  <FONT 
  color=#ff0000>function<FONT 
  face=Arial> DeleteComposite( CompName ) 
     {    AB = new 
  ActiveXObject(<FONT 
  color=#ff00ff>"Broker.Application"<FONT 
  face=Arial>);    AB.Stocks( CompName 
  ).Remove();    } %> script = <FONT 
  color=#0000ff>GetScriptObject<FONT 
  face=Arial>(); script.RemoveAllQuotes(<FONT 
  color=#ff00ff>"~Test1"<FONT 
  color=#000000>); script.DeleteComposite(<FONT 
  color=#ff00ff>"~Test2"); 
  
  <SPAN 
  class=780530123-30122003> Send BUG 
  REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  
  
  Yahoo! Groups Links
  
    To visit your group on the web, go to:<A 
    href="">http://groups.yahoo.com/group/amibroker/  

    To unsubscribe from this group, send an email to:<A 
    href="">amibroker-unsubscribe@xxxxxxxxxxxxxxx  

    Your use of Yahoo! Groups is subject to the <A 
    href="">Yahoo! Terms of Service. 
  Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend 
  SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  
  
  Yahoo! Groups Links
  
    To visit your group on the web, go to:<A 
    href="">http://groups.yahoo.com/group/amibroker/  

    To unsubscribe from this group, send an email to:<A 
    href="">amibroker-unsubscribe@xxxxxxxxxxxxxxx  

    Your use of Yahoo! Groups is subject to the <A 
    href="">Yahoo! Terms of Service. 
  


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





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 the Yahoo! Terms of Service.