Ron --
Try running your system below over a period of time which starts on a Monday, ends on a Friday, and has no holidays in between. For example, 4/12/2010 - 5/28/2010. You should get integer values then.

Now back to your original question. I think I understand where you are coming from. And that you have some valid concern. Consider your following results.
The Long & Short backtest gives,
1.  Initial capital 100000.00 100000.00 100000.00
2.  Ending capital 921758.81 712441.67 315904.12
3.  Net Profit 821758.81 612441.67 215904.12
4.  Net Profit % 821.76 % 612.44 % 215.90 %

It appears that AB just uses lines 1 and 2 to calculate lines 3 and 4 above. Those values are at least self consistent. However, they do not really tell you much, if anything, about how well either the long or the short positions did.

More than likely, the long trades did NOT produce a profit of 612.44% on long invested capital nor did short trades produce a profit of 215.90% on short invested capital. If they had, and the trades did not overlap in time, and all earnings were reinvested, then the total net profit would have been more like: (1 + 6.1244) * (1 + 2.1590) - 1 = 21.5059 or 2150.59% instead of a mere 821.76%

Note that your long only of 458.76% and short only of 75.89% when combined geometrically (as above) produce a total of 882.80% which is much closer to the 821.76% for the combined long and short systems. If you were to retest your long, short, and combined systems; with no long and short overlap, round lot size was 0.0001, and no interest was paid on cash, you would probably get a much closer match for those two numbers.

-- Keith

On 7/22/2010 20:09, Ron wrote:

Okay, I do understand there is interaction between the longs and shorts but the results I'm seeing don't 'feel' right to me.

Here is a even simpler example involving Avg. Bars Held. I don't believe there should be an interaction with this metric.

I ran this afl,

SetOption("MaxOpenPositions", 2);
SetOption("MaxOpenLong", 2);
SetOption("MaxOpenShort", 2);

PositionSize = -25;

Buy = DayOfWeek() == 1; //Monday
Sell = DayOfWeek() == 2; //Tuesday

Short = DayOfWeek() == 3; //Wednesday
Cover = DayOfWeek() == 5; //Friday

from 1/1/2009 to 1/1/2010 on a watchlist containing two stocks (X and T).

The long/short run reports the following for Avg Bars Held,
All: 2.51
Long: 2.00
Short: 2.98

The long only run reports,
All: 2.00
Long: 2.00
Short: N/A

The short only run reports,
All: 3.22
Long: N/A
Short: 3.22

Can someone explain why the long/short Avg Bars Held of 2.98 is not equal to the short only of 3.22. Any the bonus question - isn't the correct answer 3.00?

I know I'm being hardheaded here but I really need to understand this report to have confidence in what they are telling me.

Thanks to all that have read to here.

Ron

P.S. Here is the settings for the script run,

Settings

Initial Equity: 100000 Periodicity/Positions: Daily/ Short
Commissions: 0.00 per trade Annual interest rate: 0.00%
Range: 1/1/2009 00:00:00 - 1/1/2010 Apply to: Filter
Include Filter Exclude Filter
Market - Market -
Group - Group -
Sector - Sector -
Industry - Industry -
GICS - GICS -
Watch list t and x Watch list -
Index - Index -
Favourite - Favourite -
Account margin: 100 Futures mode: No
Def. round lot size: 1 Def. Tick Size 0
Drawdowns based on: High/Low prices
Long trades
Buy price: Close Sell price: Close
Buy delay: 0 Sell delay: 0
Short trades
Short price: Close Cover price: Close
Short delay: 0 Cover delay: 0
Stops
Maximum loss: disabled Profit target: disabled
Value: 8.00 Value: 4.00
Exit at stop? no Exit at stop? no

Trailing stop: disabled
Value: 8.00
Exit at stop? no

