Skip to content

Commit

Permalink
Consistent naming for betfair account currency (#1340)
Browse files Browse the repository at this point in the history
  • Loading branch information
limx0 authored Nov 12, 2023
1 parent 5711da2 commit 6b557cc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions nautilus_trader/adapters/betfair/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from nautilus_trader.core.data import Data
from nautilus_trader.core.message import Event
from nautilus_trader.live.data_client import LiveMarketDataClient
from nautilus_trader.model.currency import Currency
from nautilus_trader.model.data.base import DataType
from nautilus_trader.model.data.base import GenericData
from nautilus_trader.model.enums import BookType
Expand Down Expand Up @@ -80,7 +81,7 @@ def __init__(
clock: LiveClock,
logger: Logger,
instrument_provider: BetfairInstrumentProvider,
account_currency: str,
account_currency: Currency,
strict_handling: bool = False,
):
super().__init__(
Expand All @@ -101,7 +102,7 @@ def __init__(
logger=logger,
message_handler=self.on_market_update,
)
self.parser = BetfairParser(currency=account_currency)
self.parser = BetfairParser(currency=account_currency.code)
self.subscription_status = SubscriptionStatus.UNSUBSCRIBED

# Subscriptions
Expand Down
6 changes: 3 additions & 3 deletions nautilus_trader/adapters/betfair/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class BetfairExecutionClient(LiveExecutionClient):
The event loop for the client.
client : BetfairHttpClient
The Betfair HttpClient.
base_currency : Currency
account_currency : Currency
The account base currency for the client.
msgbus : MessageBus
The message bus for the client.
Expand All @@ -114,7 +114,7 @@ def __init__(
self,
loop: asyncio.AbstractEventLoop,
client: BetfairHttpClient,
base_currency: Currency,
account_currency: Currency,
msgbus: MessageBus,
cache: Cache,
clock: LiveClock,
Expand All @@ -127,7 +127,7 @@ def __init__(
venue=BETFAIR_VENUE,
oms_type=OmsType.NETTING,
account_type=AccountType.BETTING,
base_currency=base_currency,
base_currency=account_currency,
instrument_provider=instrument_provider,
msgbus=msgbus,
cache=cache,
Expand Down
4 changes: 2 additions & 2 deletions nautilus_trader/adapters/betfair/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def create( # type: ignore
clock=clock,
logger=logger,
instrument_provider=provider,
account_currency=config.account_currency,
account_currency=Currency.from_str(config.account_currency),
)
return data_client

Expand Down Expand Up @@ -251,7 +251,7 @@ def create( # type: ignore
exec_client = BetfairExecutionClient(
loop=loop,
client=client,
base_currency=Currency.from_str(config.account_currency),
account_currency=Currency.from_str(config.account_currency),
msgbus=msgbus,
cache=cache,
clock=clock,
Expand Down

0 comments on commit 6b557cc

Please sign in to comment.