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

[amibroker] Re: JScripts - some debugging help needed



PureBytes Links

Trading Reference Links

William/Dingo,

Following line is a suspect -

>   oStocks = oAB.Stocks();

In AFL world, what are you expecting oStocks to be -- an AFL array, a 
constant, a string or a JScript array of objects? I could be wrong, 
but I don't think you can treat such return values in pure AFL world 
as if you were dealing with a JScript world. I'd think a more 
appropriate way to do it would be as follows, which does seem to 
work -

// ------------
EnableScript("JScript");
oAB = CreateStaticObject("Broker.Application");

// NOTE FOLLOWING TWO LINES
oStocks = oAB.Stocks();
dummyResults = oStocks.DummyFunction();

myVersion = oAB.Version();
myCount = 0;
<%
ab = new ActiveXObject( "Broker.Application" );
AFL("myCount") = ab.Stocks().Count;
%>
Filter=1;
AddColumn(myCount, "Count");
AddTextColumn(myVersion,"Version");
// --------------

Also, note the two lines where marked. It seems on return values like 
oStocks, AB doesn't complain if it can't find the called method. 
Actually I think that's going too far. AB doesn't probably even know 
what type it is unless it can convert the original return value 
(oStocks) into an array, a constant or a string. But that's just a 
guess. 

Hope this helps.

Jitu

--- In amibroker@xxxxxxxxxxxxxxx, "dingo" <dingo@xxxx> wrote:
> I liken it (creating an AB object within an AFL running in AB) to 
the
> ability to perform a recursion into my own navel.
>  
> d
> 
> -----Original Message-----
> From: William Peters [mailto:williampeters@x...] 
> Sent: Tuesday, December 30, 2003 11:56 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: RE: [amibroker] JScripts - some debugging help needed
> 
> 
> Dingo,
>  
> Your right, I've tried every combination that I could dredge up but 
the
> right one :) I'm sure Tomasz will come to the rescue...
> This is something I have tried in the past and just presumed it 
wasn't
> viable but its going to be very handy once we get the syntax.
> Regards,
> William Peters
> www.amitools.com <http://www.amitools.com/> 
> 
> -----Original Message-----
> From: dingo [mailto:dingo@x...]
> Sent: Tuesday December 30, 2003 11:38 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: RE: [amibroker] JScripts - some debugging help needed
> 
> 
> As you prolly did, I tried numerous combinations of things without 
any
> success..
>  
> Personally, I've had trouble with these thingys and getting the 
names of
> the objects correct, the legal methods, syntax, etc.
>  
> d
> 
> -----Original Message-----
> From: William Peters [mailto:williampeters@x...] 
> Sent: Tuesday, December 30, 2003 11:23 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: RE: [amibroker] JScripts - some debugging help needed
> 
> 
> When run in AA the following code returns a version number but not a
> stock count, it must be a syntax error (somewhere). Any help
> appreciated..
>  
> oAB = CreateStaticObject("Broker.Application");
> myVersion = oAB.Version();
> oStocks = oAB.Stocks();
> myCount = oStocks.Count();
> Filter=1;
> AddColumn(myCount, "Count");
> AddTextColumn(myVersion,"Version");
> 
> Thank you,
> William
>  
> -----Original Message-----
> From: William Peters [mailto:williampeters@x...]
> Sent: Tuesday December 30, 2003 10:06 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: RE: [amibroker] JScripts - some debugging help needed
> 
> 
> Tomasz,
>  
> Maybe you could clear something up.
>  
> The following code when run from Visual Basic will delete a ticker 
from
> an open AmiBroker database and you can see the ticker has been 
deleted
> without having to close and reopen AmiBroker. This code produces a
> syntax error when run from AA.
> 
> oAB = CreateObject("Broker.Application");
> Ticker = "XYZ";
> oAB.Stocks.Remove(Ticker);
> oAB.RefreshAll();
> Buy=1;
>  
> The following code will run without a syntax error but fails to 
delete a
> ticker:
> oAB = CreateObject("Broker.Application");
> oStocks = oAB.Stocks();
> Ticker = "XYZ";
> oStocks.Remove(Ticker);
> oAB.RefreshAll();
> Buy=1;
> 
> Any clues appreciated..
> 
> Regards,
> William  
> 
> 
>  -----Original Message-----
> From: Tomasz Janeczko [mailto:amibroker@x...]
> Sent: Tuesday December 30, 2003 9:12 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: Re: [amibroker] JScripts - some debugging help needed
> 
> 
> 
> 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 Janeczko
> amibroker.com
> 
> 
> 
> 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 
> 
> 
> 
> 
>   _____  
> 
> 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
> <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/> . 
> 
> 
> 
> 
> 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 
> 
> 
> 
>   _____  
> 
> 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
> <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/> . 
> 
> 
> 
> 
> 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 
> 
> 
> 
>   _____  
> 
> 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
> <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/> . 
> 
> 
> 
> 
> 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 
> 
> 
> 
> Yahoo! Groups Sponsor	
> 
> ADVERTISEMENT
>  
> 
<http://rd.yahoo.com/SIG=12c91ukag/M=267637.4116732.5333197.1261774/D=
eg
> 
roupweb/S=1705632198:HM/EXP=1072932995/A=1853619/R=0/*http://www.netfl
ix
> .com/Default?mqso=60178356&partid=4116732> click here	
>  
> <http://us.adserver.yahoo.com/l?
M=267637.4116732.5333197.1261774/D=egrou
> pmail/S=:HM/A=1853619/rand=362762265> 	
> 
> 
>   _____  
> 
> 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
> <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/> .


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:
 http://docs.yahoo.com/info/terms/