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

Re: [amibroker] Why works this function not?



PureBytes Links

Trading Reference Links


Hello,
 
IndustryID(0) returns  a number.
You can not add string to the number in AFL.  

You have to convert number to string first 
using WriteVal function:
 


Bull = CCI(<FONT 
color=#ff00ff size=2>20)><FONT color=#ff00ff 
size=2>0 ;
//Industries - Number of Bulls
AddToComposite(<FONT face=Arial 
size=2>Bull, "~i" 
+ <FONT face=Arial color=#0000ff 
size=2>WriteVal( IndustryID(), 1.0 ) <FONT 
size=2>,"C",<FONT 
color=#ff00ff size=2>1);
Buy=0<FONT face=Arial 
size=2>;
<FONT 
size=2><FONT 
size=2>Best regards,Tomasz Janeczkoamibroker.com
<BLOCKQUOTE 
>
----- Original Message ----- 
<DIV 
>From: 
Thomas Zmuck 

To: <A title=amibroker@xxxxxxxxxx 
href="">amibroker@xxxxxxxxxxxxxxx 
Sent: Saturday, October 26, 2002 8:51 
PM
Subject: [amibroker] Why works this 
function not?

Hello Tomasz and 
others,
<FONT face=Arial 
size=2> 
I want to create 
composite indicators with the following code:
IndustryID(0) 
should give the number of the industry, but it seems that it don't works in 
this combination.
Make I something 
wrong? I have tried the same formula with +<FONT face=Arial color=#0000ff 
size=2>name() instead +<FONT face=Arial 
color=#0000ff size=2>IndustryID() and this 
works.
<FONT face=Arial 
size=2> 
I hope for 
help
<FONT face=Arial 
size=2> 
<FONT face=Arial 
size=2>Thomas
<FONT face=Arial 
size=2> 

Bull = CCI<FONT 
size=2>(20<FONT 
size=2>)>0 
;
//Industries - Number of Bulls
AddToComposite(<FONT face=Arial 
size=2>Bull,<FONT color=#ff00ff 
size=2>"~i"+<FONT face=Arial 
color=#0000ff size=2>IndustryID()<FONT 
size=2>,"C",<FONT 
color=#ff00ff size=2>1);
Buy=0<FONT face=Arial 
size=2>;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 
Your use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service.