class ArrayStr(Array, contains=str):
class ArrayTradeID(Array, contains=TradeID):
class ArrayTransactionFilter(Array, contains=TransactionFilter):
class ArrayTransactionID(Array, contains=TransactionID):
class ArrayDict(Array, contains=dict):
class ClientExtensions(Model):
class TakeProfitDetails(Model):
class StopLossDetails(Model):
class TrailingStopLossDetails(Model):
class OrderRequest(Model, jit=False):
class UnitsAvailableDetails(Model):
class UnitsAvailable(Model):
class LiquidityRegenerationScheduleStep(Model):
class ArrayLiquidityRegenerationScheduleStep(Array, contains=LiquidityRegenerationScheduleStep):
class LiquidityRegenerationSchedule(Model):
class CandlestickData(Model):
class OrderIdentifier(Model):
class QuoteHomeConversionFactors(Model):
class MarketOrderMarginCloseout(Model):
class InstrumentCommission(Model):
class OrderBookBucket(Model):
class ArrayOrderBookBucket(Array, contains=OrderBookBucket):
class PositionBookBucket(Model):
class ArrayPositionBookBucket(Array, contains=PositionBookBucket):
class DynamicOrderState(Model):
class ArrayDynamicOrderState(Array, contains=DynamicOrderState):
class CalculatedPositionState(Model):
class ArrayCalculatedPositionState(Array, contains=CalculatedPositionState, one_to_many=False):
class PositionSide(Model):
class Position(Model):
class ArrayPosition(Array, contains=Position, one_to_many=False):
class PriceBucket(Model):
class ArrayPriceBucket(Array, contains=PriceBucket):
class ClientPrice(Model):
class PricingHeartbeat(Model):
class CalculatedTradeState(Model):
class ArrayCalculatedTradeState(Array, contains=CalculatedTradeState):
class MarketOrderDelayedTradeClose(Model):
class MarketOrderPositionCloseout(Model):
class MarketOrderTradeClose(Model):
class OpenTradeFinancing(Model):
class ArrayOpenTradeFinancing(Array, contains=OpenTradeFinancing):
class PositionFinancing(Model):
class ArrayPositionFinancing(Array, contains=PositionFinancing):
class TradeOpen(Model):
class VWAPReceipt(Model):
class UserInfo(Model):
class AccountProperties(Model):
class ArrayAccountProperties(Array, contains=AccountProperties):
class Candlestick(Model):
class ArrayCandlestick(Array, contains=Candlestick):
class OrderBook(Model):
class PositionBook(Model):
class Order(Model):
class ArrayOrder(Array, contains=Order):
class TradeReduce(Model):
class ArrayTradeReduce(Array, contains=TradeReduce):
class TransactionHeartbeat(Model):
class UserInfoExternal(Model):
class TradeSummary(Model):
class ArrayTradeSummary(Array, contains=TradeSummary):
class Transaction(Model):
class ArrayTransaction(Array, contains=Transaction):
class AccountChanges(Model):
class GuaranteedStopLossOrderLevelRestriction(Model):
class Instrument(Model):
class ArrayInstrument(Array, contains=Instrument, one_to_many=False):
class AccountChangesState(Model):
class Price(Model):
class ArrayPrice(Array, contains=Price):
class CloseTransaction(Transaction, type=TransactionType('CLOSE')):
class MarginCallEnterTransaction(Transaction, type=TransactionType('MARGIN_CALL_ENTER')):
class MarginCallExitTransaction(Transaction, type=TransactionType('MARGIN_CALL_EXIT')):
class MarginCallExtendTransaction(Transaction, type=TransactionType('MARGIN_CALL_EXTEND')):
class ReopenTransaction(Transaction, type=TransactionType('REOPEN')):
class ResetResettablePLTransaction(Transaction, type=TransactionType('RESET_RESETTABLE_PL')):
class StopLossOrderRequest(OrderRequest, type=OrderType('STOP_LOSS')):
class TakeProfitOrderRequest(OrderRequest, type=OrderType('TAKE_PROFIT')):
class TrailingStopLossOrderRequest(OrderRequest, type=OrderType('TRAILING_STOP_LOSS')):
class CreateTransaction(Transaction, type=TransactionType('CREATE')):
class ClientConfigureTransaction(Transaction, type=TransactionType('CLIENT_CONFIGURE')):
class DelayedTradeClosureTransaction(Transaction, type=TransactionType('DELAYED_TRADE_CLOSURE')):
class OrderCancelTransaction(Transaction, type=TransactionType('ORDER_CANCEL')):
class OrderClientExtensionsModifyTransaction(Transaction, type=TransactionType('ORDER_CLIENT_EXTENSIONS_MODIFY')):
class DailyFinancingTransaction(Transaction, type=TransactionType('DAILY_FINANCING')):
class TradeClientExtensionsModifyTransaction(Transaction, type=TransactionType('TRADE_CLIENT_EXTENSIONS_MODIFY')):
class AccountSummary(Model):
class MarketOrderRequest(OrderRequest, type=OrderType('MARKET')):
class TakeProfitOrderTransaction(Transaction, type=TransactionType('TAKE_PROFIT_ORDER')):
class TakeProfitOrder(Order, type=OrderType('TAKE_PROFIT')):
class StopLossOrder(Order, type=OrderType('STOP_LOSS')):
class TrailingStopLossOrder(Order, type=OrderType('TRAILING_STOP_LOSS')):
class Trade(Model):
class ArrayTrade(Array, contains=Trade):
class ClientConfigureRejectTransaction(Transaction, type=TransactionType('CLIENT_CONFIGURE_REJECT')):
class OrderCancelRejectTransaction(Transaction, type=TransactionType('ORDER_CANCEL_REJECT')):
class OrderClientExtensionsModifyRejectTransaction(Transaction,
                                                   type=TransactionType('ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT')):
class TradeClientExtensionsModifyRejectTransaction(Transaction,
                                                   type=TransactionType('TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT')):
