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

[amibroker] Re: New to Ami Broker - Quant Model



PureBytes Links

Trading Reference Links

Julien,

Many ways to create/reproduce this in AB. First have alook in the manual, in particular the rotational trading sections, e.g. search for EnableRotationalTrading. This is AB's native approach.

Second, if you need more flexibility, via the RMath plug-in you can fill your own (array)matrices with scores, and then rank them. Assuming you have the underlying data, and you've looped through your Group, WL, etc. to assign your factors per security via VarSet(), you can then assign them to an R matrix, and average, rank, etc. these. See example below, where I basically fill a matrix with the short rates for the G10 currencies.

TotYld = 0;
YldString = "";
for ( b = 0; (CurrStr = StrExtract( ListCurrMnem, b ) ) != "" ; b++ )
{
	Yld1 = VarGet(NaamYld+CurrStr);
	TotYld = TotYld + Yld1;
	
	RMathSetArray(Nz(Yld1),NaamYld+CurrStr);
	
	if (b<9) YldString = YldString + NaamYld+CurrStr+"," ;
	else YldString = YldString + NaamYld+CurrStr;
}

	
RMathProcedure("Yld_Mat<-cbind("+YldString+")");
RMathProcedure("Yld_Med<-apply(Yld_Mat,1,median)");
RMathProcedure("Yld_Rnk<-apply(Yld_Mat,1,rank)");
DatForm = "%d-%m-%Y";
//RMathProcedure("MatR<-zoo(RMat[,1:3], as.Date(Datum,\""+DatForm+"\"))");
RMathProcedure("Z_YldMatMed<-zoo(Yld_Med, as.Date(Datum,\""+DatForm+"\"))");
//RMathDebugOn();
RMathProcedure("Z_YldMatRnk<-zoo(t(Yld_Rnk), as.Date(Datum,\""+DatForm+"\"))");

Hope this helps & good luck.

PS

--- In amibroker@xxxxxxxxxxxxxxx, "jraynal1" <jraynal1@xxx> wrote:
>
> Hi,
> 
> Being new to Ami Broker, I had a couple questions with regard to the software. I have a model that creates a stock ranking system (z-score aggregate model).  Basically, each stock in the universe is 'scored' or ranked based on a series of fundamental and technical factors. For example, let's say that P/E ratio must be below 15 and below the stock's industry P/E.  Once a ranking system has been built, buy and sell signals are created based on technical factors.  It appears that this process is called "exploration" in AB. 
> 
> Could someone tell me if they have had any experience building ranking systems in AB?
> If so, can you use those ranking systems for back-testing?  Can you rank based on fundamental factors?  If so, can you compare stock factors to industry factors (or sectors)?
> 
> Thanks for any feedback.
> 
> julien
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/