- ago
Hello,

I have a new problem after running the same strategy for a long time. I changed some of the parameters but I can't imagine why that would be causing this problem.

When the strategy changes the order and cancels the old order, it is canceling the new order at the same time resulting in no order being active. I have provided a couple of screenshots. The only message in the log that seems relevant is "10185: Failed to cancel PNL (not subcribed)" I am not sure what subscription it is referring to.

Also, I have found that in the order manager the old orders are being labeled as "filled" even though they have not been filled.

Let me know what other information I can provide.

Thanks,
Dandude




0
282
23 Replies

Reply

Bookmark

Sort
Cone8
 ( 6.17% )
- ago
#1
You posted a picture of the Order Manager with a bunch of Filled orders and 1 Active order - but filtered all the Canceled orders and cut off the Timestamp column. There's nothing here to work with.

If you want to try again, uncheck the Filter boxes for Canceled and Strategy Canceled.

I can't imagine a new order canceling an old one either and have never seen that except in the context of a bracket order. You can't change even the price in a bracket without canceling the other order too.

The PNL (not subscribed) message is a nothing burger.
0
- ago
#2
Ok I will try again when I have a chance. Unfortunately this only occurs when the strategy is in a position and then I have to watch it and reenter the orders, so it entails a bit of risk for a few seconds that the order is not placed.

I tried to test it with "use live positions" and when that option is checked it seems to think I am long contracts that I am not long, because it issued closing orders when I had no position (because I had switched off the algorithm overnight because it will not work). This despite the backtest without live positions did not have closing orders.

I will update with more description and screenshots when I have them.
0
Cone8
 ( 6.17% )
- ago
#3
QUOTE:
with "use live positions" and when that option is checked it seems to think I am long contracts that I am not long
Use Live Positions is not applicable to all strategies, but if the account doesn't have a position (and viewed by the Accounts tool) it certainly shouldn't "inject" one.

Nonetheless, switching a Preference like this one while trading is the wrong thing to do, but if you do it and the sync is wrong, you can hit the "Clear Saved Live Positions" button which is keeping track of your Auto trades for the session.
0
- ago
#4
Ok, so it looks like the reason WL is canceling the orders is because it thinks that the order is getting filled.

In the screenshot you can see that it says the order was "filled" and thus it canceled the OCO order.

There is a set of orders just below it because I had to run the strategy manually. You can see this by the time stamps. When I run the strategy manually, the following run does not cancel the orders. However, every run after that does cancel the orders, that is, when the orders are replacing a previous automatic run, they are immediately canceled.

Also I am getting the error, "OrderId 315041 that needs to be cancelled cannot be cancelled, state: Cancelled. "

I have gotten this error very regularly before but it never caused any problems.



0
- ago
#5
So I cleared local files and internal request tracking info for IBKR and now the strategies will not update during auto runs, only during manual runs.

So I broke my other strategies now.
0
- ago
#6
I thought maybe it was an issue with IBKR so I tried to switch to my IQFeed data. Unfortunately it is still returning "incomplete" when doing an auto run.
0
- ago
#7
I may have gotten the IQFeed workaround to work. I had to reupdate the data and ensure that it was connected to IQFeed. Not sure why it isn't reconnecting automatically, however.
0
Cone8
 ( 6.17% )
- ago
#8
QUOTE:
Also I am getting the error, "OrderId 315041 that needs to be cancelled cannot be cancelled, state: Cancelled. "
And it's not a problem. I just means that WL tried to cancel the bracket order after the fill, but IB had already done it.

Are we done? No real issue?
It seems that you were just confused by the indications because you weren't looking at all the order data before.
0
- ago
#9
The same issue from the original post remains: When using IBKR data the strategy cancels its own orders. I have used IQFeed's data as a workaround, however, this prevents me from using IQFeed's data for backtesting and development.
0
Cone8
 ( 6.17% )
