Alpaca-API icon indicating copy to clipboard operation
Alpaca-API copied to clipboard

no account updates on submitted orders?

Open d-e-s-o opened this issue 6 years ago • 5 comments

(paper trading; v1)

Is it intentional that no account updates are sent when an order is submitted/filled?

According to the documentation:

This stream provides clients with updates pertaining to their brokerage accounts at Alpaca, including balance information.

Yet, I don't get an updated when I submit an order and it is filled subsequently. Shouldn't the account balance change when doing that?

When I explicitly retrieve /v1/account information I see a difference in cash: 55279.74 USD beforehand, 54987.27 USD now

I have the following code for streaming updates:

import alpaca_trade_api as tradeapi

conn = tradeapi.StreamConn()

@conn.on(r'account_updates')
async def on_account_updates(conn, channel, account):
    print('account', account)


# blocks forever
conn.run(['account_updates'])

d-e-s-o avatar Jun 25 '19 15:06 d-e-s-o

Hello, currently, we're not sending account updates with order updates. This is something that we would like to address, but it's not a feature we've had a chance to implement yet.

ttt733 avatar Jul 02 '19 17:07 ttt733

This would be the most common reason an account would "update". Otherwise if we are tracking how much tradable cash or buying power is in the account, we either need to calculate that manually after every trade comes through, or call out to the API to do a GET to download the account, which kind of defeats the point of subscribing to account updates. Don't most algorithms need to know how much is in the account to help them decide how many shares to buy of a particular stock?

I guess this is just a theoretical concern for me at the moment, as I am now realizing the strategy I am currently exploring works better without streaming anyways.

still-dreaming-1 avatar Jun 15 '20 22:06 still-dreaming-1

This would be the most common reason an account would "update". Otherwise if we are tracking how much tradable cash or buying power is in the account, we either need to calculate that manually after every trade comes through, or call out to the API to do a GET to download the account, which kind of defeats the point of subscribing to account updates. Don't most algorithms need to know how much is in the account to help them decide how many shares to buy of a particular stock?

I guess this is just a theoretical concern for me at the moment, as I am now realizing the strategy I am currently exploring works better without streaming anyways.

I completely agree with this. I think that publishing events relating to our account would drastically improve and ease the development of algos.

dans-acc avatar Dec 14 '20 23:12 dans-acc

Meanwhile, in typical underhand fashion in a commit talking about something completely different, the section about account updates was removed from the docs. So expect that within half a year it will be removed entirely. No pull request, no review, no rationale provided, no discussion, no announcement, no deprecation notice, nothing. Alpaca. And not even that they manage to do properly for a change and left half the references to account updates in place: account_updates

Un-be-lie-va-ble.

d-e-s-o avatar Dec 15 '20 01:12 d-e-s-o

Meanwhile, in typical underhand fashion in a commit talking about something completely different, the section about account updates was removed from the docs. So expect that within half a year it will be removed entirely. No pull request, no review, no rationale provided, no discussion, no announcement, no deprecation notice, nothing. Alpaca. And not even that they manage to do properly for a change and left half the references to account updates in place: account_updates

Un-be-lie-va-ble.

Hello,

The section was removed as there are not any actual messages to be streamed from that subscription channel

jasonbohne123 avatar Dec 16 '20 01:12 jasonbohne123