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

Re: [amibroker] exits in portfolio test mode



PureBytes Links

Trading Reference Links

Hello,

Just do the following:

AbsRank = ... that gives the rank 0...100 for candidates for trading no matter if long or short - 100 - very good candidate, 1- poor
UpTrend = the formula that gives True if market is going up and False when going down

PositionScore = IIF( UpTrend, AbsRank, -AbsRank );

This is if you have the rank that scores candidates for trading regardless of market condition

If you on the other hand have only formula that assigns positive ranks for good longs and
negative ranks for good shorts AND you have some external 'trend' indicator than you can do the following:

Rank = -100....100 - depending if good short (negative) or good long (positive) candidate
UpTrend = True if uptrend False otherwise

PositionScore = IIF( UpTrend AND Rank > 0, Rank, 0 ) + IIF( NOT UpTrend AND Rank < 0, Rank, 0 );

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "Dave Merrill" <dmerrill@xxxxxxx>
To: "AmiBroker" <amibroker@xxxxxxxxxxxxxxx>
Sent: Tuesday, September 30, 2003 9:56 PM
Subject: [amibroker] exits in portfolio test mode


> (tomasz, I know you're not really providing support for portfolio backtest
> mode yet, since it's an early beta of it, so ignore this question if you
> want.)
>
> say I have a system that goes long or short, depending on some overall
> market signal, buying or shorting the top 10 stocks when ranked by some
> criteria. the first buy signal comes in, the stocks in the system's universe
> are ranked, and the top 10 get bought.
>
> now the market signal switches to short. what should happen is that all
> longs currently held should be sold, and the top 10 stocks (ie lowest
> negative scores) should get shorted.
>
> how should I arrange this? if I just rank all the potential shorts I want
> and zero the scores of the rest, that will short the lowest 10, but won't
> ensure that the existing longs get sold first. if I set the existing longs
> to zero, that'll sell them, but exclude them from the short screen happening
> at the same time.
>
> it seems like I'd need to zero out all but the top 10 shorts, but I can't
> know what they are in any easy way. there's probably some sophisticated way
> to find out, like PT did, but that defeats the ease of use of the new
> portfolio mode.
>
> or am I thinking about this wrong? does entering a short position
> automatically exit any existing long positions on the same stock? does that
> happen before positionsize allocations are done, so the long position is
> recognized as needing to be filled by some short?
>
> thanks,
>
> Dave Merrill
>
>
>
> Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/