- ago
#10
1. I cannot make anything out of the original post. The images don't support the claim, as I mentioned in Post #1.

2. Strategies are supposed to cancel their own orders when the signal no longer exists for the next interval. I don't get the connection with IBKR data.

3. If you want to pursue it, send a script that makes whatever scenario it is that happens to support@. It's still very unclear to me what you're seeing that's a problem.
0
- ago
#11
It is issuing an order and then canceling it immediately, labeling it as "filled" when it was not filled. The result is that the strategy has a signal but there is no order on IBKR because WL is issuing the order and then immediately canceling that same order in the same run of the strategy.

I don't know how to make a script to demonstrate that. I posted an updated screenshot with the "filled" message on the order when the price was not crossed. It was the same behavior I described in the first post where I showed a screenshot that the order was issued and canceled at the same time
0
Cone8
 ( 6.17% )
- ago
#12
Sorry that you're having trouble, but there are dozens of others including me trading without issue (except for this DST issue that popped up for the Europeans today). And, we haven't made any real functional changes for several months for the IB Provider.

Since it just started happening and that "data" is involved you should concentrate on that first. What is the difference there? Is the data delayed?

Also, are your builds of WL and IB Extension up-to-date?
0
- ago
#13
Yes I believe my software is up to date.

I am only able to investigate when the strategy is in a position, so I will have to investigate more tomorrow, unfortunately.

It certainly is strange that I am having trouble all of a sudden. I made some changes to the parameters of the strategy and that is the only thing that has changed. It seems as though WL is not interpreting the data from IBKR properly, or it is getting some signal telling it that the order was filled but this is causing it to send a cancellation to IBKR. I don't know, I am guessing at this point.
0
- ago
#14
So I am still having the same problem, and now my IQFeed workaround has failed. It is exhibiting the same behavior. The order manager labels one of the OCO orders as "filled", but you can see in the screenshot it has been canceled on IBKR. The timestamp says this happens one second after the order is created.

My data is not delayed on either provider (IBKR or IQFeed).

Could it be the market and symbols market setting for the contracts? Again, I have not made any changes there to explain this new problem.

Should I try streaming data instead of streaming bars? Or polling? It is a 15 minute strategy. I am open to investigating but I have run out of ideas at this point.

0
Cone8
 ( 6.17% )
- ago
#15
Send me the strategy.
0
Cone8
 ( 6.17% )
- ago
#16
Hey, why don't you try turning off the preference for GTC for all Strategy Orders. Maybe that's affecting those bracket orders in some way.
0
- ago
#17
Ok I sent it to support@wealth-lab.com
0
- ago
#18
I changed that setting and it did not fix the problem.

I also want to note again that it works when I run the strategy manually but not when the strategy runs automatically. This behavior is also very confusing to me. Currently it is returning as "incomplete" and giving no signals on IQFeed.

I just got this error as well:

--------
10/30/2024 10:31:51:290
IQFeed
Parse Error Streaming Bars: The input string 'n' was not in a correct format.
FormatException
The input string 'n' was not in a correct format.
at System.Number.ThrowFormatException[TChar](ReadOnlySpan`1 value)
at System.Int32.Parse(String s)
at WealthLab.IQFeed.IQFeedStreaming.ProcessStreamingBarMessage(String msg)
--------
0
Cone8
 ( 6.17% )
- ago
#19
Data errors happen. It was caught and reported, that's all.
0
- ago
#20
Were you able to reproduce the problem?
0
Cone8
 ( 6.17% )
- ago
#21
No, but I dedicated a machine to running your strategy on a paper IB account today.. still waiting for an entry...
0
- ago
#22
I noticed there was an update for IBKR. Any chance a fix was introduced?

There have been a few entries since your post, did your machine catch them?
0
Cone8
 ( 6.17% )
- ago
#23
No. No other reports of this and I can't duplicate it.
I offered to meet with you on zoom.
0

Reply

Bookmark

Sort