class TransferFundsTransaction(Transaction, type=TransactionType('TRANSFER_FUNDS')):
class TransferFundsRejectTransaction(Transaction, type=TransactionType('TRANSFER_FUNDS_REJECT')):
class LimitOrderRequest(OrderRequest, type=OrderType('LIMIT')):
class MarketIfTouchedOrderRequest(OrderRequest, type=OrderType('MARKET_IF_TOUCHED')):
class StopOrderRequest(OrderRequest, type=OrderType('STOP')):
class Account(AccountSummary):
class MarketOrderTransaction(Transaction, type=TransactionType('MARKET_ORDER')):
class MarketOrderRejectTransaction(Transaction, type=TransactionType('MARKET_ORDER_REJECT')):
class StopLossOrderTransaction(Transaction, type=TransactionType('STOP_LOSS_ORDER')):
class TrailingStopLossOrderTransaction(Transaction, type=TransactionType('TRAILING_STOP_LOSS_ORDER')):
class LimitOrder(Order, type=OrderType('LIMIT')):
class MarketIfTouchedOrder(Order, type=OrderType('MARKET_IF_TOUCHED')):
class StopOrder(Order, type=OrderType('STOP')):
class OrderFillTransaction(Transaction, type=TransactionType('ORDER_FILL')):
class StopLossOrderRejectTransaction(Transaction, type=TransactionType('STOP_LOSS_ORDER_REJECT')):
class MarketIfTouchedOrderTransaction(Transaction, type=TransactionType('MARKET_IF_TOUCHED_ORDER')):
class LimitOrderTransaction(Transaction, type=TransactionType('LIMIT_ORDER')):
class TakeProfitOrderRejectTransaction(Transaction, type=TransactionType('TAKE_PROFIT_ORDER_REJECT')):
class TrailingStopLossOrderRejectTransaction(Transaction, type=TransactionType('TRAILING_STOP_LOSS_ORDER_REJECT')):
class StopOrderTransaction(Transaction, type=TransactionType('STOP_ORDER')):
class MarketIfTouchedOrderRejectTransaction(Transaction, type=TransactionType('MARKET_IF_TOUCHED_ORDER_REJECT')):
class LimitOrderRejectTransaction(Transaction, type=TransactionType('LIMIT_ORDER_REJECT')):
class StopOrderRejectTransaction(Transaction, type=TransactionType('STOP_ORDER_REJECT')):
class MarketOrder(Order, type=OrderType('MARKET')):
    def __init__(self, id: ClientID = sentinel, tag: ClientTag = sentinel, comment: ClientComment = sentinel):
    def __init__(self, price: PriceValue = sentinel, time_in_force: TimeInForce = sentinel,
                 gtd_time: DateTime = sentinel,
                 client_extensions: ClientExtensions = sentinel):
    def __init__(self, price: PriceValue = sentinel, time_in_force: TimeInForce = sentinel,
                 gtd_time: DateTime = sentinel,
                 client_extensions: ClientExtensions = sentinel):
    def __init__(self, distance: PriceValue = sentinel, time_in_force: TimeInForce = sentinel,
                 gtd_time: DateTime = sentinel,
                 client_extensions: ClientExtensions = sentinel):
    def __init__(self, instrument: InstrumentName, trade_id: TradeID = sentinel, price: PriceValue = sentinel,
                 type: OrderType = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = sentinel,
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = sentinel, client_extensions: ClientExtensions = sentinel,
                 distance: PriceValue = sentinel, units: DecimalNumber = sentinel,
                 price_bound: PriceValue = sentinel, position_fill: OrderPositionFill = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel):
    def __init__(self, long: DecimalNumber = sentinel, short: DecimalNumber = sentinel):
    def __init__(self, default: UnitsAvailableDetails = sentinel, reduce_first: UnitsAvailableDetails = sentinel,
                 reduce_only: UnitsAvailableDetails = sentinel, open_only: UnitsAvailableDetails = sentinel):
    def __init__(self, timestamp: DateTime = sentinel, bid_liquidity_used: DecimalNumber = sentinel,
                 ask_liquidity_used: DecimalNumber = sentinel):
    def __init__(self, steps: ArrayLiquidityRegenerationScheduleStep = sentinel):
    def __init__(self, o: PriceValue = sentinel, h: PriceValue = sentinel, l: PriceValue = sentinel,
                 c: PriceValue = sentinel):
    def __init__(self, order_id: OrderID = sentinel, client_order_id: ClientID = sentinel):
    def __init__(self, positive_units: DecimalNumber = sentinel, negative_units: DecimalNumber = sentinel):
    def __init__(self, reason: MarketOrderMarginCloseoutReason = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, commission: DecimalNumber = sentinel,
                 units_traded: DecimalNumber = sentinel,
                 minimum_commission: DecimalNumber = sentinel):
    def __init__(self, price: PriceValue = sentinel, long_count_percent: DecimalNumber = sentinel,
                 short_count_percent: DecimalNumber = sentinel):
    def __init__(self, price: PriceValue = sentinel, long_count_percent: DecimalNumber = sentinel,
                 short_count_percent: DecimalNumber = sentinel):
    def __init__(self, id: OrderID = sentinel, trailing_stop_value: PriceValue = sentinel,
                 trigger_distance: PriceValue = sentinel,
                 is_trigger_distance_exact: bool = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, net_unrealized_pl: AccountUnits = sentinel,
                 long_unrealized_pl: AccountUnits = sentinel, short_unrealized_pl: AccountUnits = sentinel,
                 margin_used: AccountUnits = sentinel):
    def __init__(self, units: DecimalNumber = sentinel, average_price: PriceValue = sentinel,
                 trade_ids: ArrayTradeID = sentinel,
                 pl: AccountUnits = sentinel, unrealized_pl: AccountUnits = sentinel,
                 resettable_pl: AccountUnits = sentinel,
                 financing: DecimalNumber = sentinel,
                 guaranteed_execution_fees: AccountUnits = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, pl: AccountUnits = sentinel,
                 unrealized_pl: AccountUnits = sentinel,
                 resettable_pl: AccountUnits = sentinel, commission: AccountUnits = sentinel,
                 long: PositionSide = sentinel,
                 short: PositionSide = sentinel, financing: DecimalNumber = sentinel,
                 margin_used: AccountUnits = sentinel,
                 guaranteed_execution_fees: AccountUnits = sentinel):
    def __init__(self, price: PriceValue = sentinel, liquidity: int = sentinel):
    def __init__(self, bids: ArrayPriceBucket = sentinel, asks: ArrayPriceBucket = sentinel,
                 closeout_bid: PriceValue = sentinel, closeout_ask: PriceValue = sentinel,
                 timestamp: DateTime = sentinel):
    def __init__(self, type: str = sentinel, time: DateTime = sentinel):
    def __init__(self, id: TradeID = sentinel, unrealized_pl: AccountUnits = sentinel,
                 margin_used: AccountUnits = sentinel):
    def __init__(self, trade_id: TradeID = sentinel, client_trade_id: TradeID = sentinel,
                 source_transaction_id: TransactionID = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, units: str = sentinel):
    def __init__(self, trade_id: TradeID = sentinel, client_trade_id: str = sentinel, units: str = sentinel):
    def __init__(self, trade_id: TradeID = sentinel, financing: AccountUnits = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, financing: AccountUnits = sentinel,
                 open_trade_financings: ArrayOpenTradeFinancing = sentinel):
    def __init__(self, price: DecimalNumber = sentinel, trade_id: TradeID = sentinel, units: DecimalNumber = sentinel,
                 client_extensions: ClientExtensions = sentinel,
                 guaranteed_execution_fee: AccountUnits = sentinel,
                 half_spread_cost: AccountUnits = sentinel,
                 initial_margin_required: AccountUnits = sentinel):
    def __init__(self, units: DecimalNumber = sentinel, price: PriceValue = sentinel):
    def __init__(self, username: str = sentinel, user_id: str = sentinel, country: str = sentinel,
                 email_address: str = sentinel):
    def __init__(self, id: AccountID = sentinel, mt4_account_id: int = sentinel, tags: ArrayStr = sentinel):
    def __init__(self, time: DateTime = sentinel, bid: CandlestickData = sentinel, ask: CandlestickData = sentinel,
                 mid: CandlestickData = sentinel, volume: int = sentinel, complete: bool = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, time: DateTime = sentinel, unix_time: DateTime = sentinel,
                 price: PriceValue = sentinel, bucket_width: PriceValue = sentinel,
                 buckets: ArrayOrderBookBucket = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, time: DateTime = sentinel, unix_time: DateTime = sentinel,
                 price: PriceValue = sentinel,
                 bucket_width: PriceValue = sentinel, buckets: ArrayPositionBookBucket = sentinel):
    def __init__(self, id: OrderID = sentinel, create_time: DateTime = sentinel, state: OrderState = sentinel,
                 client_extensions: ClientExtensions = sentinel, trade_id: TradeID = sentinel,
                 price: PriceValue = sentinel,
                 type: OrderType = sentinel, client_trade_id: ClientID = sentinel,
                 time_in_force: TimeInForce = sentinel,
                 gtd_time: DateTime = sentinel, trigger_condition: OrderTriggerCondition = sentinel,
                 filling_transaction_id: TransactionID = sentinel, filled_time: DateTime = sentinel,
                 trade_opened_id: TradeID = sentinel, trade_reduced_id: TradeID = sentinel,
                 trade_closed_ids: ArrayTradeID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 cancelled_time: DateTime = sentinel, replaces_order_id: OrderID = sentinel,
                 replaced_by_order_id: OrderID = sentinel, distance: PriceValue = sentinel,
                 trailing_stop_value: PriceValue = sentinel, instrument: InstrumentName = sentinel,
                 units: DecimalNumber = sentinel,
                 partial_fill: str = sentinel, position_fill: OrderPositionFill = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, price_bound: PriceValue = sentinel,
                 initial_market_price: PriceValue = sentinel, trade_close: MarketOrderTradeClose = sentinel,
                 long_position_closeout: MarketOrderPositionCloseout = sentinel,
                 short_position_closeout: MarketOrderPositionCloseout = sentinel,
                 margin_closeout: MarketOrderMarginCloseout = sentinel,
                 delayed_trade_close: MarketOrderDelayedTradeClose = sentinel,
                 trigger_distance: PriceValue = sentinel, is_trigger_distance_exact: bool = sentinel,
                 guaranteed: bool = sentinel
                 ):
    def __init__(self, trade_id: TradeID = sentinel, units: DecimalNumber = sentinel,
                 realized_pl: AccountUnits = sentinel,
                 financing: AccountUnits = sentinel, price: DecimalNumber = sentinel,
                 guaranteed_execution_fee: AccountUnits = sentinel,
                 half_spread_cost: AccountUnits = sentinel,
                 client_trade_id: ClientID = sentinel):
    def __init__(self, type: str = sentinel, last_transaction_id: TransactionID = sentinel, time: DateTime = sentinel):
    def __init__(self, user_id: str = sentinel, country: str = sentinel, fifo: str = sentinel):
    def __init__(self, id: TradeID = sentinel, instrument: InstrumentName = sentinel, price: PriceValue = sentinel,
                 open_time: DateTime = sentinel, state: TradeState = sentinel, initial_units: DecimalNumber = sentinel,
                 initial_margin_required: AccountUnits = sentinel,
                 current_units: DecimalNumber = sentinel, realized_pl: AccountUnits = sentinel,
                 unrealized_pl: AccountUnits = sentinel,
                 average_close_price: PriceValue = sentinel, closing_transaction_ids: ArrayTransactionID = sentinel,
                 financing: AccountUnits = sentinel, close_time: DateTime = sentinel,
                 client_extensions: ClientExtensions = sentinel, take_profit_order_id: OrderID = sentinel,
                 stop_loss_order_id: OrderID = sentinel, trailing_stop_loss_order_id: OrderID = sentinel,
                 margin_used: AccountUnits = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 type: TransactionType = sentinel, extension_number: int = sentinel, division_id: int = sentinel,
                 site_id: int = sentinel, account_user_id: int = sentinel, account_number: int = sentinel,
                 home_currency: Currency = sentinel, alias: str = sentinel, margin_rate: DecimalNumber = sentinel,
                 reason: Reason = sentinel, trade_ids: TradeID = sentinel, order_id: OrderID = sentinel,
                 client_order_id: ClientID = sentinel, replaced_by_order_id: OrderID = sentinel,
                 closed_trade_id: OrderID = sentinel, trade_close_transaction_id: TransactionID = sentinel,
                 client_extensions_modify: ClientExtensions = sentinel,
                 trade_client_extensions_modify: ClientExtensions = sentinel, financing: AccountUnits = sentinel,
                 account_balance: AccountUnits = sentinel, account_financing_mode: AccountFinancingMode = sentinel,
                 position_financings: ArrayPositionFinancing = sentinel, trade_id: TradeID = sentinel,
                 client_trade_id: ClientID = sentinel, price: PriceValue = sentinel,
                 time_in_force: TimeInForce = sentinel,
                 gtd_time: DateTime = sentinel, trigger_condition: OrderTriggerCondition = sentinel,
                 client_extensions: ClientExtensions = sentinel, order_fill_transaction_id: TransactionID = sentinel,
                 replaces_order_id: OrderID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 reject_reason: TransactionRejectReason = sentinel, amount: AccountUnits = sentinel,
                 funding_reason: FundingReason = sentinel, comment: str = sentinel,
                 instrument: InstrumentName = sentinel,
                 units: DecimalNumber = sentinel, price_bound: PriceValue = sentinel,
                 position_fill: OrderPositionFill = sentinel,
                 trade_close: MarketOrderTradeClose = sentinel,
                 long_position_closeout: MarketOrderPositionCloseout = sentinel,
                 short_position_closeout: MarketOrderPositionCloseout = sentinel,
                 margin_closeout: MarketOrderMarginCloseout = sentinel,
                 delayed_trade_close: MarketOrderDelayedTradeClose = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, distance: PriceValue = sentinel,
                 full_price: ClientPrice = sentinel, pl: AccountUnits = sentinel, commission: AccountUnits = sentinel,
                 trade_opened: TradeOpen = sentinel, trades_closed: ArrayTradeReduce = sentinel,
                 trade_reduced: TradeReduce = sentinel, intended_replaces_order_id: OrderID = sentinel,
                 # TODO update when OANDA ADVISES correct type. This is currently a guess.
                 gain_quote_home_conversion_factor: DecimalNumber = sentinel,
                 loss_quote_home_conversion_factor: DecimalNumber = sentinel,
                 guaranteed_execution_fee: AccountUnits = sentinel,
                 half_spread_cost: AccountUnits = sentinel,
                 partial_fill: str = sentinel,
                 guaranteed: bool = sentinel,
                 requested_units: AccountUnits = sentinel,
                 full_vwap: DecimalNumber = sentinel):
    def __init__(self, orders_created: ArrayOrder = sentinel, orders_cancelled: ArrayOrder = sentinel,
                 orders_filled: ArrayOrder = sentinel, orders_triggered: ArrayOrder = sentinel,
                 trades_opened: ArrayTradeSummary = sentinel, trades_reduced: ArrayTradeSummary = sentinel,
                 trades_closed: ArrayTradeSummary = sentinel, positions: ArrayPosition = sentinel,
                 transactions: ArrayTransaction = sentinel):
    def __init__(self, volume: DecimalNumber = sentinel, price_range: DecimalNumber = sentinel):
    def __init__(self, name: InstrumentName = sentinel, type: InstrumentType = sentinel, display_name: str = sentinel,
                 pip_location: int = sentinel, display_precision: int = sentinel, trade_units_precision: int = sentinel,
                 minimum_trade_size: DecimalNumber = sentinel, maximum_trailing_stop_distance: DecimalNumber = sentinel,
                 minimum_trailing_stop_distance: DecimalNumber = sentinel,
                 maximum_position_size: DecimalNumber = sentinel,
                 maximum_order_units: DecimalNumber = sentinel, margin_rate: DecimalNumber = sentinel,
                 commission: InstrumentCommission = sentinel,
                 guaranteed_stop_loss_order_level_restriction: GuaranteedStopLossOrderLevelRestriction = sentinel,
                 guaranteed_stop_loss_order_mode: GuaranteedStopLossOrderMode = sentinel,
                 tags: ArrayDict = sentinel, financing: object = sentinel):
    def __init__(self, unrealized_pl: AccountUnits = sentinel, nav: AccountUnits = sentinel,
                 margin_used: AccountUnits = sentinel,
                 margin_available: AccountUnits = sentinel, position_value: AccountUnits = sentinel,
                 margin_closeout_unrealized_pl: AccountUnits = sentinel, margin_closeout_nav: AccountUnits = sentinel,
                 margin_closeout_margin_used: AccountUnits = sentinel,
                 margin_closeout_percent: DecimalNumber = sentinel,
                 margin_closeout_position_value: DecimalNumber = sentinel, withdrawal_limit: AccountUnits = sentinel,
                 margin_call_margin_used: AccountUnits = sentinel, margin_call_percent: DecimalNumber = sentinel,
                 orders: ArrayDynamicOrderState = sentinel, trades: ArrayCalculatedTradeState = sentinel,
                 positions: ArrayCalculatedPositionState = sentinel,
                 balance: AccountUnits = sentinel,
                 # TODO check definition against OANDA docs
                 pl: AccountUnits = sentinel,
                 resettable_pl: AccountUnits = sentinel,
                 commission: AccountUnits = sentinel,
                 guaranteed_execution_fees: AccountUnits = sentinel
                 ):
    def __init__(self, type: str = sentinel, instrument: InstrumentName = sentinel, time: DateTime = sentinel,
                 # TODO: remove status when OANDA removes attribute
                 status: PriceStatus = sentinel, tradeable: bool = sentinel, bids: ArrayPriceBucket = sentinel,
                 asks: ArrayPriceBucket = sentinel, closeout_bid: PriceValue = sentinel,
                 closeout_ask: PriceValue = sentinel,
                 # TODO: remove quote_home_conversion_factors when OANDA removes attribute
                 quote_home_conversion_factors: QuoteHomeConversionFactors = sentinel,
                 # TODO: remove units_available when OANDA removes attribute
                 units_available: UnitsAvailable = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 extension_number: int = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel):
    def __init__(self, instrument: InstrumentName, trade_id: TradeID, price: PriceValue,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', client_extensions: ClientExtensions = sentinel):
    def __init__(self, instrument: InstrumentName, trade_id: TradeID, price: PriceValue,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', client_extensions: ClientExtensions = sentinel):
    def __init__(self, instrument: InstrumentName, trade_id: TradeID, distance: PriceValue,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', client_extensions: ClientExtensions = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 division_id: int = sentinel, site_id: int = sentinel,
                 account_user_id: int = sentinel, account_number: int = sentinel, home_currency: Currency = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 alias: str = sentinel, margin_rate: DecimalNumber = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 reason: MarketOrderReason = sentinel,
                 trade_ids: TradeID = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 order_id: OrderID = sentinel, client_order_id: ClientID = sentinel,
                 reason: OrderCancelReason = sentinel, replaced_by_order_id: OrderID = sentinel,
                 closed_trade_id: OrderID = sentinel, trade_close_transaction_id: TransactionID = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 order_id: OrderID = sentinel,
                 client_order_id: ClientID = sentinel, client_extensions_modify: ClientExtensions = sentinel,
                 trade_client_extensions_modify: ClientExtensions = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 financing: AccountUnits = sentinel,
                 account_balance: AccountUnits = sentinel, account_financing_mode: AccountFinancingMode = sentinel,
                 position_financings: ArrayPositionFinancing = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 trade_id: TradeID = sentinel,
                 client_trade_id: ClientID = sentinel, trade_client_extensions_modify: ClientExtensions = sentinel):
    def __init__(self, id: AccountID = sentinel, alias: str = sentinel, currency: Currency = sentinel,
                 balance: AccountUnits = sentinel,
                 created_by_user_id: int = sentinel, created_time: DateTime = sentinel, pl: AccountUnits = sentinel,
                 resettable_pl: AccountUnits = sentinel, resettabled_pl_time: DateTime = sentinel,
                 commission: AccountUnits = sentinel, margin_rate: DecimalNumber = sentinel,
                 margin_call_enter_time: DateTime = sentinel, margin_call_extension_count: int = sentinel,
                 last_margin_call_extension_time: DateTime = sentinel, open_trade_count: int = sentinel,
                 open_position_count: int = sentinel, pending_order_count: int = sentinel,
                 hedging_enabled: bool = sentinel,
                 unrealized_pl: AccountUnits = sentinel, nav: AccountUnits = sentinel,
                 margin_used: AccountUnits = sentinel,
                 margin_available: AccountUnits = sentinel, position_value: AccountUnits = sentinel,
                 margin_closeout_unrealized_pl: AccountUnits = sentinel, margin_closeout_nav: AccountUnits = sentinel,
                 margin_closeout_margin_used: AccountUnits = sentinel,
                 margin_closeout_percent: DecimalNumber = sentinel,
                 margin_closeout_position_value: DecimalNumber = sentinel, withdrawal_limit: AccountUnits = sentinel,
                 margin_call_margin_used: AccountUnits = sentinel, margin_call_percent: DecimalNumber = sentinel,
                 last_transaction_id: TransactionID = sentinel, trades: ArrayTradeSummary = sentinel,
                 positions: ArrayPosition = sentinel, orders: ArrayOrder = sentinel,
                 financing: DecimalNumber = sentinel,
                 guaranteed_stop_loss_order_mode: GuaranteedStopLossOrderMode = sentinel,
                 resettable_pl_time: DateTime = sentinel,
                 guaranteed_execution_fees: AccountUnits = sentinel,
                 dividend: DecimalNumber = sentinel,
                 ):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber,
                 time_in_force: TimeInForce = 'FOK', price_bound: PriceValue = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', client_extensions: ClientExtensions = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel):
    def __init__(self, trade_id: TradeID, price: PriceValue, id: TransactionID = sentinel, time: DateTime = sentinel,
                 user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', reason: TakeProfitOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, order_fill_transaction_id: TransactionID = sentinel,
                 replaces_order_id: OrderID = sentinel, cancelling_transaction_id: TransactionID = sentinel):
    def __init__(self, trade_id: TradeID, price: PriceValue, id: OrderID = sentinel, create_time: DateTime = sentinel,
                 state: OrderState = sentinel, client_extensions: ClientExtensions = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', filling_transaction_id: TransactionID = sentinel,
                 filled_time: DateTime = sentinel, trade_opened_id: TradeID = sentinel,
                 trade_reduced_id: TradeID = sentinel,
                 trade_closed_ids: ArrayTradeID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 cancelled_time: DateTime = sentinel, replaces_order_id: OrderID = sentinel,
                 replaced_by_order_id: OrderID = sentinel):
    def __init__(self, trade_id: TradeID, price: PriceValue, id: OrderID = sentinel, create_time: DateTime = sentinel,
                 state: OrderState = sentinel, client_extensions: ClientExtensions = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', guaranteed: bool = sentinel,
                 filling_transaction_id: TransactionID = sentinel,
                 filled_time: DateTime = sentinel, trade_opened_id: TradeID = sentinel,
                 trade_reduced_id: TradeID = sentinel,
                 trade_closed_ids: ArrayTradeID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 cancelled_time: DateTime = sentinel, replaces_order_id: OrderID = sentinel,
                 replaced_by_order_id: OrderID = sentinel):
    def __init__(self, trade_id: TradeID, distance: PriceValue, id: OrderID = sentinel,
                 create_time: DateTime = sentinel,
                 state: OrderState = sentinel, client_extensions: ClientExtensions = sentinel,
                 client_trade_id: ClientID = sentinel,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', trailing_stop_value: PriceValue = sentinel,
                 filling_transaction_id: TransactionID = sentinel, filled_time: DateTime = sentinel,
                 trade_opened_id: TradeID = sentinel, trade_reduced_id: TradeID = sentinel,
                 trade_closed_ids: ArrayTradeID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 cancelled_time: DateTime = sentinel, replaces_order_id: OrderID = sentinel,
                 replaced_by_order_id: OrderID = sentinel):
    def __init__(self, id: TradeID = sentinel, instrument: InstrumentName = sentinel, price: PriceValue = sentinel,
                 open_time: DateTime = sentinel, state: TradeState = sentinel, initial_units: DecimalNumber = sentinel,
                 initial_margin_required: AccountUnits = sentinel,
                 current_units: DecimalNumber = sentinel, realized_pl: AccountUnits = sentinel,
                 unrealized_pl: AccountUnits = sentinel, average_close_price: PriceValue = sentinel,
                 closing_transaction_ids: ArrayTransactionID = sentinel, financing: AccountUnits = sentinel,
                 close_time: DateTime = sentinel, client_extensions: ClientExtensions = sentinel,
                 take_profit_order: TakeProfitOrder = sentinel, stop_loss_order: StopLossOrder = sentinel,
                 trailing_stop_loss_order: TrailingStopLossOrder = sentinel,
                 margin_used: AccountUnits = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 alias: str = sentinel,
                 margin_rate: DecimalNumber = sentinel, reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 order_id: OrderID = sentinel,
                 client_order_id: ClientID = sentinel, reason: OrderCancelReason = sentinel,
                 reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 order_id: OrderID = sentinel,
                 client_order_id: ClientID = sentinel, client_extensions_modify: ClientExtensions = sentinel,
                 trade_client_extensions_modify: ClientExtensions = sentinel,
                 reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 trade_id: TradeID = sentinel,
                 client_trade_id: ClientID = sentinel, trade_client_extensions_modify: ClientExtensions = sentinel,
                 reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 amount: AccountUnits = sentinel,
                 funding_reason: FundingReason = sentinel, comment: str = sentinel,
                 account_balance: AccountUnits = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 amount: AccountUnits = sentinel,
                 funding_reason: FundingReason = sentinel, comment: str = sentinel,
                 reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 client_extensions: ClientExtensions = sentinel, take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue,
                 price_bound: PriceValue = sentinel,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 client_extensions: ClientExtensions = sentinel, take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue,
                 price_bound: PriceValue = sentinel, time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 client_extensions: ClientExtensions = sentinel, take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel):
    def __init__(self, id: AccountID = sentinel, alias: str = sentinel, currency: Currency = sentinel,
                 balance: AccountUnits = sentinel,
                 created_by_user_id: int = sentinel, created_time: DateTime = sentinel, pl: AccountUnits = sentinel,
                 resettable_pl: AccountUnits = sentinel, resettabled_pl_time: DateTime = sentinel,
                 commission: AccountUnits = sentinel, margin_rate: DecimalNumber = sentinel,
                 margin_call_enter_time: DateTime = sentinel, margin_call_extension_count: int = sentinel,
                 last_margin_call_extension_time: DateTime = sentinel, open_trade_count: int = sentinel,
                 open_position_count: int = sentinel, pending_order_count: int = sentinel,
                 hedging_enabled: bool = sentinel,
                 unrealized_pl: AccountUnits = sentinel, nav: AccountUnits = sentinel,
                 margin_used: AccountUnits = sentinel,
                 margin_available: AccountUnits = sentinel, position_value: AccountUnits = sentinel,
                 margin_closeout_unrealized_pl: AccountUnits = sentinel, margin_closeout_nav: AccountUnits = sentinel,
                 margin_closeout_margin_used: AccountUnits = sentinel,
                 margin_closeout_percent: DecimalNumber = sentinel,
                 margin_closeout_position_value: DecimalNumber = sentinel, withdrawal_limit: AccountUnits = sentinel,
                 margin_call_margin_used: AccountUnits = sentinel, margin_call_percent: DecimalNumber = sentinel,
                 last_transaction_id: TransactionID = sentinel, trades: ArrayTradeSummary = sentinel,
                 positions: ArrayPosition = sentinel, orders: ArrayOrder = sentinel,
                 financing: DecimalNumber = sentinel,
                 guaranteed_stop_loss_order_mode: GuaranteedStopLossOrderMode = sentinel,
                 resettable_pl_time: DateTime = sentinel,
                 dividend: DecimalNumber = sentinel,
                 dividend_adjustment: AccountUnits = sentinel,
                 guaranteed_execution_fees: AccountUnits = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, id: TransactionID = sentinel,
                 time: DateTime = sentinel,
                 user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel,
                 time_in_force: TimeInForce = 'FOK', price_bound: PriceValue = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trade_close: MarketOrderTradeClose = sentinel,
                 long_position_closeout: MarketOrderPositionCloseout = sentinel,
                 short_position_closeout: MarketOrderPositionCloseout = sentinel,
                 margin_closeout: MarketOrderMarginCloseout = sentinel,
                 delayed_trade_close: MarketOrderDelayedTradeClose = sentinel, reason: MarketOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, units: DecimalNumber = sentinel,
                 id: TransactionID = sentinel,
                 time: DateTime = sentinel,
                 user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel,
                 time_in_force: TimeInForce = 'FOK', price_bound: PriceValue = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trade_close: MarketOrderTradeClose = sentinel,
                 long_position_closeout: MarketOrderPositionCloseout = sentinel,
                 short_position_closeout: MarketOrderPositionCloseout = sentinel,
                 margin_closeout: MarketOrderMarginCloseout = sentinel,
                 delayed_trade_close: MarketOrderDelayedTradeClose = sentinel, reason: MarketOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel,
                 reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, trade_id: TradeID, price: PriceValue, id: TransactionID = sentinel, time: DateTime = sentinel,
                 user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', reason: StopLossOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, order_fill_transaction_id: TransactionID = sentinel,
                 replaces_order_id: OrderID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 guaranteed: bool = sentinel):
    def __init__(self, trade_id: TradeID, distance: PriceValue, id: TransactionID = sentinel, time: DateTime = sentinel,
                 user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', reason: TrailingStopLossOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, order_fill_transaction_id: TransactionID = sentinel,
                 replaces_order_id: OrderID = sentinel, cancelling_transaction_id: TransactionID = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue, id: OrderID = sentinel,
                 create_time: DateTime = sentinel, state: OrderState = sentinel,
                 client_extensions: ClientExtensions = sentinel,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, filling_transaction_id: TransactionID = sentinel,
                 filled_time: DateTime = sentinel, trade_opened_id: TradeID = sentinel,
                 trade_reduced_id: TradeID = sentinel,
                 trade_closed_ids: ArrayTradeID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 cancelled_time: DateTime = sentinel, replaces_order_id: OrderID = sentinel,
                 replaced_by_order_id: OrderID = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue, id: OrderID = sentinel,
                 create_time: DateTime = sentinel, state: OrderState = sentinel,
                 client_extensions: ClientExtensions = sentinel,
                 price_bound: PriceValue = sentinel,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 initial_market_price: PriceValue = sentinel, take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, filling_transaction_id: TransactionID = sentinel,
                 filled_time: DateTime = sentinel, trade_opened_id: TradeID = sentinel,
                 trade_reduced_id: TradeID = sentinel,
                 trade_closed_ids: ArrayTradeID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 cancelled_time: DateTime = sentinel, replaces_order_id: OrderID = sentinel,
                 replaced_by_order_id: OrderID = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue, id: OrderID = sentinel,
                 create_time: DateTime = sentinel, state: OrderState = sentinel,
                 client_extensions: ClientExtensions = sentinel,
                 price_bound: PriceValue = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel, position_fill: OrderPositionFill = 'DEFAULT',
                 trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, filling_transaction_id: TransactionID = sentinel,
                 filled_time: DateTime = sentinel, trade_opened_id: TradeID = sentinel,
                 trade_reduced_id: TradeID = sentinel,
                 trade_closed_ids: ArrayTradeID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 cancelled_time: DateTime = sentinel, replaces_order_id: OrderID = sentinel,
                 replaced_by_order_id: OrderID = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 order_id: OrderID = sentinel, client_order_id: ClientID = sentinel,
                 instrument: InstrumentName = sentinel, units: DecimalNumber = sentinel, price: PriceValue = sentinel,
                 full_price: ClientPrice = sentinel, reason: OrderFillReason = sentinel, pl: AccountUnits = sentinel,
                 financing: AccountUnits = sentinel, commission: AccountUnits = sentinel,
                 account_balance: AccountUnits = sentinel,
                 trade_opened: TradeOpen = sentinel, trades_closed: ArrayTradeReduce = sentinel,
                 trade_reduced: TradeReduce = sentinel,
                 gain_quote_home_conversion_factor: DecimalNumber = sentinel,
                 loss_quote_home_conversion_factor: DecimalNumber = sentinel,
                 guaranteed_execution_fee: AccountUnits = sentinel,
                 half_spread_cost: AccountUnits = sentinel,
                 requested_units: AccountUnits = sentinel,
                 full_vwap: DecimalNumber = sentinel):
    def __init__(self, trade_id: TradeID = sentinel, price: PriceValue = sentinel, id: TransactionID = sentinel,
                 time: DateTime = sentinel,
                 user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', reason: StopLossOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, order_fill_transaction_id: TransactionID = sentinel,
                 intended_replaces_order_id: OrderID = sentinel, reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue,
                 id: TransactionID = sentinel,
                 time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel,
                 batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 price_bound: PriceValue = sentinel,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 reason: MarketIfTouchedOrderReason = sentinel, client_extensions: ClientExtensions = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, replaces_order_id: OrderID = sentinel,
                 cancelling_transaction_id: TransactionID = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue,
                 id: TransactionID = sentinel,
                 time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel,
                 batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 reason: LimitOrderReason = sentinel, client_extensions: ClientExtensions = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, replaces_order_id: OrderID = sentinel,
                 cancelling_transaction_id: TransactionID = sentinel, partial_fill: OrderPositionFill = sentinel):
    def __init__(self, trade_id: TradeID = sentinel, price: PriceValue = sentinel, id: TransactionID = sentinel,
                 time: DateTime = sentinel,
                 user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', reason: TakeProfitOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, order_fill_transaction_id: TransactionID = sentinel,
                 intended_replaces_order_id: OrderID = sentinel, reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, trade_id: TradeID = sentinel, distance: PriceValue = sentinel, id: TransactionID = sentinel,
                 time: DateTime = sentinel,
                 user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', reason: TrailingStopLossOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, order_fill_transaction_id: TransactionID = sentinel,
                 intended_replaces_order_id: OrderID = sentinel, reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue,
                 id: TransactionID = sentinel,
                 time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel,
                 batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 partial_fill: str = sentinel,
                 price_bound: PriceValue = sentinel, time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 reason: StopOrderReason = sentinel, client_extensions: ClientExtensions = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, replaces_order_id: OrderID = sentinel,
                 cancelling_transaction_id: TransactionID = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, units: DecimalNumber = sentinel,
                 price: PriceValue = sentinel,
                 id: TransactionID = sentinel,
                 time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel,
                 batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 price_bound: PriceValue = sentinel,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 reason: MarketIfTouchedOrderReason = sentinel, client_extensions: ClientExtensions = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, intended_replaces_order_id: OrderID = sentinel,
                 reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, units: DecimalNumber = sentinel,
                 price: PriceValue = sentinel,
                 id: TransactionID = sentinel,
                 time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel,
                 batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel, position_fill: OrderPositionFill = 'DEFAULT',
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', reason: LimitOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, intended_replaces_order_id: OrderID = sentinel,
                 reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, units: DecimalNumber = sentinel,
                 price: PriceValue = sentinel,
                 id: TransactionID = sentinel,
                 time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel,
                 batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 price_bound: PriceValue = sentinel,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 reason: StopOrderReason = sentinel, client_extensions: ClientExtensions = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, intended_replaces_order_id: OrderID = sentinel,
                 reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, id: OrderID = sentinel,
                 create_time: DateTime = sentinel,
                 state: OrderState = sentinel, client_extensions: ClientExtensions = sentinel,
                 time_in_force: TimeInForce = 'FOK', price_bound: PriceValue = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trade_close: MarketOrderTradeClose = sentinel,
                 long_position_closeout: MarketOrderPositionCloseout = sentinel,
                 short_position_closeout: MarketOrderPositionCloseout = sentinel,
                 margin_closeout: MarketOrderMarginCloseout = sentinel,
                 delayed_trade_close: MarketOrderDelayedTradeClose = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, filling_transaction_id: TransactionID = sentinel,
                 filled_time: DateTime = sentinel, trade_opened_id: TradeID = sentinel,
                 trade_reduced_id: TradeID = sentinel,
                 trade_closed_ids: ArrayTradeID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 cancelled_time: DateTime = sentinel): class ArrayStr(Array, contains=str):
class ArrayTradeID(Array, contains=TradeID):
class ArrayTransactionFilter(Array, contains=TransactionFilter):
class ArrayTransactionID(Array, contains=TransactionID):
class ArrayDict(Array, contains=dict):
class ClientExtensions(Model):
class TakeProfitDetails(Model):
class StopLossDetails(Model):
class TrailingStopLossDetails(Model):
class OrderRequest(Model, jit=False):
class UnitsAvailableDetails(Model):
class UnitsAvailable(Model):
class LiquidityRegenerationScheduleStep(Model):
class ArrayLiquidityRegenerationScheduleStep(Array, contains=LiquidityRegenerationScheduleStep):
class LiquidityRegenerationSchedule(Model):
class CandlestickData(Model):
class OrderIdentifier(Model):
class QuoteHomeConversionFactors(Model):
class MarketOrderMarginCloseout(Model):
class InstrumentCommission(Model):
class OrderBookBucket(Model):
class ArrayOrderBookBucket(Array, contains=OrderBookBucket):
class PositionBookBucket(Model):
class ArrayPositionBookBucket(Array, contains=PositionBookBucket):
class DynamicOrderState(Model):
class ArrayDynamicOrderState(Array, contains=DynamicOrderState):
class CalculatedPositionState(Model):
class ArrayCalculatedPositionState(Array, contains=CalculatedPositionState, one_to_many=False):
class PositionSide(Model):
class Position(Model):
class ArrayPosition(Array, contains=Position, one_to_many=False):
class PriceBucket(Model):
class ArrayPriceBucket(Array, contains=PriceBucket):
class ClientPrice(Model):
class PricingHeartbeat(Model):
class CalculatedTradeState(Model):
class ArrayCalculatedTradeState(Array, contains=CalculatedTradeState):
class MarketOrderDelayedTradeClose(Model):
class MarketOrderPositionCloseout(Model):
class MarketOrderTradeClose(Model):
class OpenTradeFinancing(Model):
class ArrayOpenTradeFinancing(Array, contains=OpenTradeFinancing):
class PositionFinancing(Model):
class ArrayPositionFinancing(Array, contains=PositionFinancing):
class TradeOpen(Model):
class VWAPReceipt(Model):
class UserInfo(Model):
class AccountProperties(Model):
class ArrayAccountProperties(Array, contains=AccountProperties):
class Candlestick(Model):
class ArrayCandlestick(Array, contains=Candlestick):
class OrderBook(Model):
class PositionBook(Model):
class Order(Model):
class ArrayOrder(Array, contains=Order):
class TradeReduce(Model):
class ArrayTradeReduce(Array, contains=TradeReduce):
class TransactionHeartbeat(Model):
class UserInfoExternal(Model):
class TradeSummary(Model):
class ArrayTradeSummary(Array, contains=TradeSummary):
class Transaction(Model):
class ArrayTransaction(Array, contains=Transaction):
class AccountChanges(Model):
class GuaranteedStopLossOrderLevelRestriction(Model):
class Instrument(Model):
class ArrayInstrument(Array, contains=Instrument, one_to_many=False):
class AccountChangesState(Model):
class Price(Model):
class ArrayPrice(Array, contains=Price):
class CloseTransaction(Transaction, type=TransactionType('CLOSE')):
class MarginCallEnterTransaction(Transaction, type=TransactionType('MARGIN_CALL_ENTER')):
class MarginCallExitTransaction(Transaction, type=TransactionType('MARGIN_CALL_EXIT')):
class MarginCallExtendTransaction(Transaction, type=TransactionType('MARGIN_CALL_EXTEND')):
class ReopenTransaction(Transaction, type=TransactionType('REOPEN')):
class ResetResettablePLTransaction(Transaction, type=TransactionType('RESET_RESETTABLE_PL')):
class StopLossOrderRequest(OrderRequest, type=OrderType('STOP_LOSS')):
class TakeProfitOrderRequest(OrderRequest, type=OrderType('TAKE_PROFIT')):
class TrailingStopLossOrderRequest(OrderRequest, type=OrderType('TRAILING_STOP_LOSS')):
class CreateTransaction(Transaction, type=TransactionType('CREATE')):
class ClientConfigureTransaction(Transaction, type=TransactionType('CLIENT_CONFIGURE')):
class DelayedTradeClosureTransaction(Transaction, type=TransactionType('DELAYED_TRADE_CLOSURE')):
class OrderCancelTransaction(Transaction, type=TransactionType('ORDER_CANCEL')):
class OrderClientExtensionsModifyTransaction(Transaction, type=TransactionType('ORDER_CLIENT_EXTENSIONS_MODIFY')):
class DailyFinancingTransaction(Transaction, type=TransactionType('DAILY_FINANCING')):
class TradeClientExtensionsModifyTransaction(Transaction, type=TransactionType('TRADE_CLIENT_EXTENSIONS_MODIFY')):
class AccountSummary(Model):
class MarketOrderRequest(OrderRequest, type=OrderType('MARKET')):
class TakeProfitOrderTransaction(Transaction, type=TransactionType('TAKE_PROFIT_ORDER')):
class TakeProfitOrder(Order, type=OrderType('TAKE_PROFIT')):
class StopLossOrder(Order, type=OrderType('STOP_LOSS')):
class TrailingStopLossOrder(Order, type=OrderType('TRAILING_STOP_LOSS')):
class Trade(Model):
class ArrayTrade(Array, contains=Trade):
class ClientConfigureRejectTransaction(Transaction, type=TransactionType('CLIENT_CONFIGURE_REJECT')):
class OrderCancelRejectTransaction(Transaction, type=TransactionType('ORDER_CANCEL_REJECT')):
class OrderClientExtensionsModifyRejectTransaction(Transaction,
                                                   type=TransactionType('ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT')):
class TradeClientExtensionsModifyRejectTransaction(Transaction,
                                                   type=TransactionType('TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT')):
class TransferFundsTransaction(Transaction, type=TransactionType('TRANSFER_FUNDS')):
class TransferFundsRejectTransaction(Transaction, type=TransactionType('TRANSFER_FUNDS_REJECT')):
class LimitOrderRequest(OrderRequest, type=OrderType('LIMIT')):
class MarketIfTouchedOrderRequest(OrderRequest, type=OrderType('MARKET_IF_TOUCHED')):
class StopOrderRequest(OrderRequest, type=OrderType('STOP')):
class Account(AccountSummary):
class MarketOrderTransaction(Transaction, type=TransactionType('MARKET_ORDER')):
class MarketOrderRejectTransaction(Transaction, type=TransactionType('MARKET_ORDER_REJECT')):
class StopLossOrderTransaction(Transaction, type=TransactionType('STOP_LOSS_ORDER')):
class TrailingStopLossOrderTransaction(Transaction, type=TransactionType('TRAILING_STOP_LOSS_ORDER')):
class LimitOrder(Order, type=OrderType('LIMIT')):
class MarketIfTouchedOrder(Order, type=OrderType('MARKET_IF_TOUCHED')):
class StopOrder(Order, type=OrderType('STOP')):
class OrderFillTransaction(Transaction, type=TransactionType('ORDER_FILL')):
class StopLossOrderRejectTransaction(Transaction, type=TransactionType('STOP_LOSS_ORDER_REJECT')):
class MarketIfTouchedOrderTransaction(Transaction, type=TransactionType('MARKET_IF_TOUCHED_ORDER')):
class LimitOrderTransaction(Transaction, type=TransactionType('LIMIT_ORDER')):
class TakeProfitOrderRejectTransaction(Transaction, type=TransactionType('TAKE_PROFIT_ORDER_REJECT')):
class TrailingStopLossOrderRejectTransaction(Transaction, type=TransactionType('TRAILING_STOP_LOSS_ORDER_REJECT')):
class StopOrderTransaction(Transaction, type=TransactionType('STOP_ORDER')):
class MarketIfTouchedOrderRejectTransaction(Transaction, type=TransactionType('MARKET_IF_TOUCHED_ORDER_REJECT')):
class LimitOrderRejectTransaction(Transaction, type=TransactionType('LIMIT_ORDER_REJECT')):
class StopOrderRejectTransaction(Transaction, type=TransactionType('STOP_ORDER_REJECT')):
class MarketOrder(Order, type=OrderType('MARKET')):
    def __init__(self, id: ClientID = sentinel, tag: ClientTag = sentinel, comment: ClientComment = sentinel):
    def __init__(self, price: PriceValue = sentinel, time_in_force: TimeInForce = sentinel,
                 gtd_time: DateTime = sentinel,
                 client_extensions: ClientExtensions = sentinel):
    def __init__(self, price: PriceValue = sentinel, time_in_force: TimeInForce = sentinel,
                 gtd_time: DateTime = sentinel,
                 client_extensions: ClientExtensions = sentinel):
    def __init__(self, distance: PriceValue = sentinel, time_in_force: TimeInForce = sentinel,
                 gtd_time: DateTime = sentinel,
                 client_extensions: ClientExtensions = sentinel):
    def __init__(self, instrument: InstrumentName, trade_id: TradeID = sentinel, price: PriceValue = sentinel,
                 type: OrderType = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = sentinel,
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = sentinel, client_extensions: ClientExtensions = sentinel,
                 distance: PriceValue = sentinel, units: DecimalNumber = sentinel,
                 price_bound: PriceValue = sentinel, position_fill: OrderPositionFill = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel):
    def __init__(self, long: DecimalNumber = sentinel, short: DecimalNumber = sentinel):
    def __init__(self, default: UnitsAvailableDetails = sentinel, reduce_first: UnitsAvailableDetails = sentinel,
                 reduce_only: UnitsAvailableDetails = sentinel, open_only: UnitsAvailableDetails = sentinel):
    def __init__(self, timestamp: DateTime = sentinel, bid_liquidity_used: DecimalNumber = sentinel,
                 ask_liquidity_used: DecimalNumber = sentinel):
    def __init__(self, steps: ArrayLiquidityRegenerationScheduleStep = sentinel):
    def __init__(self, o: PriceValue = sentinel, h: PriceValue = sentinel, l: PriceValue = sentinel,
                 c: PriceValue = sentinel):
    def __init__(self, order_id: OrderID = sentinel, client_order_id: ClientID = sentinel):
    def __init__(self, positive_units: DecimalNumber = sentinel, negative_units: DecimalNumber = sentinel):
    def __init__(self, reason: MarketOrderMarginCloseoutReason = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, commission: DecimalNumber = sentinel,
                 units_traded: DecimalNumber = sentinel,
                 minimum_commission: DecimalNumber = sentinel):
    def __init__(self, price: PriceValue = sentinel, long_count_percent: DecimalNumber = sentinel,
                 short_count_percent: DecimalNumber = sentinel):
    def __init__(self, price: PriceValue = sentinel, long_count_percent: DecimalNumber = sentinel,
                 short_count_percent: DecimalNumber = sentinel):
    def __init__(self, id: OrderID = sentinel, trailing_stop_value: PriceValue = sentinel,
                 trigger_distance: PriceValue = sentinel,
                 is_trigger_distance_exact: bool = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, net_unrealized_pl: AccountUnits = sentinel,
                 long_unrealized_pl: AccountUnits = sentinel, short_unrealized_pl: AccountUnits = sentinel,
                 margin_used: AccountUnits = sentinel):
    def __init__(self, units: DecimalNumber = sentinel, average_price: PriceValue = sentinel,
                 trade_ids: ArrayTradeID = sentinel,
                 pl: AccountUnits = sentinel, unrealized_pl: AccountUnits = sentinel,
                 resettable_pl: AccountUnits = sentinel,
                 financing: DecimalNumber = sentinel,
                 guaranteed_execution_fees: AccountUnits = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, pl: AccountUnits = sentinel,
                 unrealized_pl: AccountUnits = sentinel,
                 resettable_pl: AccountUnits = sentinel, commission: AccountUnits = sentinel,
                 long: PositionSide = sentinel,
                 short: PositionSide = sentinel, financing: DecimalNumber = sentinel,
                 margin_used: AccountUnits = sentinel,
                 guaranteed_execution_fees: AccountUnits = sentinel):
    def __init__(self, price: PriceValue = sentinel, liquidity: int = sentinel):
    def __init__(self, bids: ArrayPriceBucket = sentinel, asks: ArrayPriceBucket = sentinel,
                 closeout_bid: PriceValue = sentinel, closeout_ask: PriceValue = sentinel,
                 timestamp: DateTime = sentinel):
    def __init__(self, type: str = sentinel, time: DateTime = sentinel):
    def __init__(self, id: TradeID = sentinel, unrealized_pl: AccountUnits = sentinel,
                 margin_used: AccountUnits = sentinel):
    def __init__(self, trade_id: TradeID = sentinel, client_trade_id: TradeID = sentinel,
                 source_transaction_id: TransactionID = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, units: str = sentinel):
    def __init__(self, trade_id: TradeID = sentinel, client_trade_id: str = sentinel, units: str = sentinel):
    def __init__(self, trade_id: TradeID = sentinel, financing: AccountUnits = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, financing: AccountUnits = sentinel,
                 open_trade_financings: ArrayOpenTradeFinancing = sentinel):
    def __init__(self, price: DecimalNumber = sentinel, trade_id: TradeID = sentinel, units: DecimalNumber = sentinel,
                 client_extensions: ClientExtensions = sentinel,
                 guaranteed_execution_fee: AccountUnits = sentinel,
                 half_spread_cost: AccountUnits = sentinel,
                 initial_margin_required: AccountUnits = sentinel):
    def __init__(self, units: DecimalNumber = sentinel, price: PriceValue = sentinel):
    def __init__(self, username: str = sentinel, user_id: str = sentinel, country: str = sentinel,
                 email_address: str = sentinel):
    def __init__(self, id: AccountID = sentinel, mt4_account_id: int = sentinel, tags: ArrayStr = sentinel):
    def __init__(self, time: DateTime = sentinel, bid: CandlestickData = sentinel, ask: CandlestickData = sentinel,
                 mid: CandlestickData = sentinel, volume: int = sentinel, complete: bool = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, time: DateTime = sentinel, unix_time: DateTime = sentinel,
                 price: PriceValue = sentinel, bucket_width: PriceValue = sentinel,
                 buckets: ArrayOrderBookBucket = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, time: DateTime = sentinel, unix_time: DateTime = sentinel,
                 price: PriceValue = sentinel,
                 bucket_width: PriceValue = sentinel, buckets: ArrayPositionBookBucket = sentinel):
    def __init__(self, id: OrderID = sentinel, create_time: DateTime = sentinel, state: OrderState = sentinel,
                 client_extensions: ClientExtensions = sentinel, trade_id: TradeID = sentinel,
                 price: PriceValue = sentinel,
                 type: OrderType = sentinel, client_trade_id: ClientID = sentinel,
                 time_in_force: TimeInForce = sentinel,
                 gtd_time: DateTime = sentinel, trigger_condition: OrderTriggerCondition = sentinel,
                 filling_transaction_id: TransactionID = sentinel, filled_time: DateTime = sentinel,
                 trade_opened_id: TradeID = sentinel, trade_reduced_id: TradeID = sentinel,
                 trade_closed_ids: ArrayTradeID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 cancelled_time: DateTime = sentinel, replaces_order_id: OrderID = sentinel,
                 replaced_by_order_id: OrderID = sentinel, distance: PriceValue = sentinel,
                 trailing_stop_value: PriceValue = sentinel, instrument: InstrumentName = sentinel,
                 units: DecimalNumber = sentinel,
                 partial_fill: str = sentinel, position_fill: OrderPositionFill = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, price_bound: PriceValue = sentinel,
                 initial_market_price: PriceValue = sentinel, trade_close: MarketOrderTradeClose = sentinel,
                 long_position_closeout: MarketOrderPositionCloseout = sentinel,
                 short_position_closeout: MarketOrderPositionCloseout = sentinel,
                 margin_closeout: MarketOrderMarginCloseout = sentinel,
                 delayed_trade_close: MarketOrderDelayedTradeClose = sentinel,
                 trigger_distance: PriceValue = sentinel, is_trigger_distance_exact: bool = sentinel,
                 guaranteed: bool = sentinel
                 ):
    def __init__(self, trade_id: TradeID = sentinel, units: DecimalNumber = sentinel,
                 realized_pl: AccountUnits = sentinel,
                 financing: AccountUnits = sentinel, price: DecimalNumber = sentinel,
                 guaranteed_execution_fee: AccountUnits = sentinel,
                 half_spread_cost: AccountUnits = sentinel,
                 client_trade_id: ClientID = sentinel):
    def __init__(self, type: str = sentinel, last_transaction_id: TransactionID = sentinel, time: DateTime = sentinel):
    def __init__(self, user_id: str = sentinel, country: str = sentinel, fifo: str = sentinel):
    def __init__(self, id: TradeID = sentinel, instrument: InstrumentName = sentinel, price: PriceValue = sentinel,
                 open_time: DateTime = sentinel, state: TradeState = sentinel, initial_units: DecimalNumber = sentinel,
                 initial_margin_required: AccountUnits = sentinel,
                 current_units: DecimalNumber = sentinel, realized_pl: AccountUnits = sentinel,
                 unrealized_pl: AccountUnits = sentinel,
                 average_close_price: PriceValue = sentinel, closing_transaction_ids: ArrayTransactionID = sentinel,
                 financing: AccountUnits = sentinel, close_time: DateTime = sentinel,
                 client_extensions: ClientExtensions = sentinel, take_profit_order_id: OrderID = sentinel,
                 stop_loss_order_id: OrderID = sentinel, trailing_stop_loss_order_id: OrderID = sentinel,
                 margin_used: AccountUnits = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 type: TransactionType = sentinel, extension_number: int = sentinel, division_id: int = sentinel,
                 site_id: int = sentinel, account_user_id: int = sentinel, account_number: int = sentinel,
                 home_currency: Currency = sentinel, alias: str = sentinel, margin_rate: DecimalNumber = sentinel,
                 reason: Reason = sentinel, trade_ids: TradeID = sentinel, order_id: OrderID = sentinel,
                 client_order_id: ClientID = sentinel, replaced_by_order_id: OrderID = sentinel,
                 closed_trade_id: OrderID = sentinel, trade_close_transaction_id: TransactionID = sentinel,
                 client_extensions_modify: ClientExtensions = sentinel,
                 trade_client_extensions_modify: ClientExtensions = sentinel, financing: AccountUnits = sentinel,
                 account_balance: AccountUnits = sentinel, account_financing_mode: AccountFinancingMode = sentinel,
                 position_financings: ArrayPositionFinancing = sentinel, trade_id: TradeID = sentinel,
                 client_trade_id: ClientID = sentinel, price: PriceValue = sentinel,
                 time_in_force: TimeInForce = sentinel,
                 gtd_time: DateTime = sentinel, trigger_condition: OrderTriggerCondition = sentinel,
                 client_extensions: ClientExtensions = sentinel, order_fill_transaction_id: TransactionID = sentinel,
                 replaces_order_id: OrderID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 reject_reason: TransactionRejectReason = sentinel, amount: AccountUnits = sentinel,
                 funding_reason: FundingReason = sentinel, comment: str = sentinel,
                 instrument: InstrumentName = sentinel,
                 units: DecimalNumber = sentinel, price_bound: PriceValue = sentinel,
                 position_fill: OrderPositionFill = sentinel,
                 trade_close: MarketOrderTradeClose = sentinel,
                 long_position_closeout: MarketOrderPositionCloseout = sentinel,
                 short_position_closeout: MarketOrderPositionCloseout = sentinel,
                 margin_closeout: MarketOrderMarginCloseout = sentinel,
                 delayed_trade_close: MarketOrderDelayedTradeClose = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, distance: PriceValue = sentinel,
                 full_price: ClientPrice = sentinel, pl: AccountUnits = sentinel, commission: AccountUnits = sentinel,
                 trade_opened: TradeOpen = sentinel, trades_closed: ArrayTradeReduce = sentinel,
                 trade_reduced: TradeReduce = sentinel, intended_replaces_order_id: OrderID = sentinel,
                 # TODO update when OANDA ADVISES correct type. This is currently a guess.
                 gain_quote_home_conversion_factor: DecimalNumber = sentinel,
                 loss_quote_home_conversion_factor: DecimalNumber = sentinel,
                 guaranteed_execution_fee: AccountUnits = sentinel,
                 half_spread_cost: AccountUnits = sentinel,
                 partial_fill: str = sentinel,
                 guaranteed: bool = sentinel,
                 requested_units: AccountUnits = sentinel,
                 full_vwap: DecimalNumber = sentinel):
    def __init__(self, orders_created: ArrayOrder = sentinel, orders_cancelled: ArrayOrder = sentinel,
                 orders_filled: ArrayOrder = sentinel, orders_triggered: ArrayOrder = sentinel,
                 trades_opened: ArrayTradeSummary = sentinel, trades_reduced: ArrayTradeSummary = sentinel,
                 trades_closed: ArrayTradeSummary = sentinel, positions: ArrayPosition = sentinel,
                 transactions: ArrayTransaction = sentinel):
    def __init__(self, volume: DecimalNumber = sentinel, price_range: DecimalNumber = sentinel):
    def __init__(self, name: InstrumentName = sentinel, type: InstrumentType = sentinel, display_name: str = sentinel,
                 pip_location: int = sentinel, display_precision: int = sentinel, trade_units_precision: int = sentinel,
                 minimum_trade_size: DecimalNumber = sentinel, maximum_trailing_stop_distance: DecimalNumber = sentinel,
                 minimum_trailing_stop_distance: DecimalNumber = sentinel,
                 maximum_position_size: DecimalNumber = sentinel,
                 maximum_order_units: DecimalNumber = sentinel, margin_rate: DecimalNumber = sentinel,
                 commission: InstrumentCommission = sentinel,
                 guaranteed_stop_loss_order_level_restriction: GuaranteedStopLossOrderLevelRestriction = sentinel,
                 guaranteed_stop_loss_order_mode: GuaranteedStopLossOrderMode = sentinel,
                 tags: ArrayDict = sentinel, financing: object = sentinel):
    def __init__(self, unrealized_pl: AccountUnits = sentinel, nav: AccountUnits = sentinel,
                 margin_used: AccountUnits = sentinel,
                 margin_available: AccountUnits = sentinel, position_value: AccountUnits = sentinel,
                 margin_closeout_unrealized_pl: AccountUnits = sentinel, margin_closeout_nav: AccountUnits = sentinel,
                 margin_closeout_margin_used: AccountUnits = sentinel,
                 margin_closeout_percent: DecimalNumber = sentinel,
                 margin_closeout_position_value: DecimalNumber = sentinel, withdrawal_limit: AccountUnits = sentinel,
                 margin_call_margin_used: AccountUnits = sentinel, margin_call_percent: DecimalNumber = sentinel,
                 orders: ArrayDynamicOrderState = sentinel, trades: ArrayCalculatedTradeState = sentinel,
                 positions: ArrayCalculatedPositionState = sentinel,
                 balance: AccountUnits = sentinel,
                 # TODO check definition against OANDA docs
                 pl: AccountUnits = sentinel,
                 resettable_pl: AccountUnits = sentinel,
                 commission: AccountUnits = sentinel,
                 guaranteed_execution_fees: AccountUnits = sentinel
                 ):
    def __init__(self, type: str = sentinel, instrument: InstrumentName = sentinel, time: DateTime = sentinel,
                 # TODO: remove status when OANDA removes attribute
                 status: PriceStatus = sentinel, tradeable: bool = sentinel, bids: ArrayPriceBucket = sentinel,
                 asks: ArrayPriceBucket = sentinel, closeout_bid: PriceValue = sentinel,
                 closeout_ask: PriceValue = sentinel,
                 # TODO: remove quote_home_conversion_factors when OANDA removes attribute
                 quote_home_conversion_factors: QuoteHomeConversionFactors = sentinel,
                 # TODO: remove units_available when OANDA removes attribute
                 units_available: UnitsAvailable = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 extension_number: int = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel):
    def __init__(self, instrument: InstrumentName, trade_id: TradeID, price: PriceValue,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', client_extensions: ClientExtensions = sentinel):
    def __init__(self, instrument: InstrumentName, trade_id: TradeID, price: PriceValue,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', client_extensions: ClientExtensions = sentinel):
    def __init__(self, instrument: InstrumentName, trade_id: TradeID, distance: PriceValue,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', client_extensions: ClientExtensions = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 division_id: int = sentinel, site_id: int = sentinel,
                 account_user_id: int = sentinel, account_number: int = sentinel, home_currency: Currency = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 alias: str = sentinel, margin_rate: DecimalNumber = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 reason: MarketOrderReason = sentinel,
                 trade_ids: TradeID = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 order_id: OrderID = sentinel, client_order_id: ClientID = sentinel,
                 reason: OrderCancelReason = sentinel, replaced_by_order_id: OrderID = sentinel,
                 closed_trade_id: OrderID = sentinel, trade_close_transaction_id: TransactionID = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 order_id: OrderID = sentinel,
                 client_order_id: ClientID = sentinel, client_extensions_modify: ClientExtensions = sentinel,
                 trade_client_extensions_modify: ClientExtensions = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 financing: AccountUnits = sentinel,
                 account_balance: AccountUnits = sentinel, account_financing_mode: AccountFinancingMode = sentinel,
                 position_financings: ArrayPositionFinancing = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 trade_id: TradeID = sentinel,
                 client_trade_id: ClientID = sentinel, trade_client_extensions_modify: ClientExtensions = sentinel):
    def __init__(self, id: AccountID = sentinel, alias: str = sentinel, currency: Currency = sentinel,
                 balance: AccountUnits = sentinel,
                 created_by_user_id: int = sentinel, created_time: DateTime = sentinel, pl: AccountUnits = sentinel,
                 resettable_pl: AccountUnits = sentinel, resettabled_pl_time: DateTime = sentinel,
                 commission: AccountUnits = sentinel, margin_rate: DecimalNumber = sentinel,
                 margin_call_enter_time: DateTime = sentinel, margin_call_extension_count: int = sentinel,
                 last_margin_call_extension_time: DateTime = sentinel, open_trade_count: int = sentinel,
                 open_position_count: int = sentinel, pending_order_count: int = sentinel,
                 hedging_enabled: bool = sentinel,
                 unrealized_pl: AccountUnits = sentinel, nav: AccountUnits = sentinel,
                 margin_used: AccountUnits = sentinel,
                 margin_available: AccountUnits = sentinel, position_value: AccountUnits = sentinel,
                 margin_closeout_unrealized_pl: AccountUnits = sentinel, margin_closeout_nav: AccountUnits = sentinel,
                 margin_closeout_margin_used: AccountUnits = sentinel,
                 margin_closeout_percent: DecimalNumber = sentinel,
                 margin_closeout_position_value: DecimalNumber = sentinel, withdrawal_limit: AccountUnits = sentinel,
                 margin_call_margin_used: AccountUnits = sentinel, margin_call_percent: DecimalNumber = sentinel,
                 last_transaction_id: TransactionID = sentinel, trades: ArrayTradeSummary = sentinel,
                 positions: ArrayPosition = sentinel, orders: ArrayOrder = sentinel,
                 financing: DecimalNumber = sentinel,
                 guaranteed_stop_loss_order_mode: GuaranteedStopLossOrderMode = sentinel,
                 resettable_pl_time: DateTime = sentinel,
                 guaranteed_execution_fees: AccountUnits = sentinel,
                 dividend: DecimalNumber = sentinel,
                 ):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber,
                 time_in_force: TimeInForce = 'FOK', price_bound: PriceValue = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', client_extensions: ClientExtensions = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel):
    def __init__(self, trade_id: TradeID, price: PriceValue, id: TransactionID = sentinel, time: DateTime = sentinel,
                 user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', reason: TakeProfitOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, order_fill_transaction_id: TransactionID = sentinel,
                 replaces_order_id: OrderID = sentinel, cancelling_transaction_id: TransactionID = sentinel):
    def __init__(self, trade_id: TradeID, price: PriceValue, id: OrderID = sentinel, create_time: DateTime = sentinel,
                 state: OrderState = sentinel, client_extensions: ClientExtensions = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', filling_transaction_id: TransactionID = sentinel,
                 filled_time: DateTime = sentinel, trade_opened_id: TradeID = sentinel,
                 trade_reduced_id: TradeID = sentinel,
                 trade_closed_ids: ArrayTradeID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 cancelled_time: DateTime = sentinel, replaces_order_id: OrderID = sentinel,
                 replaced_by_order_id: OrderID = sentinel):
    def __init__(self, trade_id: TradeID, price: PriceValue, id: OrderID = sentinel, create_time: DateTime = sentinel,
                 state: OrderState = sentinel, client_extensions: ClientExtensions = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', guaranteed: bool = sentinel,
                 filling_transaction_id: TransactionID = sentinel,
                 filled_time: DateTime = sentinel, trade_opened_id: TradeID = sentinel,
                 trade_reduced_id: TradeID = sentinel,
                 trade_closed_ids: ArrayTradeID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 cancelled_time: DateTime = sentinel, replaces_order_id: OrderID = sentinel,
                 replaced_by_order_id: OrderID = sentinel):
    def __init__(self, trade_id: TradeID, distance: PriceValue, id: OrderID = sentinel,
                 create_time: DateTime = sentinel,
                 state: OrderState = sentinel, client_extensions: ClientExtensions = sentinel,
                 client_trade_id: ClientID = sentinel,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', trailing_stop_value: PriceValue = sentinel,
                 filling_transaction_id: TransactionID = sentinel, filled_time: DateTime = sentinel,
                 trade_opened_id: TradeID = sentinel, trade_reduced_id: TradeID = sentinel,
                 trade_closed_ids: ArrayTradeID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 cancelled_time: DateTime = sentinel, replaces_order_id: OrderID = sentinel,
                 replaced_by_order_id: OrderID = sentinel):
    def __init__(self, id: TradeID = sentinel, instrument: InstrumentName = sentinel, price: PriceValue = sentinel,
                 open_time: DateTime = sentinel, state: TradeState = sentinel, initial_units: DecimalNumber = sentinel,
                 initial_margin_required: AccountUnits = sentinel,
                 current_units: DecimalNumber = sentinel, realized_pl: AccountUnits = sentinel,
                 unrealized_pl: AccountUnits = sentinel, average_close_price: PriceValue = sentinel,
                 closing_transaction_ids: ArrayTransactionID = sentinel, financing: AccountUnits = sentinel,
                 close_time: DateTime = sentinel, client_extensions: ClientExtensions = sentinel,
                 take_profit_order: TakeProfitOrder = sentinel, stop_loss_order: StopLossOrder = sentinel,
                 trailing_stop_loss_order: TrailingStopLossOrder = sentinel,
                 margin_used: AccountUnits = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 alias: str = sentinel,
                 margin_rate: DecimalNumber = sentinel, reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 order_id: OrderID = sentinel,
                 client_order_id: ClientID = sentinel, reason: OrderCancelReason = sentinel,
                 reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 order_id: OrderID = sentinel,
                 client_order_id: ClientID = sentinel, client_extensions_modify: ClientExtensions = sentinel,
                 trade_client_extensions_modify: ClientExtensions = sentinel,
                 reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 trade_id: TradeID = sentinel,
                 client_trade_id: ClientID = sentinel, trade_client_extensions_modify: ClientExtensions = sentinel,
                 reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 amount: AccountUnits = sentinel,
                 funding_reason: FundingReason = sentinel, comment: str = sentinel,
                 account_balance: AccountUnits = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 amount: AccountUnits = sentinel,
                 funding_reason: FundingReason = sentinel, comment: str = sentinel,
                 reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 client_extensions: ClientExtensions = sentinel, take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue,
                 price_bound: PriceValue = sentinel,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 client_extensions: ClientExtensions = sentinel, take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue,
                 price_bound: PriceValue = sentinel, time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 client_extensions: ClientExtensions = sentinel, take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel):
    def __init__(self, id: AccountID = sentinel, alias: str = sentinel, currency: Currency = sentinel,
                 balance: AccountUnits = sentinel,
                 created_by_user_id: int = sentinel, created_time: DateTime = sentinel, pl: AccountUnits = sentinel,
                 resettable_pl: AccountUnits = sentinel, resettabled_pl_time: DateTime = sentinel,
                 commission: AccountUnits = sentinel, margin_rate: DecimalNumber = sentinel,
                 margin_call_enter_time: DateTime = sentinel, margin_call_extension_count: int = sentinel,
                 last_margin_call_extension_time: DateTime = sentinel, open_trade_count: int = sentinel,
                 open_position_count: int = sentinel, pending_order_count: int = sentinel,
                 hedging_enabled: bool = sentinel,
                 unrealized_pl: AccountUnits = sentinel, nav: AccountUnits = sentinel,
                 margin_used: AccountUnits = sentinel,
                 margin_available: AccountUnits = sentinel, position_value: AccountUnits = sentinel,
                 margin_closeout_unrealized_pl: AccountUnits = sentinel, margin_closeout_nav: AccountUnits = sentinel,
                 margin_closeout_margin_used: AccountUnits = sentinel,
                 margin_closeout_percent: DecimalNumber = sentinel,
                 margin_closeout_position_value: DecimalNumber = sentinel, withdrawal_limit: AccountUnits = sentinel,
                 margin_call_margin_used: AccountUnits = sentinel, margin_call_percent: DecimalNumber = sentinel,
                 last_transaction_id: TransactionID = sentinel, trades: ArrayTradeSummary = sentinel,
                 positions: ArrayPosition = sentinel, orders: ArrayOrder = sentinel,
                 financing: DecimalNumber = sentinel,
                 guaranteed_stop_loss_order_mode: GuaranteedStopLossOrderMode = sentinel,
                 resettable_pl_time: DateTime = sentinel,
                 dividend: DecimalNumber = sentinel,
                 dividend_adjustment: AccountUnits = sentinel,
                 guaranteed_execution_fees: AccountUnits = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, id: TransactionID = sentinel,
                 time: DateTime = sentinel,
                 user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel,
                 time_in_force: TimeInForce = 'FOK', price_bound: PriceValue = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trade_close: MarketOrderTradeClose = sentinel,
                 long_position_closeout: MarketOrderPositionCloseout = sentinel,
                 short_position_closeout: MarketOrderPositionCloseout = sentinel,
                 margin_closeout: MarketOrderMarginCloseout = sentinel,
                 delayed_trade_close: MarketOrderDelayedTradeClose = sentinel, reason: MarketOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, units: DecimalNumber = sentinel,
                 id: TransactionID = sentinel,
                 time: DateTime = sentinel,
                 user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel,
                 time_in_force: TimeInForce = 'FOK', price_bound: PriceValue = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trade_close: MarketOrderTradeClose = sentinel,
                 long_position_closeout: MarketOrderPositionCloseout = sentinel,
                 short_position_closeout: MarketOrderPositionCloseout = sentinel,
                 margin_closeout: MarketOrderMarginCloseout = sentinel,
                 delayed_trade_close: MarketOrderDelayedTradeClose = sentinel, reason: MarketOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel,
                 reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, trade_id: TradeID, price: PriceValue, id: TransactionID = sentinel, time: DateTime = sentinel,
                 user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', reason: StopLossOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, order_fill_transaction_id: TransactionID = sentinel,
                 replaces_order_id: OrderID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 guaranteed: bool = sentinel):
    def __init__(self, trade_id: TradeID, distance: PriceValue, id: TransactionID = sentinel, time: DateTime = sentinel,
                 user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', reason: TrailingStopLossOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, order_fill_transaction_id: TransactionID = sentinel,
                 replaces_order_id: OrderID = sentinel, cancelling_transaction_id: TransactionID = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue, id: OrderID = sentinel,
                 create_time: DateTime = sentinel, state: OrderState = sentinel,
                 client_extensions: ClientExtensions = sentinel,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, filling_transaction_id: TransactionID = sentinel,
                 filled_time: DateTime = sentinel, trade_opened_id: TradeID = sentinel,
                 trade_reduced_id: TradeID = sentinel,
                 trade_closed_ids: ArrayTradeID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 cancelled_time: DateTime = sentinel, replaces_order_id: OrderID = sentinel,
                 replaced_by_order_id: OrderID = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue, id: OrderID = sentinel,
                 create_time: DateTime = sentinel, state: OrderState = sentinel,
                 client_extensions: ClientExtensions = sentinel,
                 price_bound: PriceValue = sentinel,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 initial_market_price: PriceValue = sentinel, take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, filling_transaction_id: TransactionID = sentinel,
                 filled_time: DateTime = sentinel, trade_opened_id: TradeID = sentinel,
                 trade_reduced_id: TradeID = sentinel,
                 trade_closed_ids: ArrayTradeID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 cancelled_time: DateTime = sentinel, replaces_order_id: OrderID = sentinel,
                 replaced_by_order_id: OrderID = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue, id: OrderID = sentinel,
                 create_time: DateTime = sentinel, state: OrderState = sentinel,
                 client_extensions: ClientExtensions = sentinel,
                 price_bound: PriceValue = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel, position_fill: OrderPositionFill = 'DEFAULT',
                 trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, filling_transaction_id: TransactionID = sentinel,
                 filled_time: DateTime = sentinel, trade_opened_id: TradeID = sentinel,
                 trade_reduced_id: TradeID = sentinel,
                 trade_closed_ids: ArrayTradeID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 cancelled_time: DateTime = sentinel, replaces_order_id: OrderID = sentinel,
                 replaced_by_order_id: OrderID = sentinel):
    def __init__(self, id: TransactionID = sentinel, time: DateTime = sentinel, user_id: int = sentinel,
                 account_id: AccountID = sentinel, batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 order_id: OrderID = sentinel, client_order_id: ClientID = sentinel,
                 instrument: InstrumentName = sentinel, units: DecimalNumber = sentinel, price: PriceValue = sentinel,
                 full_price: ClientPrice = sentinel, reason: OrderFillReason = sentinel, pl: AccountUnits = sentinel,
                 financing: AccountUnits = sentinel, commission: AccountUnits = sentinel,
                 account_balance: AccountUnits = sentinel,
                 trade_opened: TradeOpen = sentinel, trades_closed: ArrayTradeReduce = sentinel,
                 trade_reduced: TradeReduce = sentinel,
                 gain_quote_home_conversion_factor: DecimalNumber = sentinel,
                 loss_quote_home_conversion_factor: DecimalNumber = sentinel,
                 guaranteed_execution_fee: AccountUnits = sentinel,
                 half_spread_cost: AccountUnits = sentinel,
                 requested_units: AccountUnits = sentinel,
                 full_vwap: DecimalNumber = sentinel):
    def __init__(self, trade_id: TradeID = sentinel, price: PriceValue = sentinel, id: TransactionID = sentinel,
                 time: DateTime = sentinel,
                 user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', reason: StopLossOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, order_fill_transaction_id: TransactionID = sentinel,
                 intended_replaces_order_id: OrderID = sentinel, reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue,
                 id: TransactionID = sentinel,
                 time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel,
                 batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 price_bound: PriceValue = sentinel,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 reason: MarketIfTouchedOrderReason = sentinel, client_extensions: ClientExtensions = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, replaces_order_id: OrderID = sentinel,
                 cancelling_transaction_id: TransactionID = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue,
                 id: TransactionID = sentinel,
                 time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel,
                 batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 reason: LimitOrderReason = sentinel, client_extensions: ClientExtensions = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, replaces_order_id: OrderID = sentinel,
                 cancelling_transaction_id: TransactionID = sentinel, partial_fill: OrderPositionFill = sentinel):
    def __init__(self, trade_id: TradeID = sentinel, price: PriceValue = sentinel, id: TransactionID = sentinel,
                 time: DateTime = sentinel,
                 user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', reason: TakeProfitOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, order_fill_transaction_id: TransactionID = sentinel,
                 intended_replaces_order_id: OrderID = sentinel, reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, trade_id: TradeID = sentinel, distance: PriceValue = sentinel, id: TransactionID = sentinel,
                 time: DateTime = sentinel,
                 user_id: int = sentinel, account_id: AccountID = sentinel, batch_id: TransactionID = sentinel,
                 request_id: RequestID = sentinel,
                 client_trade_id: ClientID = sentinel, time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel,
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', reason: TrailingStopLossOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, order_fill_transaction_id: TransactionID = sentinel,
                 intended_replaces_order_id: OrderID = sentinel, reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, price: PriceValue,
                 id: TransactionID = sentinel,
                 time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel,
                 batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 partial_fill: str = sentinel,
                 price_bound: PriceValue = sentinel, time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 reason: StopOrderReason = sentinel, client_extensions: ClientExtensions = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, replaces_order_id: OrderID = sentinel,
                 cancelling_transaction_id: TransactionID = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, units: DecimalNumber = sentinel,
                 price: PriceValue = sentinel,
                 id: TransactionID = sentinel,
                 time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel,
                 batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 price_bound: PriceValue = sentinel,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 reason: MarketIfTouchedOrderReason = sentinel, client_extensions: ClientExtensions = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, intended_replaces_order_id: OrderID = sentinel,
                 reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, units: DecimalNumber = sentinel,
                 price: PriceValue = sentinel,
                 id: TransactionID = sentinel,
                 time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel,
                 batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 time_in_force: TimeInForce = 'GTC',
                 gtd_time: DateTime = sentinel, position_fill: OrderPositionFill = 'DEFAULT',
                 trigger_condition: OrderTriggerCondition = 'DEFAULT', reason: LimitOrderReason = sentinel,
                 client_extensions: ClientExtensions = sentinel, take_profit_on_fill: TakeProfitDetails = sentinel,
                 stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, intended_replaces_order_id: OrderID = sentinel,
                 reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, instrument: InstrumentName = sentinel, units: DecimalNumber = sentinel,
                 price: PriceValue = sentinel,
                 id: TransactionID = sentinel,
                 time: DateTime = sentinel, user_id: int = sentinel, account_id: AccountID = sentinel,
                 batch_id: TransactionID = sentinel, request_id: RequestID = sentinel,
                 price_bound: PriceValue = sentinel,
                 time_in_force: TimeInForce = 'GTC', gtd_time: DateTime = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trigger_condition: OrderTriggerCondition = 'DEFAULT',
                 reason: StopOrderReason = sentinel, client_extensions: ClientExtensions = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, intended_replaces_order_id: OrderID = sentinel,
                 reject_reason: TransactionRejectReason = sentinel):
    def __init__(self, instrument: InstrumentName, units: DecimalNumber, id: OrderID = sentinel,
                 create_time: DateTime = sentinel,
                 state: OrderState = sentinel, client_extensions: ClientExtensions = sentinel,
                 time_in_force: TimeInForce = 'FOK', price_bound: PriceValue = sentinel,
                 position_fill: OrderPositionFill = 'DEFAULT', trade_close: MarketOrderTradeClose = sentinel,
                 long_position_closeout: MarketOrderPositionCloseout = sentinel,
                 short_position_closeout: MarketOrderPositionCloseout = sentinel,
                 margin_closeout: MarketOrderMarginCloseout = sentinel,
                 delayed_trade_close: MarketOrderDelayedTradeClose = sentinel,
                 take_profit_on_fill: TakeProfitDetails = sentinel, stop_loss_on_fill: StopLossDetails = sentinel,
                 trailing_stop_loss_on_fill: TrailingStopLossDetails = sentinel,
                 trade_client_extensions: ClientExtensions = sentinel, filling_transaction_id: TransactionID = sentinel,
                 filled_time: DateTime = sentinel, trade_opened_id: TradeID = sentinel,
                 trade_reduced_id: TradeID = sentinel,
                 trade_closed_ids: ArrayTradeID = sentinel, cancelling_transaction_id: TransactionID = sentinel,
                 cancelled_time: DateTime = sentinel): class ArrayTransaction(Array, contains=Transaction):
    pass class Authorization(str):
    """Contains OANDA's v20 API authorization token"""
    pass class SinceTransactionID(TransactionID):
    """The account changes to get Since LastTransactionID for account_changes() method"""
    pass class LastTransactionID(TransactionID):
    """Contains the most recent TransactionID"""
    pass class InitializationFailure(AsyncV20Exception):
    """OandaClient Failed to initialize"""
    pass class ResponseTimeout(AsyncV20Exception):
    """The server took to long to respond"""
    pass class CloseAllTradesFailure(AsyncV20Exception):
    """Failed to close all trades"""
    pass def too_many_passed_transactions(self):
    try:
        if (self.default_parameters[LastTransactionID] -
            self.default_parameters[SinceTransactionID]) > ALLOWED_SINCE_TRANSACTION_ID:
            return True
    except KeyError:
        # Means client isn't initialized
        pass
    return False
import asyncio
import logging
import os
import ujson as json
import aiohttp
from functools import partial
from time import time
from yarl import URL
from .definitions.types import AcceptDatetimeFormat
from .definitions.types import AccountID
from .definitions.types import ArrayTransaction
from .endpoints.annotations import Authorization, SinceTransactionID, LastTransactionID
from .exceptions import InitializationFailure, ResponseTimeout, CloseAllTradesFailure
from .interface import *
from .interface.helpers import too_many_passed_transactions
    def max_simultaneous_connections(self, value):
        # Limit concurrent connections
        self._max_simultaneous_connections = {True: value, False: 0}[value >= 0]

    @property
    def datetime_format(self):
        return self._datetime_format

    def __init__(self,
                 token=None,
                 account_id=None,
                 format_order_requests=False,
                 max_transaction_history=100,
                 rest_host='api-fxpractice.oanda.com',
                 rest_port=443,
                 rest_scheme='https',
                 stream_host='stream-fxpractice.oanda.com',
                 stream_port=None,
                 stream_scheme='https',
                 health_host='api-status.oanda.com',
                 health_port=80,
                 health_scheme='http',
                 datetime_format='UNIX',
                 rest_timeout=10,
                 stream_timeout=60,
                 max_requests_per_second=99,
                 max_simultaneous_connections=10,
                 debug=False):

        self.version = __version__

        if token is None:
            token = os.environ['OANDA_TOKEN']

        self.account_id = account_id

        self.format_order_requests = format_order_requests

        self.max_transaction_history = max_transaction_history

        # V20 REST API URL
        rest_host = partial(URL.build, host=rest_host, port=rest_port, scheme=rest_scheme)

        # v20 STREAM API URL
        stream_host = partial(URL.build, host=stream_host, port=stream_port, scheme=stream_scheme)

        # V20 API health URL
        health_host = partial(URL.build, host=health_host, port=health_port, scheme=health_scheme)

        self._hosts = {'REST': rest_host, 'STREAM': stream_host, 'HEALTH': health_host}

        # The timeout to use when making a polling request with the
        # v20 REST server
        self.rest_timeout = rest_timeout

        # The timeout to use when waiting for the next object when wait for a stream response
        self.stream_timeout = stream_timeout

        self.max_requests_per_second = max_requests_per_second

        self.max_simultaneous_connections = max_simultaneous_connections

        self._datetime_format = datetime_format

        # This is the default parameter dictionary. OandaClient Methods that require certain parameters
        # that are  not explicitly passed will try to find it in this dict
        self.default_parameters.update(
            {Authorization: 'Bearer {}'.format(token),
             AcceptDatetimeFormat: datetime_format}
        )

        self.debug = debug

    async def account(self):
        """Get updated account

        Returns:

            :class:`~async_v20.Account`
        """
        logger.info('account()')
        if too_many_passed_transactions(self):
            await self.get_account_details()
        else:
            await self.account_changes()
        return self._account

    async def close_all_trades(self):
        """Close all open trades

        Returns:

            :class:`tuple` (:class:`bool`, [:class`~async_v20.interface.response.Response`, ...])

        """

        # Procedure is as follows:
        # - get all open trades
        # - attempt to close all open trades
        # - get all open trades again and check there there are None
        # - return close trade responses

        logger.info('close_all_trades()')
        response = await self.list_open_trades()
        if response:
            close_trade_responses = await asyncio.gather(*[self.close_trade(trade.id)
                                                           for trade in response.trades])
        else:
            msg = f'Could not get open trades. ' \
                  f'Server returned status {response.status}'
            logger.error(msg)
            raise CloseAllTradesFailure(msg)
        # After closing all trades check that all trades have indeed been closed
        response = await self.list_open_trades()
        if response and len(response.trades) == 0:
            pass
        else:
            msg = f'Unable to confirm all trades have been closed! ' \
                  f'Server returned status {response.status}'
            logger.error(msg)

            raise CloseAllTradesFailure(msg)