Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wiseplat
GitHub Repository: wiseplat/python-code
Path: blob/master/ invest-robot-contest_invest-bot-main/configuration/settings.py
5925 views
1
from dataclasses import dataclass, field
2
3
__all__ = ("StrategySettings", "AccountSettings", "ShareSettings", "TradingSettings", "BlogSettings")
4
5
6
@dataclass(eq=False, repr=True)
7
class StrategySettings:
8
name: str = ""
9
figi: str = ""
10
ticker: str = ""
11
max_lots_per_order: int = 1
12
# All internal strategy settings are represented as dict. A strategy class have to parse it himself.
13
# Here, we avoid any strong dependencies and obligations
14
settings: dict = field(default_factory=dict)
15
lot_size: int = 1
16
short_enabled_flag: bool = True
17
18
19
@dataclass(eq=False, repr=True)
20
class AccountSettings:
21
min_liquid_portfolio: int = 10000
22
min_rub_on_account: int = 5000
23
24
25
@dataclass(eq=False, repr=True)
26
class ShareSettings:
27
ticker: str = ""
28
lot: int = 1
29
short_enabled_flag: bool = False
30
otc_flag: bool = False
31
buy_available_flag: bool = False
32
sell_available_flag: bool = False
33
api_trade_available_flag: bool = False
34
35
36
@dataclass(eq=False, repr=True)
37
class TradingSettings:
38
delay_start_after_open: int = 10
39
stop_trade_before_close: int = 300
40
stop_signals_before_close: int = 60
41
42
43
@dataclass(eq=False, repr=True)
44
class BlogSettings:
45
blog_status: bool
46
bot_token: str
47
chat_id: str
48
49