Example #1
0
fax_price = 10
one_year = 3600 * 24 * 365
buy_order_cny_limit = 1000
sell_order_cts_limit = 1000

##################### start ############################

account = client.Account(account_name, password, wallet_port)
account.unlock()

cny_settlement_price = 0
buy_price_standard = 0
sell_price_standard = 0

order_book = market.get_order_book('CNY', 'CTS', limit_order, wallet_port)
#print(order_book)
cny_settlement_price = market.get_cny_settlement_price(wallet_port)
#print("目前喂价:",cny_settlement_price)
#######maybe not used,but keep it#####
if order_book['bids'] == [] and order_book['asks'] == []:
    cny_settlement_price = market.get_cny_settlement_price(wallet_port)
    buy_price_standard = cny_settlement_price * 0.99
    sell_price_standard = cny_settlement_price * 1.01

elif order_book['bids'] and order_book['asks'] == []:
    buy_price_standard = float(order_book['bids'][0]['price'])
    sell_price_standard = buy_price_standard * 1.01

elif order_book['bids'] == [] and order_book['asks']:
    sell_price_standard = float(order_book['asks'][0]['price'])
Example #2
0
limit_order ='10'
sell_order_step_precision =  [1.01, 1.03, 1.05, 1.07, 1.09]
buy_order_step_precision =   [0.99, 0.97, 0.95, 0.93, 0.91]

##################### start ############################

account = client.Account(account_name, password, wallet_port)
account.unlock()


cny_settlement_price = 0
buy_price_standard = 0
sell_price_standard = 0


order_book = market.get_order_book('CNY', 'CTS', 10, wallet_port)
#print(order_book)
cny_settlement_price = market.get_cny_settlement_price(wallet_port)
print(cny_settlement_price)

if order_book['bids'] == [] and order_book['asks'] == []:
	cny_settlement_price = market.get_cny_settlement_price(wallet_port)
	buy_price_standard = cny_settlement_price * 0.99
	sell_price_standard = cny_settlement_price * 1.01

elif order_book['bids'] and order_book['asks'] == []:
	buy_price_standard = float(order_book['bids'][0]['price'])
	sell_price_standard = buy_price_standard * 1.01

elif order_book['bids'] == [] and order_book['asks']:
	sell_price_standard = float(order_book['asks'][0]['price'])