@author: 躺着也挣钱
QQ群 :  422922984

"""

import pandas as pd
from fcoin3 import Fcoin
from datetime import datetime
#if python3 use
#from fcoin import Fcoin

fcoin = Fcoin()
fcoin.auth('key ', 'secret')

#取K线数据

ft_usdt = fcoin.get_candle('M3', 'ftusdt')  #M3 = 分钟线,   取150条数据

# 取得当前账户信息
print(fcoin.get_balance())

#
print(fcoin.get_symbols())

print(fcoin.get_currencies())

#
#print(fcoin.buy('fteth', 0.0001, 10))
#
Beispiel #2
0
with open("quz.json", 'r') as load_f:
    load_dict = json.load(load_f)
    print(load_dict)
api_key = load_dict['api_key']
secret_key = load_dict['secret_key']
buy_depth = load_dict['buy_depth']
sell_depth = load_dict['sell_depth']
symbol = load_dict['symbol']
fcoin = Fcoin()
fcoin.auth(api_key, secret_key)
base_currency = ""
quote_currency = ""
price_decimal = 0
amount_decimal = 0

symbols = fcoin.get_symbols()
print(symbol)
for s in symbols:
    if s['name'] == symbol:
        base_currency = s['base_currency']
        quote_currency = s['quote_currency']
        price_decimal = s['price_decimal']
        amount_decimal = s['amount_decimal']
        break
min_price_diff = Decimal(pow(10, -price_decimal))


def get_tikcer(symbol):
    return fcoin.get_market_ticker(symbol)['data']['ticker']