PureBytes Links
Trading Reference Links
|
Hello,
John is correct. StrFormat uses the same formatting like
C/C++ printf/sprintf.
There is ONE caveat however: there are NO integers in AFL -
all numbers are FLOATS, therefore
you have to use %f, %g, %e sequences since
(integer-only) %d, %x will not work.
Best regards,Tomasz Janeczkoamibroker.com
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
john gibb
To: <A title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Tuesday, December 30, 2003 3:26
PM
Subject: Re: [amibroker] Industry
groups
Hi Dave,
perhaps I don't understand your question, but i
think TJs formatting-numbers conventions derive from something
like:
<A
href="">http://www.cplusplus.com/ref/cstdio/printf.html
-john
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
Dave Merrill
To: <A title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Tuesday, December 30, 2003 4:06
AM
Subject: RE: [amibroker] Industry
groups
<SPAN
class=475475611-30122003>Nice idea Jason, thanks.
<SPAN
class=475475611-30122003>
I
think I found a simpler way of generating the name of the QuotesPlus
industry index from its industry ID:
<SPAN
class=475475611-30122003>
<SPAN
class=475475611-30122003>industry_id = IndustryID(0);industry_index =
"!ID" + StrFormat("%003.0f", industry_id);
<SPAN
class=475475611-30122003>
<SPAN
class=475475611-30122003>While that does appear to work with 1- to 3-digit
industry IDs, I got there by trial and error; I'm not familiar with this
type of format string, which I assume is standard in some
programming language(s) I don't know. The docs say only: "for numbers
always use %f, %e or %g formatting, %d or %x will not work because there are
no integers in AFL."
<SPAN
class=475475611-30122003>
<SPAN
class=475475611-30122003>Can someone point me to information on this?
Tomasz?
<SPAN
class=475475611-30122003>
<SPAN
class=475475611-30122003>Thanks,
<SPAN
class=475475611-30122003>
<SPAN
class=475475611-30122003>Dave
<BLOCKQUOTE
>
QP users may
find this useful.
<SPAN
class=309413907-29122003>
<SPAN
class=309413907-29122003><SPAN
class=309413907-29122003> Since QP provides us with an industry group
index for each of their industry groups (!ID001-198) it is a simple matter
to call that index as a foreign ticker when we select a stock. Just
copy the code to a free pane and it will plot the appropriate
industry group index.
<SPAN
class=309413907-29122003>
Regards,
Jayson
<FONT
color=#282828 size=2>
L1=<FONT
face=Arial>"!ID00"<FONT
size=2>+IndustryID(<FONT
size=2>0<FONT face=Arial
color=#000000>);
L2=<FONT
face=Arial>"!ID0"<FONT
size=2>+IndustryID(<FONT
size=2>0<FONT face=Arial
color=#000000>);
L3=<FONT
face=Arial>"!ID"<FONT
size=2>+IndustryID(<FONT
size=2>0<FONT face=Arial
color=#000000>);
industry=<FONT
face=Arial>WriteIf<FONT
size=2>(IndustryID(<FONT
size=2>0) <10<FONT
size=2>,l1,WriteIf(<FONT
size=2>IndustryID(0<FONT
size=2>)>9 <FONT
size=2>AND<FONT
color=#000000> IndustryID<FONT
size=2>(0)<<FONT
size=2>100<FONT face=Arial
color=#000000>,l2,L3));
SetForeign<FONT
color=#282828 size=2><FONT face=Arial
color=#000000>(industry);
Plot<FONT
face=Arial>(<FONT
size=2>C<FONT
color=#000000>,IndustryID<FONT
size=2>(1),<FONT
size=2>colorWhite<FONT
color=#000000>,<FONT
size=2>64<FONT face=Arial
color=#000000>);
Plot<FONT
face=Arial>(<FONT
size=2>MA(<FONT
size=2>C<FONT
color=#000000>,20<FONT
size=2>),"",<FONT
size=2>colorBlue<FONT
color=#000000>,<FONT
size=2>1<FONT face=Arial
color=#000000>);
Plot<FONT
face=Arial>(<FONT
size=2>MA(<FONT
size=2>C<FONT
color=#000000>,50<FONT
size=2>),"",<FONT
size=2>colorYellow<FONT
color=#000000>,<FONT
size=2>1<FONT face=Arial
color=#000000>);
Title<FONT
face=Arial>="Industry
Group = "+IndustryID<FONT
size=2>(1)+ "
("+industry+")"<FONT
color=#282828
size=2>;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.
|