I have been trying to get a fairly basic buy at market/sell at market system to work. It is based on 15 minute bars. I am using IQ feed as a data source. I have no problem getting the entry buy order to trigger and submit properly to Tradier. The exit order never triggers. The buy order shows up in the order manager and fills. The status gets stuck on "CancelPending". I believe this is why the sell order never triggers. I may be wrong on that and would appreciate any help the community could provide. Screenshot provided.
![](/api/discussion/download/image/7796-order-manager-png)
Rename
Also here are my Trading Preferences if those might be creating an issue.
With Live Positions selected, the Positions would need to show up in the Accounts tool. That probably didn't happen because something went wrong with the order status. It shouldn't happen, but since it did...
1. In the Accounts tool, "Request Updates from Brokers". The Positions in your account should show up.
2. Restarting WealthLab will essentially do the same thing, but shouldn't be required.
Is your WealthLab and Tradier Extension up-to-date?
1. In the Accounts tool, "Request Updates from Brokers". The Positions in your account should show up.
2. Restarting WealthLab will essentially do the same thing, but shouldn't be required.
Is your WealthLab and Tradier Extension up-to-date?
I do have the latest versions of both WL and the Tradier extension.
I can see positions in the accounts tool.
I'll try again tomorrow and see if I get the same thing. I've been trying to get an entry and then an exit to trigger for about a week now. Can't get the exit order to trigger.
Should I leave the Accounts window open during the trading day? I'm not around when market is open.
I can see positions in the accounts tool.
I'll try again tomorrow and see if I get the same thing. I've been trying to get an entry and then an exit to trigger for about a week now. Can't get the exit order to trigger.
Should I leave the Accounts window open during the trading day? I'm not around when market is open.
Accounts doesn't have to be open. It's just to check that WL is aware of the Positions.
Still having the same problem. I made a simple moving average crossover system to test entering and exited trades with Tradier.
![](/api/discussion/download/image/7801-simple-system-1-png)
Here is a chart of the system after the days trading... We can see the 2 entries and 1 exit.
![](/api/discussion/download/image/7802-chart-1-png)
Here is the order manager...same issues I mentioned in the original post. It seems reporting back from the broker is hung up...
[removed image]
Any feedback would be appreciated. If anyone is using Tradier for autotrading maybe you could walk me through your setup.
Here is a chart of the system after the days trading... We can see the 2 entries and 1 exit.
Here is the order manager...same issues I mentioned in the original post. It seems reporting back from the broker is hung up...
[removed image]
Any feedback would be appreciated. If anyone is using Tradier for autotrading maybe you could walk me through your setup.
Don't skip any ...
1. What's happening to the QQQ Market orders? Are they actually filling in your account?
2. Do the positions show up in the Accounts tool?
3. If "yes" to #1 and "no" to #2, did you click the "Update" button I told you about?
4. Are their any messages from Tradier in the Log Viewer?
1. What's happening to the QQQ Market orders? Are they actually filling in your account?
2. Do the positions show up in the Accounts tool?
3. If "yes" to #1 and "no" to #2, did you click the "Update" button I told you about?
4. Are their any messages from Tradier in the Log Viewer?
Cone,
Yes the buy market order is filling. At that point my status in the order manager for that order is "placed". At Tradier the order is filled.
All existing positions show up in the account tool. But not the new QQQ buy order (which was filled).
Remotely I was able to click the "Update" and the status changed to "filled". Which now allows subsequent orders to fill.
It was then able to take the QQQ exit long position. But.....then the orders show the "cancel pending". In this state no new orders will fill (unless I hit that Update button again). Which is exactly happened in the afternoon as it passed on a buy order (had not hit Update button)
It seems communication between WL and Tradier is having an issue. I am thinking I am missing something simple in the settings, but I've gone through everything and don't see anything that might be related.
Also, could you delete the picture above of the order manager. Account number is shown.
Thanks for your help.
Yes the buy market order is filling. At that point my status in the order manager for that order is "placed". At Tradier the order is filled.
All existing positions show up in the account tool. But not the new QQQ buy order (which was filled).
Remotely I was able to click the "Update" and the status changed to "filled". Which now allows subsequent orders to fill.
It was then able to take the QQQ exit long position. But.....then the orders show the "cancel pending". In this state no new orders will fill (unless I hit that Update button again). Which is exactly happened in the afternoon as it passed on a buy order (had not hit Update button)
It seems communication between WL and Tradier is having an issue. I am thinking I am missing something simple in the settings, but I've gone through everything and don't see anything that might be related.
Also, could you delete the picture above of the order manager. Account number is shown.
Thanks for your help.
I forgot the log...
I'm not seeing anything off with the log. I can send you the txt file if needed.
I'm not seeing anything off with the log. I can send you the txt file if needed.
We'll check trading with our Sandbox account today.
Everything is still working fine at my end with Tradier, fills, cancels, etc.
However, I noticed that before the market opened, I wasn't getting an "Active" status. That may be correct since the order doesn't really go active until the open. However, the Fill status should still come through.
My question to you is, "is that the same scenario for you"? i.e., placing a Market order before the open?
My question to you is, "is that the same scenario for you"? i.e., placing a Market order before the open?
Cone, Glitch,
I do get active status before market open.
I'm going to show exactly what I had setup today.
I made this very simple system to test with.
![](/api/discussion/download/image/7813-the-system-png)
These were the strategy settings inside the Strategy Monitor..
![](/api/discussion/download/image/7814-strategy-settings-png)
Tradier is connected as I see the current holdings...
![](/api/discussion/download/image/7815-tradier-png)
Here is the strategy in Strategy Monitor end of day....
![](/api/discussion/download/image/7816-sm-eod-png)
And here is the order manager end of day..
![](/api/discussion/download/image/7818-om-eod-png)
Again we see "CancelPending. The order filled perfectly. But no exit order is able trigger with that status. I see the position in Tradier. The one share filled. But it's unable to perform the subsequent exit order.
I did not click "Request Updates from Broker" in accounts window during the day.
Here is the log during that period when filled and should have had an exit order.
![](/api/discussion/download/image/7819-log-png)
I don't know what the issue is. Everything seems to be working on your end. I'm just hoping someone may have the answer.
All the best and thanks for your time.
I do get active status before market open.
I'm going to show exactly what I had setup today.
I made this very simple system to test with.
These were the strategy settings inside the Strategy Monitor..
Tradier is connected as I see the current holdings...
Here is the strategy in Strategy Monitor end of day....
And here is the order manager end of day..
Again we see "CancelPending. The order filled perfectly. But no exit order is able trigger with that status. I see the position in Tradier. The one share filled. But it's unable to perform the subsequent exit order.
I did not click "Request Updates from Broker" in accounts window during the day.
Here is the log during that period when filled and should have had an exit order.
I don't know what the issue is. Everything seems to be working on your end. I'm just hoping someone may have the answer.
All the best and thanks for your time.
QQQ didn't show up in the Account Positions?
If that really occurs, I want to know what happens when you hit the "Request Updates..." button.
Apart from the premarket status that I noticed the other day, we're just not having the same experience - the order statuses and positions are received.
If that really occurs, I want to know what happens when you hit the "Request Updates..." button.
Apart from the premarket status that I noticed the other day, we're just not having the same experience - the order statuses and positions are received.
It did not show up in the accounts window in WL. End of day I did hit update brokers and then I could see the long position. During the trading day I could see the long position in the Tradier app.
For the time being and for whatever reason, that Market order isn't returning a fill status for you. It's not occurring for us, but we'll keep an eye out for it.
If that happens after a fill, check the Accounts window.
If the position isn't there, hit "Request Updates" and it should appear.
Then you're exit logic will work.
If that happens after a fill, check the Accounts window.
If the position isn't there, hit "Request Updates" and it should appear.
Then you're exit logic will work.
I am having the same issue with Tradier. Positions I open are not detected by WL in the broker account. As a result, my strategy keeps placing new orders for positions that are already open. This is a new behavior that started yesterday and continues today.
The positions do not appear in the Accounts window until I Request Updates from Broker(s). Then they appear and my strategy runs normally. It seems that updates in the broker account are not recognized by WL without manually requesting them.
I know that Tradier had some technical issues yesterday. I don't know if this is an issue on their side. I will reach out to their tech support to see if I can get additional info.
Addendum
The strategy referred to above is a strategy that uses 1-min streaming data. I wonder if this could be related to new issue I just reported here.
The positions do not appear in the Accounts window until I Request Updates from Broker(s). Then they appear and my strategy runs normally. It seems that updates in the broker account are not recognized by WL without manually requesting them.
I know that Tradier had some technical issues yesterday. I don't know if this is an issue on their side. I will reach out to their tech support to see if I can get additional info.
Addendum
The strategy referred to above is a strategy that uses 1-min streaming data. I wonder if this could be related to new issue I just reported here.
That makes 2 of you with live accounts that are not getting a proper order status. Unfortunately, it's working fine with the paper account and we don't have a live account to work with.
@Cone
Is there some data I can capture / extract to help? Clicking "Request Updates...." after every trade keeps the account positions up-to-date and is a temporary workaround to the problem for daily strategies, but manually intensive for intraday trading.
Here's what I got back from Tradier tech support:
I'm still not convinced that the problem is not originating at Tradier since I didn't see this problem two days ago. But I can't prove it. I would need some (non-WL) sample code (which I am not capable of producing) to prove this to Tradier tech support. It may be something that cropped up that's unique to handshaking with WL.
I checked log but didn't find any broker error messages today related to this. Yesterday I got this broker error message
I don't know if that's related or might be a clue. It might be related to some issue Tradier acknowledged they had yesterday.
BTW, you can set up (or maybe you already have) a live account with Tradier without depositing any $$ and get access to services including streaming and broker API and streaming connection. Of course, you would have to buy and briefly hold at least one position of a low-priced stock to see this issue.
I can also make my PC virtually available to you in live trading mode, if that would help.
Is there some data I can capture / extract to help? Clicking "Request Updates...." after every trade keeps the account positions up-to-date and is a temporary workaround to the problem for daily strategies, but manually intensive for intraday trading.
Here's what I got back from Tradier tech support:
QUOTE:
Tech. replied
Jun 7, 11:22am
We have no outages or issues reported this morning on our side, so this may be a local issue with your code. If you have any questions related to trading or your account you can reach our brokerage support team at service@tradierbrokerage.com.
All the best,
I'm still not convinced that the problem is not originating at Tradier since I didn't see this problem two days ago. But I can't prove it. I would need some (non-WL) sample code (which I am not capable of producing) to prove this to Tradier tech support. It may be something that cropped up that's unique to handshaking with WL.
I checked log but didn't find any broker error messages today related to this. Yesterday I got this broker error message
QUOTE:
Unexpected character encountered while parsing value: o. Path '', line 0, position 0.
order not in valid state for modifications
I don't know if that's related or might be a clue. It might be related to some issue Tradier acknowledged they had yesterday.
BTW, you can set up (or maybe you already have) a live account with Tradier without depositing any $$ and get access to services including streaming and broker API and streaming connection. Of course, you would have to buy and briefly hold at least one position of a low-priced stock to see this issue.
I can also make my PC virtually available to you in live trading mode, if that would help.
Thanks for the offer, but we'd need to verify the status messages from Tradier in Debug mode on Dev machine.
I thought that might be the case. If you have some code that you want me to run locally, I can do it.
BTW, now I am getting CancelPending as a status in the Order Manager (as in Post #12) when attempting auto-place a Buy. Position is not opened.
ADDENDUM
A restart of WL cleared up the CancelPending problem. Buys are being placed again.
BTW, now I am getting CancelPending as a status in the Order Manager (as in Post #12) when attempting auto-place a Buy. Position is not opened.
ADDENDUM
A restart of WL cleared up the CancelPending problem. Buys are being placed again.
CancelPending is actually an indication of a lack of an order status from the broker.
QUOTE:
it's working fine with the paper account and we don't have a live account to work with.
This morning, I switched to Tradier Sandbox to test this while the market is open. I am getting the same behavior with the Sandbox as with the live broker.
I created a simplistic block strategy that buys at market SPY and QQQ options. It places the trades successfully and my Tradier dashboard shows them immediately filled in the Sandbox account. However, the WL Order Manager shows these positions' Status as Placed but never changes to Filled. Also, the WL Account page does not show these new positions until I click "Request Updates..."
When this test is run immediately after restarting WL (which has to be done with Tradier to switch from Sandbox to Live, and vice-versa), it appears that it may, without manual intervention, correctly account for the very first trade after startup but not subsequent trades.
Addendum
Spontaneously, this morning the Tradier broker WL Account updating started working properly with live trading. I can only guess it could have been caused by something on Tradier's side (which I originally suspected) and now their glitch has been fixed. I have made four roundtrip trades with successful auto-updates of WL Account. I will monitor for the rest of the day and report.
Addendum 2
WL just placed close on QQQ option. Status is CancelPending in Order Manager but trade completed at Tradier. Accounts page required manual update to remove the symbol from active list.
WL just placed close on SPY option. Same story.
Unfortunately, it's looking like it could be an intermittent problem. :(
I was able to see the failure mode once today too. But after putting some debug code in place and restarting (4 times) I couldn't make it fail again.
Restarting may actually help it to work, not fail. Once it fails, it should fail each time there is a transaction, as long as you don't restart WL.
From Post #22:
From Post #22:
QUOTE:
it appears that it may, without manual intervention, correctly account for the very first trade after startup but not subsequent trades.
Yah, I mentioned the reason for doing it.
Today, it worked for me for a handful of trades, and then failed. Once it failed subsequent trades always failed. Depending what your setup is, trading on a schedule for a few hours may cause the error. I think it would have to be run during market hours. The good news is it looks like the Sandbox mode may be sufficient to cause an error.
ADDENDUM
BTW, if's it's a helpful clue, the problem also shows up when it executes limit orders. Executed orders remain in "Placed" status in Order Manager.
ADDENDUM 2
FWIW, after failing all day, in the last market hour, it executed 7 successful fill trades in a row. All ended up in the Account window without manual intervention. All these were executed after a WL restart, but I don't know if that had anything to do with it.
ADDENDUM
BTW, if's it's a helpful clue, the problem also shows up when it executes limit orders. Executed orders remain in "Placed" status in Order Manager.
ADDENDUM 2
FWIW, after failing all day, in the last market hour, it executed 7 successful fill trades in a row. All ended up in the Account window without manual intervention. All these were executed after a WL restart, but I don't know if that had anything to do with it.
For those seeing the issue, do you have have more than one instance of WealthLab running with Tradier installed and connected?
I did when I saw the issue. Today, I killed the other instance and do not see the problem.
I did when I saw the issue. Today, I killed the other instance and do not see the problem.
I definitely only have 1 instance of WL open when these issues have occured.
And only 1 computer?
Considering we're using a websocket, it's a long shot. But the problem is verified that we're not receiving all the order status messages. I'm grasping for reasons what could cause it.
Considering we're using a websocket, it's a long shot. But the problem is verified that we're not receiving all the order status messages. I'm grasping for reasons what could cause it.
I don't know how to create multiple instances of Tradier. I'm pretty sure you don't mean multiple strategies using Tradier data / broker as "multiple instances,", so no. Besides, occasionally, it works.
I don't know if it's related, but I've had some issues with Tradier backend rejecting trades because it can't get the "price." It appears to "give up" too soon, according to their trading desk (these are on highly liquid options). I've reaching here, but maybe there is a timing / synchronization issue where Tradier is providing a status before / after WL can pick it up?
I'm also wondering why you don't see the problem every time, or at least most of the time. Could there be something different with my settings than yours?
I don't know if it's related, but I've had some issues with Tradier backend rejecting trades because it can't get the "price." It appears to "give up" too soon, according to their trading desk (these are on highly liquid options). I've reaching here, but maybe there is a timing / synchronization issue where Tradier is providing a status before / after WL can pick it up?
I'm also wondering why you don't see the problem every time, or at least most of the time. Could there be something different with my settings than yours?
Today I ran the simple system noted above and for the first time. I was able to get an entry AND exit.. Not sure what changed but hopefully a step in the right direction. I will test again tomorrow.
As to your question about having only 1 computer running WL. That has been the case through all my previous testing.
That answers that. Nothing has changed, we have to determine the source of the intermittent failure (the hardest kind of problem to solve).
Cone, thank you for all that you're doing! It's appreciated.
@Cone would it be helpful if I ran a modified version of WL that contains your debug code and I could share file output or whatever you are capturing?
I was already able to see that we're not receiving all the order status updates from the websocket. That's confirmed. Since there's no other path, we have to kick it over to Tradier to investigate.
I should also thank @innertrader for his insights on this thread as well. :)
Does Tradier have special / dedicated support for platform providers like Wealth-Lab?
We've contacted them through our business channel.
.. but nobody has support like WealthLab! ;)
.. but nobody has support like WealthLab! ;)
I believe that!
This morning this issue resolved itself. Trades are now appearing in the Accounts page (I removed the workaround code to confirm) and order status is being updated to Filled. So far, it's worked for all three trades this morning.
I am going to reach out to Tradier to see if they had a software update on their side overnight.
I am going to reach out to Tradier to see if they had a software update on their side overnight.
Here's Tradier's response
Helpful. (Not).
QUOTE:
As a Tech company working in the financial space, we are constantly working on updates and improvements. I am glad to hear the issue is resolved but I do not have the ability to share details on nonpublic releases.
All the best,
Tradier Support
techsupport@tradier.com
Helpful. (Not).
They weren't able to duplicate it unless the order occurred at the very end of the day or after hours (Pending). So it's just an intermittent issue that happens to be working today, like it usually does for us too.
For me, it failed consistently, every single trade, for the last few weeks. So it was not intermittent from my perspective. Today, zero trades have failed. If this problem unfortunately recurs, would you say it points to a change at Tradier that WL has no (known) control over or countermeasures for?
Sadly, Tradier cannot be a long-term broker for me if this will be a recurring issue.
Sadly, Tradier cannot be a long-term broker for me if this will be a recurring issue.
We don't know where the problem source is yet. If we (or Tradier) did, it would probably be fixed already.
I'm sad to report that the problem is happening again today on every trade.
It started working again early this morning. That's never happened before.
However. maybe the following is a clue to why?
It only started working after I restarted WL. I restarted WL because the strategy suddenly stopped generating signals from the SM, even though it was getting streaming data and processing symbols. I've never seen that problem before.
Since I'm using Tradier streaming data and broker, I'm wondering if something (server?) changed on the Tradier side mid-morning that initially caused WL to hiccup, and then work properly after restart and a fresh connect (with something new at Tradier).
Update
Started failing again, spontaneously.
However. maybe the following is a clue to why?
It only started working after I restarted WL. I restarted WL because the strategy suddenly stopped generating signals from the SM, even though it was getting streaming data and processing symbols. I've never seen that problem before.
Since I'm using Tradier streaming data and broker, I'm wondering if something (server?) changed on the Tradier side mid-morning that initially caused WL to hiccup, and then work properly after restart and a fresh connect (with something new at Tradier).
Update
Started failing again, spontaneously.
QUOTE:
I'm wondering if something (server?) changed on the Tradier side mid-morning that initially caused WL to hiccup, and then work properly after restart and a fresh connect
I was going to remain silent on this issue, but the comment above confirms what I thought all along.
@Cone
The problem is the session "state variables" (and yes that would include trade "status") are getting out of sync between client and server. Once that happens, the session integrity collapses.
What is commonly done is a session "reset" to bring all the state variables between client and server back to a known state to recover the session whenever a watchdog timer times out. That's the brute force tactic to preserve the sanity of the session. It's not a fix, but it will get the client/server session recovered.
The next question is what's causing the client/server state variables to get out of sync in the first place? Is the problem hardware or software? (e.g. Could the load balancer be dropping packets on the server side?) We don't have control of that, but what would be helpful is the dump the session state variables when performing a session "reset" so there's some diagnostics given. Perhaps even list the state variables that changed before and after the reset.
If it's a hardware problem (Is the server's firewall eating status packets?), it might take them months to figure out--get use to it. But at least the brute force recovery discussed above with get you through it until it's fixed. Happy computing.
We use socket connections. There is no "sync". Sockets are full duplex.
QUOTE:
We use socket connections. There is no "sync". Sockets are full duplex.
I'm not talking about socket state variables (.NET handles those). I'm talking about trading state variables such as trade status. Variables that WL depends on that define the WL application session, not the socket session. They are getting out of sync.
Tradier should have a reset call to re-sync those. If they don't, then you need to gripe to Tradier about getting one. If they aren't helpful (i.e. not professional), then I would drop support for them altogether. (Even the IEEE 488 instrument bus has a special instruction to tell the lab instrument to dump its state variables to the instrument device driver on the computer to re-sync.)
One thing you can do is close the Tradier session, then re-open it again; that should reset things. Not an ideal approach, but if there's no other choice ...
---
Somebody probably made the rules on their firewall more restrictive (which is a good thing), but didn't tell the software guys about it, so now their firewall selectively rejects some trading status packets and such. It happens.
I'd appreciate if you guys would give it a chance again. I'm pretty confident we found the solution. I haven't seen even one failure with build 28.
Your Response
Post
Edit Post
Login is required