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

[amibroker] AddtoComposite



PureBytes Links

Trading Reference Links

Once again, I turn to the smart people on this forum for help. I 
have code (from here) that creates composites of sectors and 
industries. I would like to also include a chart of the QuotesPlus 
QRS reading on a sector and industry basis. I thought it would be as 
easy as including a couple lines like: QRS=GetExtraData("QRS"); 
AddToComposite(QRS,"mySecName","QRS");. Then I realized that 
C,O,H,L,I, and X are the only fields available for ATC. So, I tried 
putting in AddToComposite(QRS,"mySecName","I"); but that didn't work 
either. I think it's a problem in the GetExtraData() call in that 
it's not getting the QRS for each stock and storing it in the "I" 
field.

As I thought about it more, I realized that just having the 
cummulative QRS for each stock in the composite is going to be 
meaningless since it should probably be an average. In that case, 
I'm going to need to calculate just how many stocks are in each 
sector/industry. That probably won't be a problem, but suggestions 
would be nice.

My code is below since my explanations are rarely very clear. Any 
help would be much appreciated. Even if it's just to give me 
something more to think about.

// use this in scan to calculate the composites for all sectors
SetBarsRequired(500,0);
QRS=GetExtraData("QRS");

for(a = 1; a < 40; ++a)
{
Filter = SectorID(0) == a;
secnam = "~Sec~" + SectorID(1);
AddToComposite( C , secnam, "C");
AddToComposite( O , secnam, "O");
AddToComposite( H , secnam, "H");
AddToComposite( L , secnam, "L");
AddToComposite( V/1000 , secnam, "V");
AddToComposite(QRS,secnam,"I");
Buy = 0;
}

for(a = 1; a < 110; ++a)
{
Filter = IndustryID(0) == a;
indnam = "~Ind~" + IndustryID(1);
AddToComposite( C , indnam, "C");
AddToComposite( O , indnam, "O");
AddToComposite( H , indnam, "H");
AddToComposite( L , indnam, "L");
AddToComposite( V/1000 , indnam, "V");
Buy = 0;
}

I've also tried putting the GetExtraData() call inside the for 
loops. In the end, a graphical representation of the composite QRS 
wouldn't be all that necessary (though nice). I would only need to 
reference the QRS in explorations on the composites.

Thank you, in advance.

Jeff





------------------------ Yahoo! Groups Sponsor --------------------~--> 
GFT Forex Trading Accounts As low as $250 with up to 400:1 Leverage. Free Demo.
http://us.click.yahoo.com/lpv1TA/jlQNAA/U1CZAA/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/