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

[amibroker] Re: How to plot "IndustryID"?



PureBytes Links

Trading Reference Links

The following afl code will link the industry avg to the current 
stock.
downhillspeedster

// !!!!!!!!!!!!!!!!!! ******** cut here ********** !!!!!!!!!!!!!!


IndustryIDNumber = IndustryID();
EnableScript("VBscript"); 
 
<%

IndNum = AFL("IndustryIDNumber")
If IndNum = 0 Then
      AFL.Var("IG_AFL") = "NoGrp"
End If
If IndNum > 0  AND IndNum <= 9 Then
      IDprefix = "!ID00" 
     AFL.Var("IG_AFL") = IDprefix +  Cstr(IndNum)
End If
If IndNum >= 10 AND IndNum <= 99 Then
      IDprefix = "!ID0" 
      AFL.Var("IG_AFL") = IDprefix +  Cstr(IndNum)
End If
If IndNum >=100 Then
      IDprefix = "!ID"  
      AFL.Var("IG_AFL") = IDprefix +  Cstr(IndNum)
End If

%>
_N(MarketSymbol = StrLeft(IG_AFL,6) ) ;
Filter = 1;
AddColumn(C, "Close", 1.2);
AddColumn(IndustryID(), "IndustryID", 1.0);
AddColumn( Foreign(MarketSymbol, "C"), WriteIf
(1==1,MarketSymbol,MarketSymbol), 1.2); 

// !!!!!!!!!!!!!!!!!! ******** cut here ********** !!!!!!!!!!!!!!

--- In amibroker@xxxxxxxxxxxxxxx, "chuckitall59" <chuckitall59@xxxx> 
wrote:
> I use QP2 as my data source and would dearly love to be able to 
look 
> at a stock chart along with a chart for it's IRL symbol ("Industry" 
> in AB)to see if it's "peers" are doing well.  
> 
> For example; lets suppose I'm interested in a preliminary look 
> at "COH". Referring to QP2, after some searching I find "COH" is in 
> the "Retail-Apparel/shoe" sector and has the IRL symbol "!ID177" 
> which is what I want to plot and corresponds to Amibroker industry 
> #177.  
> 
> Now back to AB: if I try and use the following code:
> Plot(IndustryID(0),"Industry ID",colorRed,styleLine); I get a 
> straight red line at level 177. Changing the "0" to "1" gives me 
> a "systax error"
> As a non programmer, I'm sure I'm missing something incredibly 
simple.
>  
> Can anyone point me in the right direction?
> 
> TIA,
> 
> Chuck


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading!
Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/aM1XQD/od7FAA/uetFAA/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/