Add Elasticsearch support
This commit is contained in:
@@ -7,7 +7,7 @@ from alpaca.trading.requests import (
|
||||
MarketOrderRequest,
|
||||
)
|
||||
|
||||
from core.exchanges import BaseExchange, ExchangeError, GenericAPIError
|
||||
from core.exchanges import BaseExchange, ExchangeError, GenericAPIError, common
|
||||
|
||||
|
||||
class AlpacaExchange(BaseExchange):
|
||||
@@ -38,6 +38,13 @@ class AlpacaExchange(BaseExchange):
|
||||
except ValueError:
|
||||
raise GenericAPIError(f"Balance is not a float: {equity}")
|
||||
|
||||
common.get_balance_hook(
|
||||
self.account.user.id,
|
||||
self.account.user.username,
|
||||
self.account.id,
|
||||
self.account.name,
|
||||
balance,
|
||||
)
|
||||
return balance
|
||||
|
||||
def get_market_value(self, symbol): # TODO: pydantic
|
||||
|
||||
Reference in New Issue
Block a user