Skip to content

api ¤

LiveAPI ¤

LiveAPI(**kwargs)

Bases: ABC

Source code in lettrade/exchange/live/api.py
18
19
def __init__(self, **kwargs):
    """"""

account abstractmethod ¤

account() -> dict
Source code in lettrade/exchange/live/api.py
65
66
67
@abstractmethod
def account(self) -> dict:
    """"""

bars abstractmethod ¤

bars(
    symbol,
    timeframe,
    since: int | datetime | None = 0,
    to: int | datetime | None = 1000,
) -> list[list]
Source code in lettrade/exchange/live/api.py
48
49
50
51
52
53
54
55
56
@abstractmethod
def bars(
    self,
    symbol,
    timeframe,
    since: int | datetime | None = 0,
    to: int | datetime | None = 1_000,
) -> list[list]:
    """"""

execution_get abstractmethod ¤

execution_get(id: str, **kwargs) -> dict
Source code in lettrade/exchange/live/api.py
128
129
130
@abstractmethod
def execution_get(self, id: str, **kwargs) -> dict:
    """"""

executions_get abstractmethod ¤

executions_get(
    position_id: str | None = None,
    search: str | None = None,
    **kwargs
) -> list[dict]
Source code in lettrade/exchange/live/api.py
119
120
121
122
123
124
125
126
@abstractmethod
def executions_get(
    self,
    position_id: str | None = None,
    search: str | None = None,
    **kwargs,
) -> list[dict]:
    """"""

executions_total abstractmethod ¤

executions_total(
    since: datetime | None = None,
    to: datetime | None = None,
    **kwargs
) -> int
Source code in lettrade/exchange/live/api.py
110
111
112
113
114
115
116
117
@abstractmethod
def executions_total(
    self,
    since: datetime | None = None,
    to: datetime | None = None,
    **kwargs,
) -> int:
    """"""

heartbeat ¤

heartbeat() -> bool
Source code in lettrade/exchange/live/api.py
34
35
36
def heartbeat(self) -> bool:
    """"""
    return True

init ¤

init(**kwargs)
Source code in lettrade/exchange/live/api.py
21
22
def init(self, **kwargs):
    """"""

market abstractmethod ¤

market(symbol: str) -> dict
Source code in lettrade/exchange/live/api.py
39
40
41
@abstractmethod
def market(self, symbol: str) -> dict:
    """"""

markets abstractmethod ¤

markets(symbols: list[str]) -> dict
Source code in lettrade/exchange/live/api.py
43
44
45
@abstractmethod
def markets(self, symbols: list[str]) -> dict:
    """"""

multiprocess classmethod ¤

multiprocess(kwargs: dict, **other_kwargs)
Source code in lettrade/exchange/live/api.py
14
15
16
@classmethod
def multiprocess(cls, kwargs: dict, **other_kwargs):
    """"""

next ¤

next()
Source code in lettrade/exchange/live/api.py
27
28
def next(self):
    """"""

order_close abstractmethod ¤

order_close(order: LiveOrder, **kwargs) -> dict
Source code in lettrade/exchange/live/api.py
96
97
98
@abstractmethod
def order_close(self, order: "LiveOrder", **kwargs) -> dict:
    """"""

order_open abstractmethod ¤

order_open(**kwargs) -> dict
Source code in lettrade/exchange/live/api.py
88
89
90
@abstractmethod
def order_open(self, **kwargs) -> dict:
    """"""

order_update abstractmethod ¤

order_update(
    order: LiveOrder, sl=None, tp=None, **kwargs
) -> dict
Source code in lettrade/exchange/live/api.py
92
93
94
@abstractmethod
def order_update(self, order: "LiveOrder", sl=None, tp=None, **kwargs) -> dict:
    """"""

orders_get abstractmethod ¤

orders_get(
    id: str | None = None,
    symbol: str | None = None,
    **kwargs
)
Source code in lettrade/exchange/live/api.py
79
80
81
82
83
84
85
86
@abstractmethod
def orders_get(
    self,
    id: str | None = None,
    symbol: str | None = None,
    **kwargs,
):
    """"""

orders_history_get ¤

orders_history_get(
    id: str | None = None,
    since: datetime | None = None,
    to: datetime | None = None,
    **kwargs
) -> list[dict]
Source code in lettrade/exchange/live/api.py
100
101
102
103
104
105
106
107
def orders_history_get(
    self,
    id: str | None = None,
    since: datetime | None = None,
    to: datetime | None = None,
    **kwargs,
) -> list[dict]:
    """"""

orders_total abstractmethod ¤

orders_total(
    since: datetime | None = None,
    to: datetime | None = None,
    **kwargs
) -> int
Source code in lettrade/exchange/live/api.py
70
71
72
73
74
75
76
77
@abstractmethod
def orders_total(
    self,
    since: datetime | None = None,
    to: datetime | None = None,
    **kwargs,
) -> int:
    """"""

position_close abstractmethod ¤

position_close(position: LivePosition, **kwargs) -> dict
Source code in lettrade/exchange/live/api.py
156
157
158
@abstractmethod
def position_close(self, position: "LivePosition", **kwargs) -> dict:
    """"""

position_update abstractmethod ¤

position_update(
    position: LivePosition,
    sl: float | None = None,
    tp: float | None = None,
    **kwargs
) -> dict
Source code in lettrade/exchange/live/api.py
146
147
148
149
150
151
152
153
154
@abstractmethod
def position_update(
    self,
    position: "LivePosition",
    sl: float | None = None,
    tp: float | None = None,
    **kwargs,
) -> dict:
    """"""

positions_get abstractmethod ¤

positions_get(
    id: str = None, symbol: str = None, **kwargs
) -> list[dict]
Source code in lettrade/exchange/live/api.py
142
143
144
@abstractmethod
def positions_get(self, id: str = None, symbol: str = None, **kwargs) -> list[dict]:
    """"""

positions_total abstractmethod ¤

positions_total(
    since: datetime | None = None,
    to: datetime | None = None,
    **kwargs
) -> int
Source code in lettrade/exchange/live/api.py
133
134
135
136
137
138
139
140
@abstractmethod
def positions_total(
    self,
    since: datetime | None = None,
    to: datetime | None = None,
    **kwargs,
) -> int:
    """"""

start ¤

start(exchange: LiveExchange)
Source code in lettrade/exchange/live/api.py
24
25
def start(self, exchange: "LiveExchange"):
    """"""

stop ¤

stop()
Source code in lettrade/exchange/live/api.py
30
31
def stop(self):
    """"""

tick_get abstractmethod ¤

tick_get(symbol: str) -> dict
Source code in lettrade/exchange/live/api.py
59
60
61
@abstractmethod
def tick_get(self, symbol: str) -> dict:
    """"""