hi,

I did my own calculation in Excel but it doesn't tally with the result from the backtest.

Also, is there any way of attaching the excel file into the forum?

Thanks for helping.

ronnie

hi,

I did my own calculation in Excel but it doesn't tally with the result from the backtest.

Also, is there any way of attaching the excel file into the forum?

Thanks for helping.

ronnie

Just a thought... your trade list is in alphabetical order, but the actual trades were possibly/probably executed in a different order, which may account for the difference?

hi Chris

Thanks for your feedback. That is a keen observation.

However, I've look through Amibroker Backtesting results. It seems they are always sorted first by date and alphabetically by the symbol. The sequence of trades in Excel correspond to the Amibroker (I copied and paste)...it is just that it is not giving the result as I expected.

Looking forward to other comments... thanks!

rgds

ronnie

Your calculations are wrong. You assume that drawdowns happen ONLY when trades are closed, while it is wrong.

To properly calculate drawdowns you have to observe **system EQUITY at EVERY BAR**, not only at the close of trade. You simply can't calculate drawdown using Excel sheet from closed trades.

You need to watch EQUITY every bar.

Thank you Tomasz for your reply.

I am only buying the trades in the open and sell it at the close. So, there is only one Bar.

I found my mistake. My initial equity is $100K in Amibroker but I used $150K in the excel (it was hardcoded). My fault.

Anyway, the drawdown amount now matches with Amibroker ($595.58) but there seems to be a difference in percentage. It is 0.60 in Amibroker and 0.62 in the Excel calc.

Thanks again

ronnie

Take calculator and divide $595.58 by $100 021,76 and then round to 2 decimal digits.

And next time please triple check your calc before posting. Consider that every second spent on answering such math 101 is taken from software development.

1 Like

Results are ranked in the order of trades. I just realised your trades are happening in alphabetical order. Study up on PositionScore, you'll def want to include it in your strategy afl.

Trades are not happening in alphabetical order. The order is defined by **Position SCORE**. Really please read the manual Portfolio-level back testing

Only in ABSENCE of position score, other factors, like position SIZE start to play role, and only if BOTH position score AND size are equal then alphabetic ordering starts to matter, I wrote about it many times

Quote:

## As written in the manual, you should use

PositionScoreto define desired ordering/ranking [of trades]When PositionScore is missing / not defined, AmiBroker will prefer LARGER POSITION SIZE first

When position score is missing and pos sizes are equal (or missing) then it will use alphabetical order

When position score is missing and pos sizes are equal and symbol is also equal (i.e. there are both long and short signals on same symbol at same time) it will prefer long entry.

Thanks Chris and Tomasz for the headsup on the position score. It is something I didnt know and need to look at now.

rgds

ronnie.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.