- ago
Not sure what's going on here, but here is my set-up. I have a couple strategies trading simultaneously and the limit/stoploss works fine during the day and many times overnight. However I've noticed today that I got a "FinalOrder" status at the end of the day, and found that all my orders were cancelled in ToS.

Here are some images of my preferences and one of the trades.

Preferences screen:


Order Manager:


ToS Order History:
0
423
26 Replies

Reply

Bookmark

Sort
- ago
#1
After waiting a bit, it turns out the limits were placed but the stop losses were rejected. Is this an issue with ToS?
0
Glitch8
 ( 9.82% )
- ago
#2
It’s hard to say without having the strategy to analyze. But it’s normal for the FinalOrder to pause for a while before getting submitted to the broker. We designed it that way because some brokers won’t accept orders submitted too shortly after the market close.
0
- ago
#3
That doesn't seem to be the issue. In the Order Manager the order is scheduled to be placed but Schwab returns an error. It doesn't seem to be a strategy or a WL issue but something with Schwab.

Occasionally an order gets an error during the day (this is an hourly strategy) but Schwab retains the existing order. At EOD, however, it randomly cancels either the limit or the stop order.
0
Cone8
 ( 6.07% )
- ago
#4
If any, what's the error message? Double click the order or look in the Log Viewer.
0
- ago
#5
Here's the message log from this morning:

Message Log - Use the green Connect button to connect to a Broker. You may need to Configure it first.
Schwab Broker: Error Getting Orders: Generic error
Schwab Broker: 03:30:19 Exception Getting Orders: One or more errors occurred. (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (api.schwabapi.com:443))
03:30:47 Internet restored! Reconnecting...
Schwab Broker: Exception Checking Order Response: Object reference not set to an instance of an object.
Schwab Broker: Exception Checking Order Response: Object reference not set to an instance of an object.
Schwab Broker: Exception Checking Order Response: Object reference not set to an instance of an object.

Here are a couple examples of orders that were placed and were rejected or were placed on one side but not the other.

0
Cone8
 ( 6.07% )
- ago
#6
We can fix that Object reference error, but it won't change the result.
I'll experiment with Cancel/Replace GTC orders to see what can be found.
0
- ago
#7
Thanks.

Separate note, but Schwab does not like Short orders being placed at GTC, at least for thinly traded ETFs. I get a rejection notice on those. It will accept an Day order, but not GTC.
0
Cone8
 ( 6.07% )
- ago
#8
Canceling the GTC happens all throughout the days. Before placing the new orders the first thing that happens is canceling the order orders. It's just that during the trading day the new orders become Active quickly.

The last bar of the day is different like Glitch explained. The "Final Orders" aren't placed for another 15 minutes - and here's where the REJECT happens. It seems that in this case they're not being placed as OCO. After one order is placed, the other is rejected for a possible oversell condition.

We'll work on it.
0
- ago
#9
Thanks, let me know if you need any more data/info.
0
- ago
#10
I watched it closely today. All orders were cancelled at the end of day, then Schwab
treated the replacement orders 15 minutes after the close like separate (i.e. not OCO) orders. It randomly rejected the Limit or Stop order with the message that it "...may result in an oversold/overbought position in your account."
0
ww58
- ago
#11
What about stop orders for strategies overnight?

I ran into the following today: I didn't use “Use GTC for all”. Today I noticed that the sl/tp for the strategy was canceled at the end of the day, as it should be, I did not take this into account in the strategy. I saw this and enabled “Use GTC”, then in Strategy Monitor I manually executed before market opening, the orders showed up in Order Manager as FinalOrder, but I don't see them at the broker.
0
Glitch8
 ( 9.82% )
- ago
#12
FinalOrder orders are in a kind of holding pattern. They will get submitted after a delay of 15 minutes.
0
ww58
- ago
#13
QUOTE:
FinalOrder orders are in a kind of holding pattern. They will get submitted after a delay of 15 minutes.

I'm aware of that. I've modified the IB FinalOrder delay to 1 min, they never showed up. Anyway, I think there should be a separation of DAY for getting into position and GTC for sl/tp. Otherwise we may get execution on the account but not in the backtest.

Therefore, my suggestion is to make an option to enable GTC for exit orders only
0
Cone8
 ( 6.07% )
- ago
#14
When you say, "they never showed up", do you mean that:
a) your signal did not appear with a "FinalOrder" status in the Order Manager?
b) A FinalOrder did appear, but it was never Placed?

