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

[amibroker] Taking partial profits when backtesting?..



PureBytes Links

Trading Reference Links

Hello there Herman !

Thank you very much for your detailed reply.  You have confirmed my 
suspicions.  At least now I will not give up :-)

The second thing I wanted to see was if it is wise then to backtest 
things so far back because, to use a nice word you used, the "rythm" 
of the markets change...wich could mean that I might have a great 
system to "abuse" now, but if tested back over years and years, it 
fails, thus giving the impression that it does not work...and 
eventually making me give up on it ...

I guese with the FOREX markets things go eaven faster and backtesting 
15 or eaven 5 minute data back for years will mostly cause this 
situation...

Maybe this is also one of the secrets to success:  I mean that there 
might be people doing great for a while with a system they have 
created or bought, and then all of a sudden things go wrong... the 
secret to continues success thus is to stay in tune with the market 
dynamics, which most of them probably do not know.

It alsmost makes me sad to think that if only I had my current 
knowledge a couple of years ago !!!  But then again, that is probably 
antoher rule to success, Don't give up ... if I did when things were 
bad, all money lost on trades would have been wasted, now at least 
they served a purpose, I am getting beter !!!

Well, you have a great day and may the trend be with you :-)

Louw

--- In amibroker@xxxxxxxxxxxxxxx, "Herman van den Bergen" 
<psytek@xxxx> wrote:
> First: i am NOT an experienced trader and have little knowledge of 
the
> markets as it goes.
> 
> I am strictly a numbers man: my stock data (QP2 and eSignal) are my 
only
> sources of information. When i trade i do so without looking at the 
ticker,
> its fundamentals, news, or listening to analysts :-) However, I 
enjoy
> coding, simple research, and have designed many systems, some 
worked for 10
> years (backtested) or so and then suddenly failed. Many marvelous 
systems
> gave up about 3-4 years ago, just when i started to get 
interested :-(  I
> always design with InSample and OutOfSample periods and try to 
prevent
> over-optimization as a result of exhaustive formula testing.
> 
> One great simple system worked like a charm (perfect straight 
equity line)
> on a single stock (and not a single other stock), for 6-7 years, 
and then
> suddenly failed. I had been trading this system/stock with a friend 
for 6-8
> months when it failed, a great experience: I had been getting 70-80%
> winners, winning streaks of 20+ trades; we started to think we 
couldn't
> lose. Most trades lasting only a few hours or less in the morning, 
every 1-3
> days. The company was bought out by somebody else and the stock 
price shot
> up: the rhythm was gone! Traders must have given up on the stock 
(like me)
> because now it only trades moderately well Long with much lower
> profits/winners. This does however show that it may be worthwhile 
to keep an
> eye open for such rare systems: they do exist!
> 
> imho, system performance fades in and out for most systems. The 
higher they
> are tuned to a specific market anomaly and the faster the trades (I 
prefer
> trades lasting a few hours, max 1-3 days), the more drastic the 
changes in
> performance can be. I think this is pretty well accepted and equity 
Feedback
> has been discussed as a possible solution on this and other lists 
on/off for
> many years. The idea is to monitor your equity and change your 
system's
> parameters/signals according to performance. You do this by 
cascading two
> systems, one to create the Reference equity and one to give you the 
final
> signals.
> 
> I would think that changes in technology, speed of execution, 
regulations,
> etc. can all influence system performance. Bull-Bear markets do not 
effect
> me much because i trade L&S with short durations. But again: there 
are far
> more experienced traders on this list who can voice a more 
qualified opinion
> :-)
> 
> happy trading!
> herman.
>   -----Original Message-----
>   From: Louw-Roux Coetzer [mailto:lcoetzer@x...]
>   Sent: Tuesday, July 06, 2004 4:04 PM
>   To: AmiBroker Forum
>   Subject: [amibroker] Re: Please confirm this !!! ???
>   Importance: High
> 
> 
>   Hello Herman !
> 
>   No worries, you have helped me remember the darn fee charges or 
in this
> case the spread cost !!!
> 
>   May I ask your opinion on something else though ?
> 
>   Is it possible for a certain strategy/system to be working 
extremely well
> say the last 150 days, but before then, it did almost not work.  In 
other
> words I am thinking that the market is almost susceptible to 
certain systems
> at different times, what works now might not be working in a year 
from now.
> 
>   I ask this because  I have been testing many systems and found 
that quite
> a few I have come across work very well the past 150 odd days, but 
checking
> back 1 or two year back, they all fail and then strangely what 
worked then
> also mostly does not work now...
> 
>   You have been trading a lot and have probably done your own 
research also,
> so I hope that maybe you could give your opinion on this.
> 
>   I trade the Forex market mostly and I know it is a very fast 
moving match,
> things change all the time, so should the trading approach I 
think ... or so
> I think !
> 
>   Kind regards and happy trading !!!
> 
>   Louw Coetzer
> 
> 
> --------------------------------------------------------------------
--------
> --
> 
> 
>   I did manage to get it right more or less...here is the complete 
code for
> the test ( there was one major signal test I left out - OOPS !)  
Also
> optimized the Stop Loss, it eventually ended up being 0.0091  close 
to the
> default 0.01,  the Rapport follows further down and includes the 5 
point
> spread cost for each contract:
> 
> 
> //==================================================================
========
> ===
>   targetpoints = Param("Target Profit",0.0050,0.0005,1,0.0001); // 
profit
> target
>   SL = Param("Stop Loss",0.01,0.0005,1,0.0001);  // Stop Loss Level.
>   TickSize=0.0001;
>   NumContracts = 5;
>   PointValue =10000;
>   PositionSize = NumContracts * MarginDeposit;
> 
> //==================================================================
========
> ===
>   reEntryDelay = Param("Wait after first signal",4,1,50,1);
>   triggerTime =Param("Trigger Time after Break-out",20,1,50,1);
>   Lreq1 = BarsSince(H>BBandTop(C,21,2)) < triggertime;
>   Sreq1 = BarsSince(L>BBandBot(C,21,2)) < triggertime;
>   Lreq2 = Cross(EMA(C,62),C);
>   Sreq2 = Cross(C,EMA(C,62));
>   BuyPrice = ValueWhen(Lreq2,C);
>   ShortPrice = ValueWhen(Sreq2,C);
>   Short = Lreq1 AND Lreq2 AND  C- EMA(C,200) > 0.0010;
>   Buy = sreq1 AND sreq2 AND EMA(C,200)-C > 0.0010 ;
>   ExRemSpan(Buy,10);
>   ExRemSpan(Short,10);
>   Sell = TimeNum()==170000;
>   Cover = TimeNum()==170000;
>   ApplyStop( stopTypeProfit, stopModePoint, targetpoints,
> True,False,reEntrydelay );
>   ApplyStop( stopTypeLoss, stopModePoint, SL, True );
> 
>         Statistics
>           All trades Long trades Short trades
>         Initial capital 10000.00 10000.00 10000.00
>         Ending capital 16370.01 15949.79 10420.22
>         Net Profit 6370.01 5949.79 420.22
>         Net Profit % 63.70 % 59.50 % 4.20 %
>         Exposure % -0.23 % -0.06 % -0.17 %
>         Net Risk Adjusted Return % -27338.31 % -98185.79 % -2437.35 
%
>         Annual Return % 234.46 % 213.82 % 10.61 %
>         Risk Adjusted Return % -100624.99 % -352855.37 % -6153.70 %
> 
> --------------------------------------------------------------------
----
> 
>         All trades 85 45 (52.94 %) 40 (47.06 %)
>          Avg. Profit/Loss 74.94 132.22 10.51
>          Avg. Profit/Loss % 0.06 % 0.11 % 0.01 %
>          Avg. Bars Held 28.61 21.96 36.10
> 
> --------------------------------------------------------------------
----
> 
>         Winners 79 (92.94 %) 44 (51.76 %) 35 (41.18 %)
>          Total Profit 12160.00 6909.80 5250.21
>          Avg. Profit 153.92 157.04 150.01
>          Avg. Profit % 0.13 % 0.13 % 0.12 %
>          Avg. Bars Held 21.46 18.18 25.57
>          Max. Consecutive 19 22 12
>          Largest win 169.99 169.99 150.01
>          # bars in largest win 13 13 2
> 
> --------------------------------------------------------------------
----
> 
>         Losers 6 (7.06 %) 1 (1.18 %) 5 (5.88 %)
>          Total Loss -5789.99 -960.01 -4829.99
>          Avg. Loss -965.00 -960.01 -966.00
>          Avg. Loss % -0.79 % -0.79 % -0.79 %
>          Avg. Bars Held 122.83 188.00 109.80
>          Max. Consecutive 1 1 1
>          Largest loss -970.00 -960.01 -970.00
>          # bars in largest loss 71 188 71
> 
> --------------------------------------------------------------------
----
> 
>         Max. trade drawdown -970.01 -970.01 -969.99
>         Max. trade % drawdown -0.80 % -0.80 % -0.76 %
>         Max. system drawdown -1979.98 -1780.00 -1919.92
>         Max. system % drawdown -16.22 % -13.16 % -18.99 %
>         Recovery Factor 3.22 3.34 0.22
>         CAR/MaxDD 14.45 16.25 0.56
>         RAR/MaxDD -6203.27 -26820.73 -324.04
>         Profit Factor 2.10 7.20 1.09
>         Payoff Ratio 0.16 0.16 0.16
>         Standard Error 461.23 386.18 376.58
>         Risk-Reward Ratio 30.50 38.44 -2.06
>         Ulcer Index 3.80 1.42 7.50
>         Ulcer Performance Index 60.33 146.57 0.69
>         Sharpe Ratio of trades 7.68 27.22 0.73
>         K-Ratio 3.59 4.53 -0.24
> 
> 
>   Above is also the result of the test, as you can see not many 
trades but
> high accuary and all....
> 
> 
> 
>   Check AmiBroker web page at:
>   http://www.amibroker.com/
> 
>   Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
> 
>         Yahoo! Groups Sponsor
>               ADVERTISEMENT
> 
> 
> 
> 
> 
> --------------------------------------------------------------------
--------
> --
>   Yahoo! Groups Links
> 
>     a.. To visit your group on the web, go to:
>     http://groups.yahoo.com/group/amibroker/
> 
>     b.. To unsubscribe from this group, send an email to:
>     amibroker-unsubscribe@xxxxxxxxxxxxxxx
> 
>     c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

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