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

RE: [amibroker] How to find new companies 1-5 year range



PureBytes Links

Trading Reference Links

>From the help files

Tutorial: Portfolio-level backtesting
USING POSITION SCORE 

You can use new PositionScore variable to decide which trades should be
entered if there are more entry signals on different securities than maximum
allowable number of open positions or available funds. In such case
AmiBroker will use the absolute value of PositionScore variable to decide
which trades are preferred. See the code below. It implements simple MA
crossover system, but with additional flavour of preferring entering trades
on symbols that have low RSI value. If more buy signals occur than available
cash/max. positions then the stock with lower RSI will be preferred. You can
watch selection process if you backtest with "Detailed log" report mode
turned on.

The code below includes also the example how to find optimum number of
simultaneously open positions using new Optimization in Porfolio mode.

/*****
** REGULAR PORTFOLIO mode 
** This sample optimization
** finds what is optimum number of positions open simultaneously
** 
****/

SetOption("InitialEquity", 20000 );
SetTradeDelays(1,1,1,1);
RoundLotSize = 1; 

posqty = Optimize("PosQty", 4, 1, 20, 1 );
SetOption("MaxOpenPositions", posqty);

// desired position size is 100% portfolio equity
// divided by PosQty positions

PositionSize = -100/posqty; 

// The system is very simple...
// MA parameters could be optimized too...
p1 = 10;
p2 = 22;
// simple MA crossover
Short=Cross( MA(C,p1) , MA(C,p2) );
Buy=Cross( MA(C,p2) , MA(C,p1) );
// always in the market 
Sell=Short; 
Cover=Buy;

// now additional score 
// that is used to rank equities 
// when there are more ENTRY signals that available
// positions/cash
PositionScore = 100-RSI(); // prefer stocks that have low RSI;



Cheers,
Graham
http://e-wire.net.au/~eb_kavan/

-----Original Message-----
From: Collectable Images [mailto:telecard@xxxxxxxxxxxxxx] 
Sent: Tuesday, June 29, 2004 3:43 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] RE: PosQty and which trades are selected in backtester

How does Amibroker determine which stocks are traded when PosQty is defined
and more trade signals are generated than available trade positions?

When I reduce the PosQty number results are generally better but how do I
know whcih are selected in real time?




Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links



 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/