-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.py
More file actions
27 lines (22 loc) · 822 Bytes
/
bot.py
File metadata and controls
27 lines (22 loc) · 822 Bytes
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
from binance.client import Client #pip install python-binance
from binance.enums import *
from cre import api_key, api_secret
import time
import telegram_send
client = Client(api_key, api_secret)
stables = ["SUSDUSDT", "USTUSDT", "BUSDUSDT", "USDPUSDT", "TUSDUSDT", "USDCUSDT"]
def takeprice(stable):
price = client.get_ticker(symbol=stable)
return price['lastPrice']
def buy_stable(stable) :
order = client.order_limit_buy(symbol=f'{stable}', quantity= 99, price= 0.992)
telegram_send.send(messages = [f"{stable} alım emri gönderildi"])
#return f"{stable} alım emri gönderildi"
pass
while True :
for i in stables :
price = takeprice(i)
print(price)
if float(price) < 1 :
buy_stable(i)
time.sleep(30)