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

[amibroker] Bug or Dumb Programming Error?!? Please help.



PureBytes Links

Trading Reference Links

Hi,

I've been making lots of progress with AFL, but I ran into something 
that I don't understand.   Is this a bug or just a dumb programming 
error on my part?  

I'm trying to create three line charts in one pane that plot the 
relative strength of:

- The current symbol to it's industry (using TC2005 Industry symbols)
- The current symbol to the market (using the S&P 500 as a default)
- The symbol's industry to the market.

The code is below.   

The good news is that the Symbol to Industry and Symbol to Market 
relative strength plots display fine and appear to be correct.  

The bad news is that the Industry to Market relative strength plot 
has the exact same value as the Symbol to Industry relative strength 
plot!  It plots under the Symbol to Industry line!   I.e., instead 
of three lines, there are only two.  

At first glance, it appears that the SetForeign() function is not 
working.   On closer inspection however, the symbols displayed in 
the title are correct! Using the symbol "ALE" as an example, the 
title displays for 6/02/2005:

ALE - Relative Strength (ALE to MG914) = 194.07, (ALE to SP500) = 
40.68, (MG914 to SP-500) = 194.07

All of the Title symbols appear to be correct.   However, the "ALE 
to MG914" Relative Strength value is the same as the "MG914 to SP-
500" Relative Strength value.   This is NOT correct.

I'm perplexed!  Is there anything I'm missing here?   Stupid 
programming error?  

I'd appreciate any help.

Thanks and regards,

Dan.

----

//Note - This code only works where the industry symbol 
//has been set in  "Symbol -> Categories -> Industries".   

_SECTION_BEGIN("Relative Strength");
// Get Symbols
MktBaseSymbol = ParamStr("Market Base Symbol", "SP-500" ); 
IndustrySymbol = GetBaseIndex() ;

StockToIndColor = ParamColor( "Stock to Industry Color", 
colorOrange ); 
StockToIndStyle = ParamStyle("Stock To Industry Style", styleLine + 
styleNoLabel + styleOwnScale) | styleDots  ;  

StockToMktColor = ParamColor( "Stock to Market Color", colorRed ); 
StockToMktStyle = ParamStyle("Stock To Market Style", styleLine + 
styleNoLabel + styleOwnScale) ;  

IndToMktColor = ParamColor( "Industry to Market Color", colorGold ); 
IndToMktStyle = ParamStyle("Industry To Market Style", styleLine + 
styleNoLabel + styleOwnScale) ;  


// Plot Relative Strength - Stock To Industry 
Plot( RelStrength(IndustrySymbol ), _SECTION_NAME() + " (" + Name() 
+ " to " + IndustrySymbol + ")", StockToIndColor ,StockToIndStyle );

// Plot Relative Strength - Stock To Market
Plot( RelStrength(MktBaseSymbol ), " (" + Name() + " to " + 
MktBaseSymbol +  ")", StockToMktColor , StockToMktStyle );

// Now plot relative Strength - Industry to Market
SetForeign(MktBaseSymbol , True, True); 

//SetForeign(IndustrySymbol, True, True); 
Plot( RelStrength(IndustrySymbol) ,  " (" + IndustrySymbol+ " to " 
+Name()+ ")", IndToMktColor , IndToMktStyle );

if( Status("action")==actionCommentary )
{ printf("(Interpretation is not available yet)");}
_SECTION_END();




------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/