Sunteți pe pagina 1din 10

Exiting using limit orders – Alvarez Quant Trading 17.10.

2019, 09)31

Home Blog AmiBroker

October 16, 2019 in Mean Reversion , Stocks by Cesar Alvarez

Exiting using limit orders


Most of us focus our research time looking to find better entries. We don’t spend enough time
thinking about our exits. I am definitely guilty of this. A popular way to enter a mean reversion
trade is by using a limit order. I use that on the strategy on RSI2 Strategy: Double returns with a
simple rule change post.

The exit on that strategy is on the open. Many people don’t like exiting on the open because of the
volatility and the belief that you will get a bad fill. What if we exit instead using limit orders? I
tested this idea years ago. Time to revisit an old idea.

Just because the limit price gets touch or exceeded does not guarantee we will exit or fully exit in
real trading. We must live with that issue for these tests.

The Initial Strategy


Test range from 1/1/2007 to 9/30/2019.

https://alvarezquanttrading.com/blog/exiting-using-limit-orders/ Strona 1 z 10
Exiting using limit orders – Alvarez Quant Trading 17.10.2019, 09)31

​Free PDF: Mean Reversion Strategy


​Subscribe to my newsletter to receive regular updates and tips on
trading and get instant access to the rules to a mean reversion
strategy with results from 2003.

Enter Email SUBSCRIBE & GET


PDF

Set up Rules

1. Stock was a member of the Russell 3000 index, is not currently a member of the index
2. Stock is traded a major exchange.
3. The as traded price is greater than $1
4. The 21-day moving average of close*volume greater than $500K
5. Close is greater than the 100-day moving average
6. Two period RSI is less than 10

Entry Rules

If we have a set up, then enter a limit order for the next day at 5% below the close. Order good
for one day only.
Only place enough orders so if they are all filled you are not in over 10 positions
If have multiple set ups, then rank from high to low by the 100-day historical volatility.

Exit Rules

Two period RSI is greater than 50 or after 10 trading days


Exit on next open

Simple mean reversion exit of waiting for the bounce.

https://alvarezquanttrading.com/blog/exiting-using-limit-orders/ Strona 2 z 10
Exiting using limit orders – Alvarez Quant Trading 17.10.2019, 09)31

Base Results

These are the results we will compare against.

The Limit Exit


The exit rule will now be changed to:

Exit Rules

If RSI is greater than 50 at the close, place a limit order to close the position [.5,1,1.5,2]% above
the close
Order is good for one day only

OR

After 10 trading days


Exit on next open

Limit Exit Results

https://alvarezquanttrading.com/blog/exiting-using-limit-orders/ Strona 3 z 10
Exiting using limit orders – Alvarez Quant Trading 17.10.2019, 09)31

A small change in the numbers. Not sure what I was expecting. For a little piece of mind of not
having to deal with the open, this is an interesting way to get out.

Limit Exit with Lower RSI


Instead of waiting until the RSI2 is above 50 to place the limit order. What if we changed that to 30?

Now all the results are slightly better than the original test. CAR, Avg % p/l, % winners are all up
with average hold down.

https://alvarezquanttrading.com/blog/exiting-using-limit-orders/ Strona 4 z 10
Exiting using limit orders – Alvarez Quant Trading 17.10.2019, 09)31

Spreadsheet
Fill in the form below to get the spreadsheet with lots of additional information. This includes more
RSI exit values and limit values than shown. See the results of all variations from the optimization
run. This includes top drawdowns, trade statistics and more.

Final Thoughts
I will have to try this on my mean reversion strategies I trade. I like that for small percent exits most
the stats I care about improved some.

There are two issues. Just because the limit price is touched or exceeded does not guarantee you will
get out of the position or you may get a partial fill. These are always annoying to deal with.

Then comes the possible psychological problem of trading this. What if the stock is up big, then you
place the order to get out but then it turns around and craters? I will have to look at any trade lists
to see how often this happens.

Backtesting platform used: AmiBroker. Data provider: Norgate Data (referral link)

Good quant trading,

Fill in for free spreadsheet:

https://alvarezquanttrading.com/blog/exiting-using-limit-orders/ Strona 5 z 10
Exiting using limit orders – Alvarez Quant Trading 17.10.2019, 09)31

