-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlive_trader_simple.py
More file actions
83 lines (65 loc) · 2.78 KB
/
live_trader_simple.py
File metadata and controls
83 lines (65 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
""" examples/live_trader_simple.py
This is a simple example of a live trader configuration.
Relevant configuration options are:
- trader.run_live: If True, the trader will run in live mode.
- trader.id: The id of the trader. Used to identify the trader.
Useful if you want to run multiple traders on the same DB.
- trader.budget: In live mode, the setting of a budget can be ignored as it is
automatically set to the current balance of the
base_currency on the exchange.
- trader.maker_fee: This setting is irrelevant in live mode as the fee is
determined by the exchange.
- trader.taker_fee: This setting is irrelevant in live mode as the fee is
determined by the exchange.
- trader.strategy: The strategy configuration is the same as in simulation mode.
- market_history.update_mode: Needs to be set to "live" which ensures that
the market history gets real-time updates
via Websocket streams.
See README.md for more information about the Tradeforce configuration options.
DISCLAIMER
----------------------------------------------------------------------------
Use at your own risk! Tradeforce is currently in beta, and bugs may occur.
Furthermore, there is no guarantee that strategies that have performed well
in the past will continue to do so in the future.
----------------------------------------------------------------------------
"""
from tradeforce import Tradeforce
CONFIG = {
"market_history": {
"name": "bitfinex_history",
"exchange": "bitfinex",
"base_currency": "USD",
"candle_interval": "5min",
"fetch_init_timeframe_days": 100,
"update_mode": "live",
},
"backend": {
"dbms": "postgresql",
"dbms_host": "docker_db",
"dbms_port": 5433,
"dbms_connect_db": "postgres",
"dbms_user": "postgres",
"dbms_pw": "postgres",
"local_cache": False,
},
"trader": {
"id": 1,
"run_live": True,
"maker_fee": 0.10,
"taker_fee": 0.20,
"strategy": {
"amount_invest_per_asset": 100,
"moving_window_hours": 180,
"buy_signal_score": 0.10,
"buy_signal_boundary": 0.05,
"buy_signal_preference": 1,
"profit_factor_target": 1.10,
"hold_time_days": 4,
"profit_factor_target_min": 1.01,
},
},
}
def main() -> None:
Tradeforce(config=CONFIG).run()
if __name__ == "__main__":
main()