If that answer is "b", I'll suggest that 1 Minute is too soon to place a FinalOrder. I suspect what happened is that you have "Auto-Remove" options selected that auto-removed the order after it was placed and probably rejected.
0
ww58
- ago
#15
B. I didn't pay attention to the status btw. The important thing is that I just double-checked on an open position, the orders were placed immediately at the broker with execution at the opening of the session. So apparently everything is working as it should. Then I even have no need to use GTC.

I don't know what the reason is that that original order didn't go to the broker. I'll keep an eye on it
0
ww58
- ago
#16
Update: Final Order Delay for IB is set to 25, however in the order manager I see FinalOder status 2 second right after market close. Accordingly they were removed and position left without sl/tp
0
Cone8
 ( 6.07% )
- ago
#17
I don't think you understand how this works.

If you place orders at 4pm for the next day, brokers will immediately reject the order as being "too late". Therefore, these orders are given a FinalOrder status and held for the default 15-minute delay, or whatever you enter for IB. You must leave the Order Manager working during this time and when the delay expires, the orders will be placed (for the next market session).

That said, the problem with one order of a bracket pair being cancelled will be fixed for Build 123. Currently, these Final Orders are being placed separately and not as OCO.
0
ww58
- ago
#18
QUOTE:
You must leave the Order Manager working during this time and when the delay expires, the orders will be placed (for the next market session).
Yes, that's exactly how I understand it. I noticed it an hour after the market closed, meaning that at that point, after the 25 minutes specified the SL/TP orders should have been placed, but they weren't. If this behavior is going to be fixed in version 123, then there's no issue.

As I understand it, since a 25-minute delay is specified, no further actions are required from me, and assuming the program hasn't been touched, these orders should be placed with the broker 25 minutes after the market closes.
0
Cone8
 ( 6.07% )
- ago
#19
Let's go back to this:
"I see FinalOder status 2 second right after market close. Accordingly they were removed and position left without sl/tp. "

What do you mean by "Accordingly they were removed?"
That you saw orders with "FinalOrder" status and they disappeared after 2 seconds?

If that's the case, tell me which of the "Auto-Remove" buttons you have checked:

0
ww58
- ago
#20
QUOTE:
If that's the case, tell me which of the "Auto-Remove" buttons you have checked:
None

QUOTE:
What do you mean by "Accordingly they were removed?"
By "removed" I mean by the exchange, since I didn't see them in the terminal.

Let me explain again: one hour after the market closed, I checked both the terminal and the program - both were open. In the program, there were two orders with the status FinalOrder and timestamps two seconds after the market closed. In the terminal, there were no orders, although I suspect they should have appeared 25 minutes later.
0
Cone8
 ( 6.07% )
- ago
#21
Ok, got it. The orders with FinalOrder status should be placed after the [25 min] delay.
What did the statuses of those orders become in WealthLab at 16:25:01?
0
ww58
- ago
#22
QUOTE:
What did the statuses of those orders become in WealthLab at 16:25:01?
I looked an hour after closing, the status was FinalOrder, the Message column was empty
0
Cone8
 ( 6.07% )
- ago
#23
Since I've never seen this fail, just make a change - make the delay 10 or 15 minutes and let's see what happens in the next half hour.
0
ww58
- ago
#24
The situation repeated, now I can definitely see that FinalOrder is not working for me. One hour after the market closed (23 in local timezone), I made this screenshot. That was yesterday. Today, there were no orders submitted at the opening. Nor were there any afterward. Then I manually clicked Place Orders, they didn't show up either. Only when I manually canceled 2 FinalOrder in Order Manager and clicked Place Orders again, they appeared at the broker.
0
Cone8
 ( 6.07% )
- ago
#25
It's not clear to me from the description that you left the Order Manager open and working for the 15 (or 25) minute delay period after the close. For example, the computer cannot be off, sleeping, or hybernating. If the delay was set for 15 minutes, the orders would have been placed automatically at 23:15 local.

Again, I've never seen this fail. (However one of those orders may fail because they won't be placed in as OCO until WL8 Build 123.)
0
ww58
- ago
#26
QUOTE:
It's not clear to me from the description that you left the Order Manager open and working for the 15 (or 25) minute delay period after the close. For example, the computer cannot be off, sleeping, or hybernating. If the delay was set for 15 minutes, the orders would have been placed automatically at 23:15 local.

According to your message, the Order Manager should be open. I never thought about it, because everything always worked with Strategy Monitor window only. I opened the Help and there is a section called FinalOrder and it also says that it should be open. That seems to be the problem, I'll leave it open. Thanks. Especially if in the next version all bugs are taken into account then I think there should be no more problems.
1

Reply

Bookmark

Sort