Thank both rowland and Howard for your suggestions.

After using SetBacktestMode( backtestRegularRaw ), I got what I was looking for 
- that is stocks are picked strictly according to the PositionScore rankings. 
If the default SetBacktestMode is used, then the stocks are picked differently. 
In the Amibroker User Guide, it says: "If trade is NOT entered on first entry 
signal due to weak rank, not enough cash or reaching the maximum open position 
count, subsequent entry signals are ignored until matching exit signal". I 
still don't fully understand how exactly the stocks are picked if the default 
SetBacktestMode is used, but it does not matter too much to me now. 

Thanks,
TM




________________________________
From: re_rowland <[email protected]>
To: [email protected]
Sent: Wed, April 7, 2010 7:39:13 AM
Subject: [amibroker] Re: Question about PositinScore in backtesting

  
Howard's statement that  "Rotational trading is...is limited by the inability 
to use Buy and Sell signal, Stops, Timed exits, and other techniques." is not 
entirely accurate when using AmiBroker.

Buy and Sell signals can be easily included into the PositionScore.  Just 
simply multiply the PositionScore by 1 if on a "buy" and by 0 if on a sell".  
Additionally, the full range of Stop functions are used by the Rotational Mode 
in AmiBroker.  Other techniwues can also be accommodated.

--- In amibro...@yahoogrou ps.com, Howard B <howardbandy@ ...> wrote:
>
> Hi Tony --
> 
> There is a trading system methodology known as "rotational trading" where a
> watchlist is evaluated every bar and those issues that have the highest
> PositionScore are selected.  To enable rotational trading, the afl needs
> this statement:
> EnableRotationalTra ding();
> 
> When using rotational trading, Buy, Sell, Short, and Cover statements are
> ignored.  Only PositionScore matters.  Trading takes place at the Open or
> Close depending on the settings of BuyPrice, SellPrice, ShortPrice, and
> CoverPrice.  Trading takes place with the delay between signal and execution
> according to the settings of SetTradeDelays( n,n,n,n);
> 
> Rotational trading was very popular in the 1990s for switching among mutual
> funds, and continues to have some following.  Rotational trading is a subset
> of general trading, and is limited by the inability to use Buy and Sell
> signal, Stops, Timed exits, and other techniques.
> 
> Review the AmiBroker User's Guide for details.
> 
> ------------ ---------
> 
> If the afl does not have rotational trading enabled, then PositionScore is
> used to break ties only when new entries are being considered.  In the
> situation you describe, the ten issues selected on day one from more than
> ten candidates are those that have the highest PositionScore on that day.
> On day two there are three available slots.  The three that will be chosen
> are the three that have the highest PositionScore from among those
> candidates that have Buy signals that day.  Issues that have already been
> purchased do not have their PositionScore evaluated and will not be sold
> simply because of a low PositionScore.  After they have been sold due to a
> Sell signal, or execution of a stop, they then rejoin the pool of candidates
> and will have their PositionScore calculated in anticipation of competing
> for entry at the next Buy signal.
> 
> Thanks,
> Howard
> 
> 
> 
> 
> 
> On Sat, Apr 3, 2010 at 8:27 PM, Tony M <pqj...@...> wrote:
> 
> >
> >
> > My formula generates a lot of signals every day, and my max position is set
> > to 10. So I use a PositionScore to rank the stocks that have a buy signal
> > and buy at the open the next day. On the first day of backtesting, the top
> > ten stocks ranked by PositionScore are picked and bought. This is exactly
> > what I want it to happen. At the closing of first day, three stocks meet the
> > exit criteria and get sold. On the second day backtesting, there are total
> > seven old positions and three new stocks are bought. However the three new
> > stocks get selected are not the highest ranking stocks in the PositionScore
> > list. The three stocks are ranked No. 3rd, 18th and 25th in the
> > PositionScore list. This is very puzzling to me. My formula is very simple
> > and is like this:
> > BUY = condition1 and condition2 and condition3;
> > PosQty = 10;
> > SetOption("MaxOpenP ositions" , PosQty );
> > PositionSize = -100/PosQty;
> > SetTradeDelays( 1,0,0,0);
> > BuyPrice = Open;
> > Sell = sell_condition;
> > SellPrice = Close;
> > PositionScore= 100-RSI(14) ;
> >
> > My question is why PositionScore works perfectly on the first day of
> > backtesting, but not the days thereafter? I have been working on this
> > question for quite a few days, but I just couldn't find an answer. Can
> > anyone here help me on this?
> >
> > Thanks,
> > Tony
> >
> > 
> >
>


 


      

Reply via email to