API models¶
-
class
crix.models.
Account
(id, user_id, balance, locked_balance, currency_name, deposit_address)[source]¶ -
balance
¶ Return type: Decimal
-
currency_name
¶ Return type: str
-
deposit_address
¶ Return type: str
-
id
¶ Return type: int
-
locked_balance
¶ Return type: Decimal
-
user_id
¶ Return type: int
-
-
class
crix.models.
Depth
(symbol_name, is_aggregated, last_update_id, level_aggregation, asks, bids)[source]¶ -
asks
¶ Return type: typing.List[crix.models.Offer]
-
bids
¶ Return type: typing.List[crix.models.Offer]
-
is_aggregated
¶ Return type: bool
-
last_update_id
¶ Return type: int
-
level_aggregation
¶ Return type: int
-
symbol_name
¶ Return type: str
-
-
class
crix.models.
NewOrder
(type, symbol, price, quantity, is_buy, time_in_force, stop_price, expire_time)[source]¶ -
expire_time
¶ Return type: typing.Union[datetime.datetime, NoneType]
-
is_buy
¶ Return type: bool
-
static
limit
(symbol, is_buy, price, quantity, **args)[source]¶ Helper to create basic limit order
Parameters: - symbol (
str
) – symbol name as defined by the exchange - is_buy (
bool
) – order direction - price (
Union
[Decimal
,float
,str
]) – order price - quantity (
Union
[Decimal
,float
,str
]) – number of items in the order - args – additional parameters proxied to the NewOrder constructor
Return type: Returns: new order
- symbol (
-
static
market
(symbol, is_buy, quantity, **args)[source]¶ Helper to create basic market order
Parameters: - symbol (
str
) – symbol name as defined by the exchange - is_buy (
bool
) – order direction - quantity (
Union
[Decimal
,float
,str
]) – number of items - args – additional parameters proxied to the NewOrder constructor
Return type: Returns: new order
- symbol (
-
price
¶ Return type: Decimal
-
quantity
¶ Return type: Decimal
-
stop_price
¶ Return type: typing.Union[decimal.Decimal, NoneType]
-
symbol
¶ Return type: str
-
time_in_force
¶ Return type: TimeInForce
-
-
class
crix.models.
Offer
(count, price, quantity)[source]¶ -
count
¶ Return type: int
-
price
¶ Return type: Decimal
-
quantity
¶ Return type: Decimal
-
-
class
crix.models.
Order
(id, user_id, type, symbol_name, is_buy, quantity, price, stop_price, filled_quantity, time_in_force, expire_time, status, created_at, last_updated_at)[source]¶ -
created_at
¶ Return type: datetime
-
expire_time
¶ Return type: typing.Union[datetime.datetime, NoneType]
-
filled_quantity
¶ Return type: Decimal
-
id
¶ Return type: int
-
is_buy
¶ Return type: bool
-
last_updated_at
¶ Return type: datetime
-
price
¶ Return type: Decimal
-
quantity
¶ Return type: Decimal
-
status
¶ Return type: OrderStatus
-
stop_price
¶ Return type: Decimal
-
symbol_name
¶ Return type: str
-
time_in_force
¶ Return type: TimeInForce
-
user_id
¶ Return type: int
-
-
class
crix.models.
OrderType
[source]¶ An enumeration.
-
limit
= 0¶
-
market
= 1¶
-
stop_loss
= 2¶
-
stop_loss_limit
= 3¶
-
stop_loss_range
= 4¶
-
take_profit
= 5¶
-
take_profit_limit
= 6¶
-
-
class
crix.models.
Resolution
[source]¶ An enumeration.
-
day
= 'D'¶
-
fifteen_minutes
= '15'¶
-
five_minutes
= '5'¶
-
four_hours
= '240'¶
-
half_an_hour
= '30'¶
-
hour
= '60'¶
-
one_minute
= '1'¶
-
two_hours
= '120'¶
-
week
= 'W'¶
-
-
class
crix.models.
Symbol
(name, base, base_precision, quote, quote_precision, description, level_aggregation, maker_fee, taker_fee, min_lot, max_lot, min_price, max_price, min_notional, tick_lot, tick_price, is_trading)[source]¶ -
base
¶ Return type: str
-
base_precision
¶ Return type: int
-
description
¶ Return type: str
-
is_trading
¶ Return type: bool
-
level_aggregation
¶ Return type: typing.List[int]
-
maker_fee
¶ Return type: Decimal
-
max_lot
¶ Return type: Decimal
-
max_price
¶ Return type: Decimal
-
min_lot
¶ Return type: Decimal
-
min_notional
¶ Return type: Decimal
-
min_price
¶ Return type: Decimal
-
name
¶ Return type: str
-
quote
¶ Return type: str
-
quote_precision
¶ Return type: int
-
taker_fee
¶ Return type: Decimal
-
tick_lot
¶ Return type: Decimal
-
tick_price
¶ Return type: Decimal
-
-
class
crix.models.
Ticker
(symbol_name, open_time, open, close, high, low, volume, resolution)[source]¶ -
close
¶ Return type: Decimal
-
static
from_json_history
(info)[source]¶ Construct object from dictionary (for a fixed resolution)
Return type: Ticker
-
high
¶ Return type: Decimal
-
low
¶ Return type: Decimal
-
open
¶ Return type: Decimal
-
open_time
¶ Return type: datetime
-
resolution
¶ Return type: str
-
symbol_name
¶ Return type: str
-
volume
¶ Return type: Decimal
-
-
class
crix.models.
Ticker24
(symbol_name, open_time, open, close, high, low, volume, resolution, first_id, last_id, prev_close_price, price_change, price_change_percent)[source]¶ -
close
¶ Return type: Decimal
-
first_id
¶ Return type: int
-
high
¶ Return type: Decimal
-
last_id
¶ Return type: int
-
low
¶ Return type: Decimal
-
open
¶ Return type: Decimal
-
open_time
¶ Return type: datetime
-
prev_close_price
¶ Return type: Decimal
-
price_change
¶ Return type: Decimal
-
price_change_percent
¶ Return type: Decimal
-
resolution
¶ Return type: str
-
symbol_name
¶ Return type: str
-
volume
¶ Return type: Decimal
-
-
class
crix.models.
TimeInForce
[source]¶ An enumeration.
-
fill_or_kill
= 2¶
-
good_till_cancel
= 0¶
-
good_till_date
= 3¶
-
immediate_or_cancel
= 1¶
-
-
class
crix.models.
Trade
(id, user_id, created_at, order_filled, is_buy, order_id, price, quantity, fee, fee_currency, symbol_name)[source]¶ -
created_at
¶ Return type: datetime
-
fee
¶ Return type: Decimal
-
fee_currency
¶ Return type: str
-
id
¶ Return type: int
-
is_buy
¶ Return type: bool
-
order_filled
¶ Return type: bool
-
order_id
¶ Return type: int
-
price
¶ Return type: Decimal
-
quantity
¶ Return type: Decimal
-
symbol_name
¶ Return type: str
-
user_id
¶ Return type: int
-