Welcome to the Traders Laboratory Forums.
Automated Trading Black box systems, strategy automation, algorithmic trading, etc...

Reply
Old 02-03-2010, 06:55 AM   #9

cunparis's Avatar

Join Date: May 2008
Location: Paris
Posts: 155
Ignore this user

Thanks: 238
Thanked 45 Times in 25 Posts



Re: Is Optimizing Profit Target & Stop Loss Curve Fitting?

After doing lots of testing and running the optimizer to find the idea stop & target, both as a percentage of the average daily range and as a fixed percentage of the amount invested, my conclusion is that the fixed stop & target works much better.

I agree using S/R levels would be good but I'm working on an automated strategy and determining the S/R levels programmatically isn't easy to do.
Attached Thumbnails
Is Optimizing Profit Target & Stop Loss Curve Fitting?-ec-using-percent-range.png   Is Optimizing Profit Target & Stop Loss Curve Fitting?-ec-using-fixed-targets.png  
cunparis is offline  
Reply With Quote
Old 02-03-2010, 07:24 AM   #10

zapisy's Avatar

Join Date: Jan 2009
Location: New York
Posts: 79
Ignore this user

Thanks: 5
Thanked 26 Times in 17 Posts



Re: Is Optimizing Profit Target & Stop Loss Curve Fitting?

Tto find support and resistance, you can use someting like that:


Code:
vars: 	 Support	    (0), 
	 Resistance   (0);


Resistance = highest(H,Length)[1];
Support 	 = lowest(l,Length)[1];


if Resistance<>Resistance[1] 	then Resistance = highest(h,Length)[1];
if Resistance=Resistance[1] 	then Resistance = Resistance[1];

If Support<>Support[1] 	then Support = lowest(l,Length)[1];
if Support=Support[1] 	then Support = Support[1];
zapisy is offline  
Reply With Quote
The Following User Says Thank You to zapisy For This Useful Post:
cunparis (02-03-2010)
Old 02-03-2010, 07:27 AM   #11

zapisy's Avatar

Join Date: Jan 2009
Location: New York
Posts: 79
Ignore this user

Thanks: 5
Thanked 26 Times in 17 Posts



Re: Is Optimizing Profit Target & Stop Loss Curve Fitting?

To find SR you can use something like this:

Code:
vars: 	Support	 (0), 
	Resistance (0);


Resistance  = highest(H,Length)[1];
Support = lowest(l,Length)[1];


if Resistance<>Resistance[1] 	then Resistance = highest(h,Length)[1];
if Resistance=Resistance[1] 	then Resistance = Resistance[1];

If Support<>Support[1] 	then Support = lowest(l,Length)[1];
if Support=Support[1] then Support = Support[1];
zapisy is offline  
Reply With Quote
Old 02-03-2010, 07:43 AM   #12

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,272
Ignore this user

Thanks: 129
Thanked 1,038 Times in 694 Posts



Re: Is Optimizing Profit Target & Stop Loss Curve Fitting?

Quote:
Originally Posted by cunparis »

I agree using S/R levels would be good but I'm working on an automated strategy and determining the S/R levels programmatically isn't easy to do.
The way it is generally done is detect swings and store them, see if you get N within a user definable proximity. It is not too daunting and results can be 'not bad'.
BlowFish is offline  
Reply With Quote
Old 02-03-2010, 07:54 AM   #13

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,272
Ignore this user

Thanks: 129
Thanked 1,038 Times in 694 Posts



Re: Is Optimizing Profit Target & Stop Loss Curve Fitting?

Quote:
Originally Posted by cunparis »
I took a price pattern I was trading manually and programmed it into a strategy using tradestation. It doesn't use any indicators, just price & volume. I then ran the optimizer on it and had it find the optimal profit target and stop loss.

My strategy report has almost 1k trades over the past 2 years. The profit factor is 1.90. Drawdown is acceptable (less than 10% of the gross profit).

I'm curious if this is considered "curve fitting"? In the past I've written strategies using indicators and they worked for a month or two and then died. So now I'm focusing on price and volume and I'm avoiding indicators. But I still like to optimize for the target & stop loss.