First Name

Last Name

Email *

GDPR Agreement - I consent to having this website store my submitted information and for
sending marketing emails to me. You can unsubscribe at any time. Privacy policy link at bottom
of page. *

Privacy Policy

Submit

Share this:

Tweet Share 1 Share 4

Related Posts

N-Day exits with Mean Reversion The ABCs of creating a mean Maximum Loss Stops: Do you
reversion strategy – Part 2 really need them?

Click Here to Leave a Comment Below

https://alvarezquanttrading.com/blog/exiting-using-limit-orders/ Strona 6 z 10
Exiting using limit orders – Alvarez Quant Trading 17.10.2019, 09)31

Craig Peters - October 16, 2019 ! Reply

Hi Cesar

Great post and pleased to see that you’ve seen similar slight improvements
in your numbers when implementing limit exits. I think the biggest positive
for me wasn’t the performance but rather the closer replication of actual
exit fill prices compared to back tests.

Your point about limits not being filled, even though a high may have
exceeded it, is a great one. I’ve been trading a variant of this strategy for
well over a year now, and I’ve found a particular OHLC configuration where
non-fills tend to be acute.

For slightly illiquid stocks, where the opening price represents the exact
high of the day, I’ve found that I can get a lot of non-fills because my limit
order doesn’t participate in the morning auction and the market is so thin
that the next trade price is way below my limit (and remains there for the
rest of the day).

It was leading to such differences between live and testing that I ended up
having to do two things:
1. I tightened up my stock universe filter to exclude more of the illiquid-
looking stocks.
2. Added a prudence measure to the simulation, such that if the open=high
and high>limit price, I would not assume a fill (unless the close>limit
price).

The latter measure did have an effect on simulation performance but not
too adversely.
My live results have been mirroring simulation much more closely since
making these changes in May.

https://alvarezquanttrading.com/blog/exiting-using-limit-orders/ Strona 7 z 10
Exiting using limit orders – Alvarez Quant Trading 17.10.2019, 09)31

Best Regards
Craig

Cesar Alvarez - October 16, 2019 ! Reply

Glad you liked the post. When testing illiquid stocks, I too do not take
the fill when Open = Low (for long systems). I wanted to show another
way of getting out besides the open. One could exit half at the open and
the other half at the limit. Thus spreading the shares out on illiquid
stocks.

Leave a Reply:

Name* Email* Website

Save my name, email, and website in this browser for the next time I comment.

SUBMIT

https://alvarezquanttrading.com/blog/exiting-using-limit-orders/ Strona 8 z 10
Exiting using limit orders – Alvarez Quant Trading 17.10.2019, 09)31

Previous post

Privacy Policy Testimonia


Read privacy policy “After working with Cesar
and barely profitable to c
– Individual Investor
Disclaimer
The information and analysis on this site is provided for informational
purposes only. Nothing herein should be interpreted as personalized “There no way I’d be prof
investment advice. Under no circumstances does this information professional advice and h
represent a recommendation to buy, sell or hold any security. None of the – Mark Angil, RBD Adap
information on this site is guaranteed to be correct, and anything written
here should be subject to independent verification. You, and you alone, are
solely responsible for any investment decisions you make. The ideas and
strategies should never be used without first assessing your own personal
and financial situation, or without consulting a financial professional. I “…I’ve known Cesar for 8
may hold positions for myself or clients in the securities or industries resource for financial mar
mentioned here. There is a very high degree of risk involved in trading coding. ….”
securities. Your use of any information on this site is entirely at your own
Rob Davenport – LCA Ca
risk. My thoughts and opinions will also change from time to time as I
learn and accumulate more knowledge.

“… Eventually, I realized t
engineered by Cesar. … H
understand, and that is ve
– Ronen Marom

https://alvarezquanttrading.com/blog/exiting-using-limit-orders/ Strona 9 z 10
Exiting using limit orders – Alvarez Quant Trading 17.10.2019, 09)31

Copyright text 2015 by Alvarez Quant Trading.

https://alvarezquanttrading.com/blog/exiting-using-limit-orders/ Strona 10 z 10

S-ar putea să vă placă și