-
Notifications
You must be signed in to change notification settings - Fork 0
/
assets.py
38 lines (30 loc) · 1.16 KB
/
assets.py
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
class Asset():
"""Base class for all assets"""
def __init__(
self,
name: str,
symbol: str,
account_id: str,
amount_to_buy: float,
buy_price_percentage_change_threshold: float,
sell_price_percentage_change_threshold: float,
max_open_buys: int):
self.name = name
self.symbol = symbol
self.account_id = account_id
self.amount_to_buy = amount_to_buy
self.buy_price_percentage_change_threshold = buy_price_percentage_change_threshold
self.sell_price_percentage_change_threshold = sell_price_percentage_change_threshold
self.max_open_buys = max_open_buys
def __str__(self):
return f'{self.name} @ {self.price}'
def symbol(self):
return self.symbol
def amount_to_buy(self):
return self.amount_to_buy
def buy_price_percentage_change_threshold(self):
return self.buy_price_percentage_change_threshold
def sell_price_percentage_change_threshold(self):
return self.sell_price_percentage_change_threshold
def max_open_buys(self):
return self.max_open_buys