Looking for experience here. Thanks.
You probably (definitely) want to test out of sample. Probably wise to pick different market conditions for that out of sample data. Intuitively the results will vary with volatility....the best settings for 10 point days is likely to be different to 30 point days.
BlowFish is offline  
Reply With Quote
Old 02-03-2010, 12:33 PM   #14

cunparis's Avatar

Join Date: May 2008
Location: Paris
Posts: 155
Ignore this user

Thanks: 238
Thanked 45 Times in 25 Posts



Re: Is Optimizing Profit Target & Stop Loss Curve Fitting?

Quote:
Originally Posted by BlowFish »
You probably (definitely) want to test out of sample. Probably wise to pick different market conditions for that out of sample data. Intuitively the results will vary with volatility....the best settings for 10 point days is likely to be different to 30 point days.
This pattern only seems to work in current market conditions. I've tried on 10+ different stocks and it seems to work well on 3 of them and the rest are profitable but not worth trading. So it seems to work on a certain type of stock.

I have no doubt that if market conditions change that it'll probably stop working. I've done some forward testing by reserving the past 3 months and excluding them from the optimization & backtests. it forward tests fine so I'm sure I'm not curve fitting.

My plan is to trade this, first on sim, and then with a small amount (say $100 risk) and then slowly increase the position size. If I get a behavior that's inconsistent with the past then I'll re-optimize for the most recent 6 months or so and compare the optimal results. If a slightly smaller target or bigger stop is needed then I can make that decision. any change in market conditions should be gradual so I think it won't just stop working right away (like it would if curve fitting indicator parameters). Plus running the strategy on a basket of 3 stocks will help to spread the risk and detect any problems.

The strategy is profitable with SPY but not as profitable as some of the stocks but it's good to know it works with SPY that makes me more confident.

It's all pretty exciting. I gave up automation a year ago but that was because I was using indicators. Now that I'm indicator free things make a lot more sense and I feel it's more robust.

Thanks for the tips on the S&R, I'll try to code that up and see if I can improve results.
cunparis is offline  
Reply With Quote
Old 02-03-2010, 01:42 PM   #15

Join Date: Jul 2009
Location: London
Posts: 365
Ignore this user

Thanks: 206
Thanked 195 Times in 124 Posts



Re: Is Optimizing Profit Target & Stop Loss Curve Fitting?

Quote:
Originally Posted by cunparis »
Now that I'm indicator free things make a lot more sense and I feel it's more robust.
.
I dont want to make any judgements but Its amazing how often I hear that.

Also there is nothing wrong with a pattern that works well in one particular type of market.
bear, bull and range bound markets do trade differently. You just need to know when to turn them on or off.
DugDug is offline  
Reply With Quote
Old 02-03-2010, 01:55 PM   #16

cunparis's Avatar

Join Date: May 2008
Location: Paris
Posts: 155
Ignore this user

Thanks: 238
Thanked 45 Times in 25 Posts



Re: Is Optimizing Profit Target & Stop Loss Curve Fitting?

Quote:
Originally Posted by DugDug »
I dont want to make any judgements but Its amazing how often I hear that.

Also there is nothing wrong with a pattern that works well in one particular type of market.
bear, bull and range bound markets do trade differently. You just need to know when to turn them on or off.
The problem is I don't know exactly what type of market is making this work. I'm still trying to figure it out but I really can't explain the drawdowns or the fact that it started working towards the end of 2007.

this isn't the first time i've had a strategy not work before mid to end 2007 and then work well after that (even curve fitting). i guess that's when they became more volatile.
cunparis is offline  
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Daily stop loss/profit targets Sparrow Money Management 21 03-29-2011 09:42 PM
Stop Trading After Profit/Loss cortlane Automated Trading 1 12-08-2009 10:27 PM
Avoiding Curve Fitting cunparis Automated Trading 3 09-01-2009 04:41 PM
Arts of stop placment and profit target kingking Beginners Forum 24 03-01-2007 02:52 AM
Stop Loss or Target Price? Follow The Trend Trading Psychology 4 12-01-2006 01:54 PM

All times are GMT -4. The time now is 05:20 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.