Stop sell order fails to place
Author: kazuna
Creation Date: 6/1/2009 2:49 PM
profile picture

kazuna

#1
This issue looks very bad and apparently stop sell order can fail to place under certain circumstance.

Here is what happened on my live account while auto-trading.

14:30 - 0: Order Active - Order Number: XXXXXXXX
14:31 - 0: Error(s): Sell stop orders attempt to prevent further losses if the stock drops. A sell stop requires a limit less than the current market price. Please review your order.
14:32 - 0: Order Cancel Pending
14:32 - 0: Order to SELL 1000 shares ABC: Canceled. 02:32 PM. Order Number: XXXXXXXX

As you can see, the previous lower stop sell order got cancelled but the new higher stop sell order failed to place. The strategy stops placing the stop sell order any more because the position is closed theoretically.

How can I prevent this problem?

I thought the market sell order should be placed instead in case if the stop sell order failed to place but this is not the case?
profile picture

Cone

#2
QUOTE:
How can I prevent this problem?
We've already alerted Fidelity that Wealth-Lab strategies may realistically and purposely place stop and limit orders that would execute at the current market price. You should call Fidelity and let them know that you're concerned about it too.

That aside, there's no way to ABSOLUTELY prevent it from occurring, though you can minimize the chances by simply checking the proximity of your stop (or limit) trigger price with the most recent close. Obviously, if you're going to place a SellAtStop order at or above the last close, then it's easy to create logic to place a Market order instead of a stop order. In doing so, you'll always be in synch.
profile picture

kazuna

#3
Sounds like this is a known issue. Only I wish I would have known it and so I didn't lose much $$$ today. Anyway I learned something today.

I actually started exploring but the suggesting would be to use market order instead of stop order, correct?

The disadvantage of not using stop order is:

1. the market order will end up being placed one bar behind that the stop order did.
2. no way to protect at the same bar exit because RiskStopLevel is essentially just a stop order.
3. no way to protect in case of power and network outage because no stop loss order is placed at fidelity backend.

Any concern I should know?
profile picture

Cone

#4
There are no disadvantages whatsoever. Per your points:

1. Incorrect. You continue to use Stop orders, however, when the time comes that you calculated a stop trigger price that is already beyond the current close, you switch to a market order. In other words, at that instant, instead of placing another stop order, you use a market order instead. The previous stop order is canceled, and "replaced" by a market order.

2. You can use the stop order for the same bar exit without a problem. It would be senseless to enter the position if you already know that the price is beyond your RiskStopLevel, so in that case, don't even enter the position.

... well, if you enter a position with a market order, I guess it is possible that by the time the order is executed, price has already moved past your stop trigger price. It's going to be a function of volatility and how tight you place the stop.

3. This doesn't have anything to do with the discussion of the market order. If you already have entered a stop order, it will continue to work after your power goes out. (Incidentally, a trading system should have a backup UPS so that would never happen anyway.)


I'm thinking you missed my point entirely. You should continue to use stop orders if you want to use them. However, you should add a little code to check (assuming long position):

CODE:
Please log in to see this code.

The result of this code should have little to no effect on backtesting your strategy, but it should minimize those order errors when trading live.
profile picture

kazuna

#5
The problem using the Stop orders still exist in your suggestion.
Because you never know if the stop price will be lower than the next bar market price.
It actually happened to me yesterday and the stock dropped more than 1% in one bar.
profile picture

Cone

#6
The only thing we're doing here is making sure that we're being smart about entering the next order. You're right that you don't know the open of the next bar, but there's only 1 tick of difference between the close and the open (though there could be many more before the order is actually placed). If the close is already lower than the stop price that you're going to enter for the next bar, use a market order instead. That's it.

The only situation that you'll have a problem is:
1. Close is at price X
2. Your SellAtStop trigger price is calculated to be X - Y.
3. Order is placed
4. During the delay from the close to placing the order, the market moves below X - Y.

Right, it can happen. Now go back and read my first post to see what you should do about it.
profile picture

kazuna

#7
Yes, I hear you saying. The situation you explained is exactly the issue I ran into a couple of times. Sometime the delay from executing the script to canceling the previous stop and placing the new stop takes more than 30 seconds and that's enough time for the market to go lower than the stop price. Probably this is more specific to my own strategy and because it keeps increasing the stop price from bar to bar. I understand your point that I have to calculate the stop price more carefully to prevent this situation. Although it won't prevent this situation from never occuring.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).