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

[amibroker] Re: PositionScore Ideas



PureBytes Links

Trading Reference Links

FWIW...

I just had a short exchange with TJ and either of two actions will
prevent this situation on backtests. 

Either:
 
      SetOption("AllowPositionShrinking",False);
or
      You can also increase "MinShares" setting ...

Thanks for clearing this up Tomasz.

Phsst

--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx>
wrote:
> Hello,
> 
> I have found the reason why your report shows positive avg dollar
profit while showing negative avg PERCENT profit.
>  
> Reason is that you are using fixed $30 commissions per trade and
this causes
> that certain trades of that have small position value loose a lot
(in percent).
> 
> This influences average PERCENT gain/loss since it is calculated as
AVERAGE of PERCENT profit/loss
> per trade, so this average becomes negative. 
> 
> See the few top trades from your trade list. Take a look at two
trades IBM and PDG.
> They are all very small (20 and 6 shares respectively) so fixed $30
commission each way generates loss
> of -14.17% and -39.20% respectively.
> 
> Now calculating AVERAGE PERCENT p/l is summing % p/l of individual
trades and dividing them by the number of
> trades leads to NEGATIVE percent p/l EVEN though system EARNED money.
> 
> This is so because big percent looses happen only on VERY SMALL
trades (trades that have very small dollar value).
> Thus big percent looses in such small trades do not really affect
profit of entire portfolio.
> 
> 
>       Ticker Trade Entry  Exit  Change Profit Profit % Shares Pos
value Cum Profit # bars Profit/bar MAE/MFE 
>       SMTC Long 1995-06-01 2,03125 1995-06-02 2,07813 2,31% 401,53
2,01% 9846 19999,69 401,53 2 200,77 0,00% 6,15% 
>       VRTS Long 1995-06-01 1,28395 1995-06-02 1,25103 -2,56% -572,5
-2,86% 15567 19987,26 -170,96 2 -286,25 -2,56% 0,00% 
>       COMS Long 1995-06-01 6,67969 1995-06-02 6,8099 1,95% 329,32
1,65% 2990 19972,26 158,36 2 164,66 -0,39% 3,70% 
>       INTC Long 1995-06-01 7,03125 1995-06-02 7,08594 0,78% 95,26
0,48% 2839 19961,72 253,62 2 47,63 -0,11% 2,89% 
>       CDWC Long 1995-06-01 6,5 1995-06-02 6,625 1,92% 323,25 1,62%
3066 19929,00 576,87 2 161,63 -2,56% 1,92% 
>       EMC Long 1995-06-02 2,90625 1995-06-05 2,98438 2,69% 480,7
2,39% 6921 20114,16 1057,57 2 240,35 -2,15% 2,69% 
>       ORCL Long 1995-06-02 2,62963 1995-06-05 2,74074 4,23% 788,89
3,93% 7640 20090,37 1846,46 2 394,44 -2,82% 4,23% 
>       AIG Long 1995-06-02 17,9358 1995-06-05 18,4494 2,86% 514,7
2,56% 1119 20070,16 2361,16 2 257,35 -0,11% 3,30% 
>       VLO Long 1995-06-02 14,406 1995-06-05 14,4898 0,58% 56,59
0,28% 1392 20053,15 2417,75 2 28,29 -0,58% 0,58% 
>       MBG Long 1995-06-05 34 1995-06-06 33,75 -0,74% -210,25 -1,03%
601 20434,00 2207,5 2 -105,13 -0,74% 0,37% 
>       STJ Long 1995-06-05 14,75 1995-06-06 14,75 0,00% -60 -0,29%
1385 20428,75 2147,5 2 -30 -0,85% 0,56% 
>       FHCC Long 1995-06-05 7,875 1995-06-06 7,96875 1,19% 183 0,90%
2592 20412,00 2330,5 2 91,5 0,00% 3,17% 
>       BDX Long 1995-06-05 14,5313 1995-06-07 14,2813 -1,72% -411
-2,01% 1404 20401,88 1919,5 3 -137 -1,72% 0,00% 
>       IBM Long 1995-06-05 22,9375 1995-06-07 22,6875 -1,09% -65
-14,17% 20 458,75 1854,5 3 -21,67 -1,91% 1,91% 
>       EMC Long 1995-06-06 2,9375 1995-06-07 2,90625 -1,06% -276,47
-1,36% 6927 20348,06 1578,03 2 -138,23 -1,06% 1,60% 
>       IACI Long 1995-06-06 3,4375 1995-06-07 3,5 1,82% 309,75 1,52%
5916 20336,25 1887,78 2 154,88 0,00% 5,45% 
>       SDS Long 1995-06-06 6,03125 1995-06-07 6,0625 0,52% 45,28
0,22% 3369 20319,28 1933,06 2 22,64 0,00% 2,07% 
>       PDG Long 1995-06-06 24,875 1995-06-08 25,125 1,01% -58,5
-39,20% 6 149,25 1874,56 3 -19,5 -1,51% 2,01% 
>       GG Long 1995-06-07 2,90625 1995-06-08 2,90625 0,00% -60 -0,30%
6997 20335,03 1814,56 2 -30 -1,08% 0,00% 
>       GDW Long 1995-06-07 16,0417 1995-06-08 16,125 0,52% 45,5 0,22%
1266 20308,75 1860,06 2 22,75 -0,52% 1,30% 
>            Avg profit: Avg % profit:       
>            +93,0025 -2,17%        
> 
> Hope this helps.
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message ----- 
> From: "Phsst" <phsst@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Monday, December 15, 2003 4:58 AM
> Subject: [amibroker] Re: PositionScore Ideas
> 
> 
> Chuck,
> 
> FWIW, I exported the trade list from the backtest I posted, and then
> processed the trades with my own reporting program that I used prior
> to introduction of Portfolio trading in AB.
> 
> The reported Net Profit I posted matched. As did the calculated Risk
> Adj RAR. So the other figures that you found issues with are in
> question (I did not calc those figures in my own program).
> 
> I've heard from TJ... apprised him of the figures you pointed out, and
> at his request sent everything related to the backtest to him for
> analysis.
> 
> We will see.
> 
> Phsst 
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Phsst" <phsst@xxxx> wrote:
> > Greg, Chuck & Gary,
> > 
> > No 'bother' Greg. 
> > 
> > And thanks to Chuck for his hints regarding applying recent negative
> > pullbacks. 
> > 
> > I haven't heard back from TJ yet concerning the reporting issues of my
> > backtest.
> > 
> > Tonight I'll export the trades to XL and at least verify that Net
> > Profit calcs were or were not correct. Also, I have my own program
> > that than take that data and verify Risk Adj RAR.
> > 
> > And finally, I'll take a look at the QRSRaw calc that Gary posted to
> > see if it approximates the QRS rank.
> > 
> > Phsst
> > 
> > 
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "Chuck Rademacher"
> > <chuck_rademacher@x> wrote:
> > > Greg,
> > > 
> > > FWIW, I don't think you want to do this (below).    I don't see how
> > you can
> > > compare absolute dollar returns for different stocks.   I'm sure
> > that you
> > > will want to divide rather than subtract.
> > > 
> > > Also, see postings by Phsst regarding the results below.   They
> are very
> > > suspect for lots of reasons.   You can't have a positive CAR with a
> > negative
> > > average return per trade.
> > > 
> > > I'll also let you in on a big secret!    I can't provide the exact
> code
> > > (sorry), but I think you will find that negatively applying the
> > return for
> > > the last few days (weeks?) to this formula will dramatically help a
> > > short-term system.   In other words, add up the returns like you are
> > already
> > > doing and then subtract the returns for the most recent period.  
> > This helps
> > > to buy stocks that have been rising but are experiencing a
pull-back.
> > > 
> > > I am trading one fund using this technique and it has been working
> very
> > > well.   I'm aware of two other hedge funds that have been trading
> > this way
> > > for more than 15 years and the performance of each has been stellar!
> > >   -----Original Message-----
> > >   From: Greg [mailto:gregbean@x...]
> > >   Sent: Sunday, December 14, 2003 3:06 PM
> > >   To: amibroker@xxxxxxxxxxxxxxx
> > >   Subject: Re: [amibroker] Re: PositionScore Ideas
> > > 
> > > 
> > >   Phsst,
> > > 
> > >   The return doesn't look so good for RSW. Could you please try
> > comparison
> > > using the following formula instead . I'm not sure that the original
> > formula
> > > I provided should have been as a percent. Maybe it makes a
> difference ??
> > > 
> > >   // RSWraw = .4*(Total Return 13-Week)+.3*(Total Return
> > 26-Week)+.3*(Total
> > >   Return 1-Year)
> > >   tr13 = 0.4 * (C - Ref(C, -65));
> > >   tr26 = 0.3 * (C - Ref(C, -130));
> > >   tr52 = 0.3 * (C - Ref(C, -260));
> > >   RSWraw = tr13 + tr26 + tr52;
> > >   PositionScore = RSWraw;
> > > 
> > >   Sorry to bother you again.
> > > 
> > >   Greg
> > > 
> > > 
> > > 
> > > 
> > >     ----- Original Message -----
> > >     From: Phsst
> > >     To: amibroker@xxxxxxxxxxxxxxx
> > >     Sent: Saturday, December 13, 2003 6:30 PM
> > >     Subject: [amibroker] Re: PositionScore Ideas
> > > 
> > > 
> > >     Greg,
> > > 
> > >     This backtest comparison is for illustrative purposes only. I
> > make no
> > >     claims regarding these test results other than the AFL and Setup
> > >     criteria was identical for both tests. The only difference
was the
> > >     assignment of PositionScore = QRS versus PositionScore = RSW.
> > > 
> > >     NOTE:
> > > 
> > >     // RSW = .4*(Total Return 13-Week)+.3*(Total Return
> > 26-Week)+.3*(Total
> > >     Return 1-Year)
> > >     tr13 = 0.4 * (C - Ref(C, -65)) / Ref(C, -65) * 100;
> > >     tr26 = 0.3 * (C - Ref(C, -130)) / Ref(C, -130) * 100;
> > >     tr52 = 0.3 * (C - Ref(C, -260)) / Ref(C, -260) * 100;
> > >     RSW = tr13 + tr26 + tr52;
> > >     PositionScore = RSW;
> > > 
> > >     Date Range 6/1/1995 to Present (No QRS scores exist prior to
this)
> > > 
> > >     Direct comparison:
> > > 
> > >           RSW SCORE            QRS SCORE
> > >           Long trades            Long trades
> > >     Initial capital      100000            100000
> > >     Ending capital      22984180      190338380
> > >     Net Profit      22884180      190238380
> > >     Net Profit %      22884.18%      190238.38%
> > >     Exposure %      94.25%            94.16%
> > >     Net RAR %      24280.98%      202035.63%
> > >     Annual Return %      89.07%              142.19%
> > >     Risk Adj Retn %      94.50%            151.01%
> > > 
> > >     All trades      7431 (100.00 %)      7487 (100.00 %)
> > >     Avg. Profit/Loss      3079.56 25409.16
> > >     Avg. Profit/Loss %      -4.16%      -2.88%
> > >     Avg. Bars Held               2.65      2.63
> > > 
> > >     Winners               3829 (51.53 %)      4066 (54.31 %)
> > >     Total Profit      64437022.92      436648089.7
> > >     Avg. Profit      16828.68      107390.09
> > >     Avg. Profit %      3.10%            3.13%
> > >     Avg. Bars Held      2.33            2.33
> > >     Max. Consecutive      17      17
> > >     Largest win      978262.15      7798920.06
> > >     # bars in largest win      2      2
> > > 
> > >     Losers      3602 (48.47 %)            3421 (45.69 %)
> > >     Total Loss      -41552842.92      -246409709.4
> > >     Avg. Loss      -11536.05      -72028.56
> > >     Avg. Loss %      -11.88%            -10.03%
> > >     Avg. Bars Held      2.98            2.99
> > >     Max. Consecutive      13      12
> > >     Largest loss      -542767            -4301835.5
> > >     # bars in largest loss      6      6
> > > 
> > >     Max. trade drawdown      -610851.92      -4864832.72
> > >     Max. trade % drawdown      -98.69%            -99.67%
> > >     Max. system drawdown      -2119041.36      -15587244.83
> > >     Max. system % drawdown      -34.68%            -27.63%
> > >     Recovery Factor      10.8            12.2
> > >     CAR/MaxDD      2.57            5.15
> > >     RAR/MaxDD      2.72            5.46
> > >     Profit Factor      1.55            1.77
> > >     Payoff Ratio      1.46            1.49
> > >     Standard Error      2982472.3      25676798.01
> > >     Risk-Reward Ratio      0.44      0.38
> > >     Ulcer Index      12.1            7.64
> > >     Ulcer Performance Index      6.92      17.9
> > >     Sharpe Ratio of trades      -0.72      -0.86
> > >     K-Ratio                       1.09      0.93
> > > 
> > >     FWIW, I have some other systems / variations that I'll run a
> RSW vs.
> > >     QRS comparison on. If there are any notable improvements to
> the RSW
> > >     results, I'll post them.
> > > 
> > >     Regards,
> > > 
> > >     Phsst
> > > 
> > >     --- In amibroker@xxxxxxxxxxxxxxx, "Greg" <gregbean@xxxx> wrote:
> > >     > Phsst,
> > >     >
> > >     > Yes I think it is (Total Return 13-Week) means (Pct Price
> gain in
> > >     > 13-Weeks). The terms are from ValueLine, I think.
> > >     > http://www.valueline.com/
> > >     >
> > >     > IBD definition of Relative Strength:
> > >     >
> > >     >  Relative Price Strength (RS) Rating or Relative
> StrengthThis IBD
> > >     SmartSelect® Corporate Rating measures each stock's price
> > performance
> > >     over the latest twelve months compared to all other stocks. The
> > rating
> > >     scale ranges from 1 (lowest) to 99 (highest). Stocks rating
> below 70
> > >     indicate weaker or more laggard relative price performance.
> > >     > http://www.investors.com/
> > >     >
> > >     >
> > >     > Greg
> > >     >
> > >     >   ----- Original Message -----
> > >     >   From: Phsst
> > >     >   To: amibroker@xxxxxxxxxxxxxxx
> > >     >   Sent: Saturday, December 13, 2003 4:52 PM
> > >     >   Subject: [amibroker] Re: PositionScore Ideas
> > >     >
> > >     >
> > >     >   Greg,
> > >     >
> > >     >   I'll be happy to do a comparison on just about anything that
> > might
> > > be
> > >     >   comparable to IDB's RS Rank.
> > >     >
> > >     >   I assume that (Total Return 13-Week) means (Pct Price
gain in
> > >     >   13-Weeks), and so on?
> > >     >
> > >     >   Worth noting here, that IDB's RS Rank is a score between 1
> > and 100
> > >     >   that ranks each particular stock against the whole mkt
for the
> > >     past year.
> > >     >
> > >     >   But for positionscore pusposes, we are not limited to a
> > score of 1 -
> > >     >   100, so I can do the raw comparison of results from your
> formula
> > >     to QRS.
> > >     >
> > >     >   I'll post back later under this same Subject.
> > >     >
> > >     >   Regards
> > >     >
> > >     >   Phsst
> > >     >
> > >     >
> > >     >   --- In amibroker@xxxxxxxxxxxxxxx, "Greg" <gregbean@xxxx>
> wrote:
> > >     >   > Hi Phsst.
> > >     >   >
> > >     >   > Here is a formula that I have been told closely follows
> > that of
> > > IBD.
> > >     >   Could you please do the comparison you offered ?
> > >     >   >
> > >     >   > RSW = .4*(Total Return 13-Week)+.3*(Total Return
> > > 26-Week)+.3*(Total
> > >     >   Return 1-Year)
> > >     >   >
> > >     >   > Thanks,
> > >     >   > Greg
> > >     >   >   ----- Original Message -----
> > >     >   >   From: Phsst
> > >     >   >   To: amibroker@xxxxxxxxxxxxxxx
> > >     >   >   Sent: Saturday, December 13, 2003 1:26 PM
> > >     >   >   Subject: [amibroker] Re: PositionScore Ideas
> > >     >   >
> > >     >   >
> > >     >   >   Al,
> > >     >   >
> > >     >   >   My favorite is the QP2 QRS value (GetExtraData("QRS").
> > The QP2
> > > QRS
> > >     >   >   value is supposed to be a 'knockoff' of the IBD RS
ranking
> > > score.
> > >     >   >
> > >     >   >   I almost always get a significant boost using this
ranking
> > >     figure as
> > >     >   >   as the positionscore.
> > >     >   >
> > >     >   >   If you do not have QP2, but have any ideas about how
to do
> > >     your own RS
> > >     >   >   Rank calculation, I'd be happy to run some comparisons
> > for you
> > > (or
> > >     >   >   anyone else) to measure your calculated RS Rank against
> > QP2's
> > > QRS
> > >     >   rank.
> > >     >   >
> > >     >   >   Cheers,
> > >     >   >
> > >     >   >   Phsst
> > >     >   >   --- In amibroker@xxxxxxxxxxxxxxx, "Al Venosa"
> > <advenosa@xxxx>
> > >     wrote:
> > >     >   >   > Hi, all:
> > >     >   >   >
> > >     >   >   > I've been experimenting with variuos short term
trading
> > > systems
> > >     >   >   lately (average trade durations of about 2.5 days), and
> > I was
> > >     looking
> > >     >   >   for ideas on how best to rank a watchlist to get the
best
> > >     candidates
> > >     >   >   for portfolio trading a basket of 4 stocks. I was
> > wondering if
> > >     anyone
> > >     >   >   would care to share any ideas on how you use the
> > PositionScore
> > >     >   >   function to rank your candidate list (using regular
> > mode, not
> > >     >   >   rotational mode). I've tried combinations of
turnover and
> > >     volatility,
> > >     >   >   but I'd like to try other ideas. I'm not asking anyone
> > to give
> > >     away
> > >     >   >   any secrets, and, yes, I am aware of TJ's example in the
> > help
> > > file
> > >     >   >   (PositionScore = 100 -RSI());), but I was just
looking for
> > >     more ideas.
> > >     >   >   I'm not even sure if this question is too vague or not.
> > If it
> > >     is, I'm
> > >     >   >   sure you'll tell me. TIA.
> > >     >   >   >
> > >     >   >   > Al Venosa
> > >     >   >   > advenosa@xxxx
> > >     >   >   >
> > >     >   >   >
> > >     >   >   > ---
> > >     >   >   > Outgoing mail is certified Virus Free.
> > >     >   >   > Checked by AVG anti-virus system
> (http://www.grisoft.com).
> > >     >   >   > Version: 6.0.543 / Virus Database: 337 - Release Date:
> > >     11/21/2003
> > >     >   >
> > >     >   >
> > >     >   >         Yahoo! Groups Sponsor
> > >     >   >
> > >     >   >
> > >     >   >
> > >     >   >   Send BUG REPORTS to bugs@xxxx
> > >     >   >   Send SUGGESTIONS to suggest@xxxx
> > >     >   >   -----------------------------------------
> > >     >   >   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 the Yahoo!
> Terms of
> > >     Service.
> > >     >
> > >     >
> > >     >         Yahoo! Groups Sponsor
> > >     >               ADVERTISEMENT
> > >     >
> > >     >
> > >     >
> > >     >
> > >     >   Send BUG REPORTS to bugs@xxxx
> > >     >   Send SUGGESTIONS to suggest@xxxx
> > >     >   -----------------------------------------
> > >     >   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 the Yahoo! Terms of
> > Service.
> > > 
> > > 
> > > 
> > >     Send BUG REPORTS to bugs@xxxx
> > >     Send SUGGESTIONS to suggest@xxxx
> > >     -----------------------------------------
> > >     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 the Yahoo! Terms of
> Service.
> > > 
> > > 
> > >         Yahoo! Groups Sponsor
> > >               ADVERTISEMENT
> > > 
> > > 
> > > 
> > > 
> > >   Send BUG REPORTS to bugs@xxxx
> > >   Send SUGGESTIONS to suggest@xxxx
> > >   -----------------------------------------
> > >   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 the Yahoo! Terms of
Service.
> 
> 
> 
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> 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/