-
Notifications
You must be signed in to change notification settings - Fork 22
/
3commas.py
28 lines (23 loc) · 850 Bytes
/
3commas.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
# https://github.com/bogdanteodoru/py3cw
def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float,
time_in_force: str, current_time: datetime, **kwargs) -> bool:
coin, currency = pair.split('/')
p3cw = Py3CW(
key='........',
secret='............',
)
p3cw.request(
entity='bots',
action='start_new_deal',
action_id='12312313',
payload={
"bot_id": 12312313,
"pair": f"{currency}_{coin}",
},
)
PairLocks.lock_pair(
pair=pair,
until=datetime.now(timezone.utc) + timedelta(minutes=5),
reason="Send 3c buy order"
)
return False # we don't want to keep the trade in freqtrade db