mirror of
https://github.com/Death916/emailtrade.git
synced 2026-04-10 03:04:40 -07:00
added market check and started buy in trade.py
This commit is contained in:
parent
76ac01b532
commit
2b4cda19d0
1 changed files with 27 additions and 0 deletions
27
trade.py
Normal file
27
trade.py
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
#! python3
|
||||||
|
|
||||||
|
import json
|
||||||
|
from bittrex.bittrex import Bittrex, API_V2_0
|
||||||
|
|
||||||
|
amount = 0
|
||||||
|
price = 0
|
||||||
|
|
||||||
|
with open('D:/code/emailtrade/keys.json') as k:
|
||||||
|
keys = json.load(k)
|
||||||
|
api_key = keys['api_key']
|
||||||
|
priv_key = keys['priv_key']
|
||||||
|
|
||||||
|
|
||||||
|
trex = Bittrex(api_key, priv_key, api_version=API_V2_0)
|
||||||
|
def marketcheck(ticker):
|
||||||
|
markets = trex.get_ticker(ticker)
|
||||||
|
price = markets['result']['Ask']
|
||||||
|
print(markets['result'])
|
||||||
|
print(price)
|
||||||
|
return price
|
||||||
|
|
||||||
|
marketcheck('BTC-LTC')
|
||||||
|
|
||||||
|
|
||||||
|
#def open_buy():
|
||||||
|
# trex.buy_limit(ticker, amount, price)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue