- ago
Is there a way to programmatically (C# coded strategy) simulate / trigger the same functionality as clicking on the "Request Updates from Broker(s)" button on the Accounts page?
0
297
Solved
9 Replies

Reply

Bookmark

Sort
- ago
#1
What's the objective?
0
- ago
#2
Workaround for this unresolved issue.
0
- ago
#3
IMHO it might be best to invest effort into resolving an issue rather than spread it. :/
0
Glitch8
 ( 8.31% )
- ago
#4
Yes, you could call UpdateAccounts of the broker provider instance. For example, TraderBroker.Instance.UpdateAccounts().
0
Best Answer
Cone8
 ( 3.70% )
- ago
#5
I don't how quickly the live account responds, but it takes about 15 seconds for a Tradier paper account to update with account positions after an UpdateAccounts.
0
- ago
#6
I understand, @Eugene, and would generally agree, but it appears that we are at a dead-end (according to @Cone) at understanding what's causing the issue that I referred you to. Currently the Tradier broker is not practical for doing hands-off (...sorry I just got interrupted by a WL signal and I have to click the Update button. Really.)
(OK. I'm back...)
...trading.

If you review the remainder of the post, I think you will appreciate how much effort has gone into trying to nail this down.

My question was whether there is currently any way to do what I asked about. If not, then it will be up to WL to weigh whether the investment in a short-to-medium-term workaround like I suggested, that would make Tradier live trading more practical, is worth it.
0
- ago
#7
QUOTE:
I don't how quickly the live account responds, but it takes about 15 seconds for a Tradier paper account to update with account positions after an UpdateAccounts.

It does seem to take a while, but only about 3 seconds after the Update button is clicked. My thinking is to use the method @Glitch mentioned after every live trade and after a 15 second Sleep wait, then do-loop this method until position appears or disappears (depending on whether opening or closing) as expected.

What do you think?
0
- ago
#8
I put the code from Post #4 in the BacktestBegin() method and it works around one serious issue but highlights another. With this code, the Accounts page successfully updates with the broker account positions on the bar after the order is placed, so it prevents re-trading on already opened orders. However, this function does not cause the Order Manager to update the order status, so if a new order is placed for a symbol that already exists in the Order Manger but does not have Status "Filled" (all of them), the Order Manager will update the existing order without changing the status, preventing the new order from being placed with the broker.

The manual workaround to this issue is to "Kill Selected" for orders after they are placed. Then it works properly on the next signal.

Is there a programmatic function to update /change order status?
0
Cone8
 ( 3.70% )
- ago
#9
Not possible.
0

Reply

Bookmark

Sort