--- In amibroker@yahoogroups.com <mailto:amibroker%40yahoogroups.com>, "Mike" <sfclimb...@...> wrote:
>
> It might help to review how AmiBroker handles signals:
>
> http://www.amibroker.com/guide/h_portfolio.html
>
> Any time you add more signals, you change the outcome, since holding a position will prevent acting on new signals until the original position is exited (unless coded otherwise).
>
> long and short = more signals = different positions taken = different redundant signals skipped = different outcome.
>
> Mike
>
> --- In amibroker@yahoogroups.com <mailto:amibroker%40yahoogroups.com>, Keith McCombs <kmccombs@> wrote:
> >
> > Ron --
> > You are using portfolio back testing. So, when your system goes long,
> > it is reinvesting profits from previous long AND short trades.
> > Likewise, when your system goes short, it is reinvesting profits from
> > previous short AND long trades. Life is good.
> > -- Keith
> >
> > On 7/22/2010 10:02, Ron wrote:
> > >
> > >
> > > Let me attempt to be more clear,
> > >
> > > When I run my system in long only I get the total and long columns on
> > > the report for Net Profit of 458.76%,
> > >
> > > Net Profit % 458.76 % 458.76 % 6.59 %
> > >
> > > When I run it short I get the total and short columns on the report
> > > for Net Profit of 75.98%,
> > >
> > > Net Profit % 75.89 % 6.59 % 75.89 %
> > >
> > > When I run it long and short I get Net Profit total of 821.76%, long
> > > of 612.44% and short of 215.90%,
> > >
> > > Net Profit % 821.76 % 612.44 % 215.90 %
> > >
> > > Why is long column for Net Profit% not the same for the long only and
> > > long and short run?
> > >
> > > And same question for the short column on the short only and long and
> > > short run?
> > >
> > > Ron
> > > --- In amibroker@yahoogroups.com <mailto:amibroker%40yahoogroups.com> <mailto:amibroker%40yahoogroups.com>,
> > > "Matthias K." <meridian202@> wrote:
> > > >
> > > > Hi,
> > > >
> > > > It's very hard to understand the system's logic only by numbers. But
> > > as a
> > > > matter of fact you identified the problem already: when you're
> > > testing long
> > > > only, the shorts are skipped, thus it'll result in a very different
> > > equity
> > > > curve as compared to the result when trading long and short together. So > > > > far, if everything went right, you just figured out the difference of
> > > > trading a long-only system and a short-only system.
> > > >
> > > >
> > > >
> > > > If trading stocks, one might consider the long-side only because the
> > > indices
> > > > and stocks sort of have a long-bias. In order to smoothen your
> > > equity curve,
> > > > you might want to combine a short and a long system. The result is
> > > something
> > > > like you're showing here. It'll pretty much enable you to make money in
> > > > both bull and bear markets and ideally smoothens out the equity
> > > curve and
> > > > reduces drawdowns and flat periods. Looks good to me if your coding
> > > has been
> > > > right and doesn't look into the future.
> > > >
> > > >
> > > >
> > > > Always:
> > > >
> > > >
> > > >
> > > > CAR/MDD ratio: above 1,5 over 10 years time is outstanding, as it's
> > > a risk
> > > > adjusted measure, it'll equal/weigh up profits versus
> > > losses|drawdown and
> > > > will not consider "net profit only"
> > > >
> > > >
> > > >
> > > > To sum it up: the more trades you have, the longer your backtesting
> > > period
> > > > is, the higher your CAR/MDD ratio: the better your system. Don't
> > > forget to
> > > > include commissions/ spreads, anyhow. They might deteriorate your big
> > > > picture. Especially with mid-caps.
> > > >
> > > >
> > > >
> > > > A good custom backtest metric might be a combination of number of
> > > trades and
> > > > CAR/MDD, so to say, make 50 Trades per year and still give a CAR/MDD
> > > ratio
> > > > above 1.
> > > >
> > > >
> > > >
> > > > Greetings
> > > >
> > > >
> > > >
> > > > M
> > > >
> > > >
> > > >
> > > > From: amibroker@yahoogroups.com <mailto:amibroker%40yahoogroups.com> <mailto:amibroker%40yahoogroups.com> > > > [mailto:amibroker@yahoogroups.com <mailto:amibroker%40yahoogroups.com>
> > > <mailto:amibroker%40yahoogroups.com>] On Behalf
> > > > Of Ron
> > > > Sent: Donnerstag, 22. Juli 2010 06:31
> > > > To: amibroker@yahoogroups.com <mailto:amibroker%40yahoogroups.com> <mailto:amibroker%40yahoogroups.com>
> > > > Subject: [amibroker] Backtest Report Long/Short trades columns?
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > I have a strategy that over time is either long or short but not
> > > both at the
> > > > same time. I'm having difficulty understanding the Long and Short trades > > > > columns in the back test report when I run the back test in Long and
> > > Short
> > > > mode.
> > > >
> > > > Long only backtest gives (Net Profit 458.76%)
> > > >
> > > > Initial capital 100000.00 100000.00 100000.00
> > > > Ending capital 558757.12 558757.12 106586.98
> > > > Net Profit 458757.12 458757.12 6586.98
> > > > Net Profit % 458.76 % 458.76 % 6.59 %
> > > > Exposure % 38.28 % 38.28 % 0.00 %
> > > > Net Risk Adjusted Return % 1198.47 % 1198.47 % N/A
> > > > Annual Return % 30.78 % 30.78 % 1.00 %
> > > > Risk Adjusted Return % 80.42 % 80.42 % N/A
> > > >
> > > > Short only backtest gives (Net Profit 75.89%)
> > > >
> > > > Initial capital 100000.00 100000.00 100000.00
> > > > Ending capital 175889.18 106586.98 175889.18
> > > > Net Profit 75889.18 6586.98 75889.18
> > > > Net Profit % 75.89 % 6.59 % 75.89 %
> > > > Exposure % 28.44 % 0.00 % 28.44 %
> > > > Net Risk Adjusted Return % 266.88 % N/A 266.88 %
> > > > Annual Return % 9.21 % 1.00 % 9.21 %
> > > > Risk Adjusted Return % 32.38 % N/A 32.38 %
> > > >
> > > > The Long & Short backtest gives,
> > > >
> > > > Initial capital 100000.00 100000.00 100000.00
> > > > Ending capital 921758.81 712441.67 315904.12
> > > > Net Profit 821758.81 612441.67 215904.12
> > > > Net Profit % 821.76 % 612.44 % 215.90 %
> > > > Exposure % 66.78 % 38.28 % 28.50 %
> > > > Net Risk Adjusted Return % 1230.56 % 1599.91 % 757.56 %
> > > > Annual Return % 41.40 % 35.84 % 19.65 %
> > > > Risk Adjusted Return % 62.00 % 93.62 % 68.96 %
> > > >
> > > > Notice the Long Net Profit is 612.44% and Short is 215.90% which is
> > > quite a
> > > > bit different then when I ran them independently. Other columns are
> > > > different as well but I'll focus on Net Profit % for now.
> > > >
> > > > I expect there is some compounding thing happening here but if
> > > someone asked
> > > > me I couldn't explain it. Does anyone out there have a explanation.
> > > >
> > > > Thanks in advance,
> > > >
> > > > Ron
> > > >
> > >
> > >
> >
>


Reply via email to