Absorbing bit of software Amibroker. Have been running some backtesting based on TechTrader formula and have come up with some profitable results, and was wondering if i can draw on some experience to see where i can fine tune it.
Yes, a little bit impetuous, but its quite interesting what can be done with a few changes.
Initial Capital - $15000
Comms - $15 per trade
Market - ASX
Timeframe - 01/10/92 to 19/03/08
Maximum Stop Loss - 2%
Profit Target - 50%
Periodicity - Weekly
Positions - Long
All trades Long trades Short trades
Initial capital 15000.00 15000.00 15000.00
Ending capital 165403.56 165403.56 40621.58
Net Profit 150403.56 150403.56 25621.58
Net Profit % 1002.69 % 1002.69 % 170.81 %
Exposure % 79.84 % 79.84 % 0.00 %
Net Risk Adjusted Return % 1255.83 % 1255.83 % N/A
Annual Return % 16.78 % 16.78 % 6.65 %
Risk Adjusted Return % 21.02 % 21.02 % N/A
--------------------------------------------------------------------------------
All trades 544 544 (100.00 %) 0 (0.00 %)
Avg. Profit/Loss 262.14 262.14 N/A
Avg. Profit/Loss % 4.85 % 4.85 % N/A
Avg. Bars Held 58.68 58.68 N/A
--------------------------------------------------------------------------------
Winners 105 (19.30 %) 105 (19.30 %) 0 (0.00 %)
Total Profit 326473.98 326473.98 0.00
Avg. Profit 3109.28 3109.28 N/A
Avg. Profit % 56.39 % 56.39 % N/A
Avg. Bars Held 159.31 159.31 N/A
Max. Consecutive 4 4 0
Largest win 15282.79 15282.79 0.00
# bars in largest win 6 6 0
--------------------------------------------------------------------------------
Losers 439 (80.70 %) 439 (80.70 %) 0 (0.00 %)
Total Loss -183870.38 -183870.38 0.00
Avg. Loss -418.84 -418.84 N/A
Avg. Loss % -7.47 % -7.47 % N/A
Avg. Bars Held 34.61 34.61 N/A
Max. Consecutive 28 28 0
Largest loss -4247.56 -4247.56 0.00
# bars in largest loss 5 5 0
--------------------------------------------------------------------------------
Max. trade drawdown -8264.17 -8264.17 0.00
Max. trade % drawdown -56.96 % -56.96 % 0.00 %
Max. system drawdown -20841.64 -20841.64 0.00
Max. system % drawdown -21.58 % -21.58 % 0.00 %
Recovery Factor 7.22 7.22 N/A
CAR/MaxDD 0.78 0.78 N/A
RAR/MaxDD 0.97 0.97 N/A
Profit Factor 1.78 1.78 N/A
Payoff Ratio 7.42 7.42 N/A
Standard Error 19182.59 19182.59 936.38
Risk-Reward Ratio 0.42 0.42 1.74
Ulcer Index 7.95 7.95 0.00
Ulcer Performance Index 1.43 1.43 N/A
Sharpe Ratio of trades 0.28 0.28 0.00
K-Ratio 0.0299 0.0299 0.1242
Have run it from the start of this year to current and curerntly sitting at profit of $2365.00 with W/L ratio of 4/8.
Regards
kolonel
Hi Kolonel,
Given that your winning trades is only 20%, can I ask why are using a Profit Target?
Is there an easier way to test stops without manually going back into settings on Amibroker ?
I am applying a stop based on profit, at a percentage, optimized with a default of 10%, min of 5%, max of 80% at 5% increments ?
Does this code overide anything i put in settings ?
Also need to refine position. Ran a 1 year test based on highest profit and had the following :
Profit - $10423
W/L - 14/51
profit/trail/stop - 60/disabled/2
From 13/04/07 - 13/07/07 (Max open pos 10) = 3 months with signals but no trade.
Regards
kolonel
Looking at your system, would you agree that it is a long-term Trend-Following system? If so, from what I understand the majority of profit is derived from the few large hitters. By using a Target Stop, I believe you may be limiting this.
Greetings all --
I was hoping that my post yesterday would be sufficient, but I think another comment or two might help.
The system holds each position a fairly long time -- on average 28 days for losers, 158 for winners. Systems that hold a long time should not use profit targets to exit. Profit targets are appropriate for systems that hold a much shorter time -- intraday, or a few days, or a week or two at the longest -- and there should be a high proportion of exits caused by the profit target being reached. When a profit target exit is used with a system that holds a long time, it is inevitable that the magnitude of the profit being targeted will be curve-fit to the specific data that was used for the in-sample period, and the out-of-sample performance is certain to be poor.
Note the number of consecutive losers -- 28. The ratio of winning trades to losing trades is 105 to 439 -- 80.6% losers. Personally, if I saw a system go 27 trades in a row with a loss each time, I could not place the 28th or 29th trade. In fact, the probability of 14 consecutive losing trades is 0.0488. When the 14th trade in a row lost (and the probability of that happening is <0.05), the system is telling you that it is broken and should not be traded any more.
There is a maximum trade drawdown of 56%, which is on the high side for many people. I see a note that there is a 2% maximum stop loss -- that must not have been active in the code when this test was run. But maximum loss exits are the worst kind of exit anyway. Try to exit from a signal, just like the entry was made from a signal. In systems that hold a long time, a trailing stop such as the chandelier or parabolic is often a reasonable exit to both capture the long-term gain and protect the profit.
Again -- all of these stats are taken from in-sample results. In-sample results Always Over-estimate the profitability. This system should definitely not be traded with real money.
Thanks for listening,
Howard
Hi Chorlton --
The results are from in-sample testing, which have no value as predictors of out-of-sample performance. But, assume for this discussion that those results were from out-of-sample tests achieved without polluting the out-of-sampleness of the data.
I noted that there 80.6% losing trades. Assuming that the trades and their results are independent of each other, then we can use the calculations for the binomial distribution and the probability of n losing trades in a row is (0.806)^n.
In your question, you ask whether we should worry if there are nine losers in a row. (0.806)^9 == 0.143. That implies that any sequence of nine trades, taken at random from the system that produced the results we are evaluating, will all be losing trades about 14% of the time.
People working with experiments and with quality control often measure "statistical significance" by asking how likely it is that the observed results could have happened by chance. And they often say that something is significant "at the 0.05 level" if it could have happened by chance less than 5% of the time. If random selection produces the observed results less than 5% of the time, they say that the results are probably not random. There is no way to know for certain, but by repeating the experiments the confidence can be increased.
The experiment in this case is drawing 9 trades from the distribution of trades that has 80.6% losers and 19.4% winners. Since the probability that all 9 can be losers is about 14%, and 14% is greater than 5%, we cannot conclude that the system is broken.
As a comparison ---
Assume that there is a different trading system that has 50% winning trades and 50% losing trades. The probability of n losers in a row is (0.50)^n. The probability of 9 losing trades in a row is (0.50)^9 == 0.00195. Since 0.00195 is less than 0.05, we can be confident that those results (9 losers in a row) did not come from the distribution we originally measured (50% winners), so the system has changed and is giving results that follow a new distribution that is almost certainly different than the original one. We conclude that the system is broken.
Thanks,
Howard
once my system is ready for trading, the final step will be to backtest it on my out-of-sample data.
Hi Howard,
As always, Many Thanks for such a detail reply!!!
Just for my understanding, once my system is ready for trading, the final step will be to backtest it on my out-of-sample data. From this backtesting, I will then know the % of losing trades. (for this example lets assume 40%)
Then, using your formula (0.4)^n, I should keep increasing the value of 'n' until the result is the first one below 0.05 which at that point will give me the number of losing trades at which I should seriously considering switching the system off.
Is this correct?
Kind Regards,
Chorlton
Hi Howard,
As always, Many Thanks for such a detail reply!!!
Just for my understanding, once my system is ready for trading, the final step will be to backtest it on my out-of-sample data. From this backtesting, I will then know the % of losing trades. (for this example lets assume 40%)
Then, using your formula (0.4)^n, I should keep increasing the value of 'n' until the result is the first one below 0.05 which at that point will give me the number of losing trades at which I should seriously considering switching the system off.
Is this correct?
Kind Regards,
Chorlton
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?