General Topics
Technical Topics
Brokerage Firms
Community Lounge
Site Support

# Arbitrarily testing stop strategies...

Discussion in 'Strategy Development' started by Corey, Mar 12, 2008.

1. ### Corey

I was contemplating testing the effectiveness of different stop loss strategies NOT in conjunction with any other strategy -- simply the change in expected return on completely random entries and exits.

My only issue is...how do I choose a distribution to define my entry and exit points? How will this choice affect the overall outcome of my study? A 50/50 chance on entry/exit for each bar seems rather drastic and will generate more loss from slippage and transaction costs than anything. But with what probability distribution SHOULD I use -- and how can I quantify how this will affect my study?

Help! I am stuck!

Thanks,
Corey

2. ### MGJ

Look into your heart and ask, what values of "D" are so ridiculously unsuited to my personality, that I would never NEVER trade a system with that duration. You might decide that you would never deploy a system that held trades less than two days, and you would never trade a system that held trades more than three months. In this case, your values are (D>2) and (D<63).

Look into your heart and ask, what values of "B" are so ridiculously unsuited to my personality, that I would never NEVER trade a system with that between-trade duration. You might decide that you require (B>1) and (B<125).

Step 1. You have no position.
Step 2. Generate a random number x between minB and maxB.
Step 3. Wait x days (with no position)
Step 4. On day (x+1), enter a new trade
Step 6. Generate a random number y between minD and maxD
Step 7. Exit whichever happens first: either your stoploss triggers an exit, or you've been in the trade y days
Step 8. You now have no position. Go to step 1.

3. ### Corey

Very very interesting technique. I might just have to use that!

I actually just did the same testing a few months ago. I did everything in Matlab. What will you be using?

As opposed to the method mentioned above, I simply estimated how may times per day I wanted to issue trades (n). Then divide the number of bars in a day (b) by this number, and you will find the number of bars between trades on average (avg). Then you can issue random numbers between 1 and avg and select one value for which you will trigger trades.

ex.

avg=n/b

randnum=random(1,avg)

the variable randnum will = 13 approximately 1/avg of the time

5. ### Corey

Self coded tool in C++, most likely. To remove any 'personal' bias, I will probably randomly generate B and D. For each B and D generated, I will run the test a couple hundred times -- and generate a couple hundred reasonable B and Ds. With this large data set, I should smooth out any noise generated by personal bias in desire of position length...

6. ### MGJ

Random sampling experiments are notoriously slow to converge and thus require a huge number of datapoints to produce reliable results. In this particular case I recommend you generate AT LEAST one million random trades before drawing your conclusion. Fortunately this is easy, you just tell the computer to run longer. No extra human effort at all.

Here's a little experiment to try: Use randomization techniques to estimate the probability that a 13-card bridge hand drawn from a randomly-shuffled standard 52-card deck, contains eight or more red cards. Make ten or twenty plots of "Probability so far" versus "number of hands so far" and observe how the plots converge. Slooooowwww.

7. ### Corey

It isn't a matter of convergence -- it is a matter of expected value. It is just a large number of iterations that have to be run -- but I can run them on parallel machines -- I am not too worried.

8. ### black diamond

If you don't mind me asking, what do you expect to get out of this? Are you looking for a baseline favorite stop strategy to test different entries/exits against? Are you looking for a way to test deviations in the probablity of a stop being hit from what you would expect from normality or some other distribution?

9. ### Corey

Just a simple test in the expected value of a given strategy versus the expected value of that strategy when employing stop losses. I have read a few theoretical papers about the ineffective nature of stop losses...

With a system that creates a few thousand random entry and exit systems, and for each system runs a few thousand times -- each time keeping track of the return without stops, with stops, and with a few different types of trailing stops -- it would be possible to determine with relative certainty whether stop losses hinder the expected value of a trading strategy or not -- and if not, in which cases are they effective.

10. ### MGJ

One place that opinion is put forward, is Howard Bandy's book "Quantitative Trading Strategies". As part of a discussion of this book, I prepared the chart below. It shows a simple 3-moving-average crossover system with an ATR-based stop, applied to a portfolio of 60+ futures markets. The "objective function" (as the book calls it) is the Sharpe Ratio, measured on the daily equity curve data. At the far right hand edge of the graph, the stop is so far away that it is never hit, which is equivalent to having no stop at all. If you treat this as the "baseline" case, the "no-stops" case, then the plot contains some datapoints where having a stop did improve the objective function, and other datapoints where having a stop hurt the objective function. Ain't that typical: life is messy.

Random entries and random exits and randomly chosen stop placements may, of course, give different results. This is just one example of one (non-random) system, and the influence of stops upon its trading results. Your mileage may vary, do not hold in hand, use only under adult supervision.

#10     Mar 13, 2008
ET IS FREE BECAUSE OF THE FINANCIAL SUPPORT FROM THESE COMPANIES: