lettrade
¤
LetTrade
¤
LetTrade(
datas: DataFeed | list[DataFeed] | str | list[str],
strategy: type[Strategy],
feeder: type[DataFeeder],
exchange: type[Exchange],
account: type[Account],
commander: type[Commander] | Commander | None = None,
stats: type[BotStatistic] = BotStatistic,
plotter: type[Plotter] | None = None,
name: str | None = None,
bot: type[LetTradeBot] = LetTradeBot,
**kwargs
)
Building new bot object and handle multiprocessing
Parameters:
-
datas
(DataFeed | list[DataFeed] | str | list[str]
) –description
-
strategy
(type[Strategy]
) –description
-
feeder
(type[DataFeeder]
) –description
-
exchange
(type[Exchange]
) –description
-
account
(type[Account]
) –description
-
commander
(type[Commander] | Commander | None
, default:None
) –description. Defaults to None.
-
stats
(type[BotStatistic]
, default:BotStatistic
) –description. Defaults to BotStatistic.
-
plotter
(type[Plotter] | None
, default:None
) –description. Defaults to None.
-
name
(str | None
, default:None
) –description. Defaults to None.
-
bot
(type[LetTradeBot]
, default:LetTradeBot
) –description. Defaults to LetTradeBot.
Source code in lettrade/lettrade.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
plot
¤
plot(*args, jump: dict | None = None, **kwargs)
Plot strategy/optimize result
BotPlotter
Miror of BotPlotter.plot(). Plotly implement PlotlyBotPlotter.plot().
Args:
jump
(dict | None, optional): Miror of BotPlotter.jump()
Example: Jump to position_id
lt.plot(
jump=dict(position_id=1, range=300),
layout=dict(height=2000),
)
OptimizePlotter
Miror of OptimizePlotter.plot(). Plotly implement PlotlyOptimizePlotter.plot().
Example:
lt.plot(layout=dict(height=2000))
Source code in lettrade/lettrade.py
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
|
run
¤
run(worker: int | None = None, **kwargs)
Run LetTrade in single or multiple processing
Parameters:
-
worker
(int | None
, default:None
) –Number of processing. Defaults to None.
Source code in lettrade/lettrade.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
start
¤
start(force: bool = False)
Start LetTrade by init bot object and loading datafeeds
Parameters:
-
force
(bool
, default:False
) –description. Defaults to False.
Source code in lettrade/lettrade.py
108 109 110 111 112 113 114 115 116 117 |
|
stop
¤
stop()
Stop LetTrade
Source code in lettrade/lettrade.py
185 186 187 188 189 190 |
|