디지털 화폐 투입

저자:발목2017-09-07 07:33:17
태그:파이썬무역 지원

디지털 화폐의 일반적인 투자 전략, 여러 거래소에서 동시에 투자하는 것을 지원합니다.

파라미터 설명

orderAmount #결정 예금금 BTCCNY 및 BCCCNY 단위 CNY, BCCBTC 단위 BTC 등

#계정금리 #계정금리 #계정금리 #계정금리 #계정금리

orderTimeInterval # 고정 투기 간격, 단위 초, 분당=60 시간당=3600 일일간=86400 주간=604800

maxBidPrice # 최대 거래 가격, 다음 거래 기회가 나올 때까지 가격을 넘어서기


def onTick():
	
	exchange_count = len(exchanges)
	for i in range(exchange_count):
		account = exchanges[i].GetAccount()

		marketName = exchanges[i].GetName()
		depth = exchanges[i].GetDepth()
		Log("Market ",marketName,exchanges[i].GetCurrency(),"Account Balance [",account["Balance"],"] Stocks[",account["Stocks"],"]")
		if account and depth and account["Balance"] > accountLimitMoney :
			bidPrice = depth["Asks"][0]["Price"] 
			if bidPrice <  maxBidPrice :
				amount = orderAmount
				if amount <= account["Balance"]:
					exchanges[i].Buy(amount)
				else:
					Log("Account Balance is less than bid Amount")
			else:
				Log("Bid Price >= maxBidPrice, not process")
		else:
			Log("Account Balance <= accountLimitMoney")
def main() :
	while 1:
		
		onTick()
		time.sleep(orderTimeInterval)

관련

더 많은