This commit is contained in:
dsyoon
2023-01-26 23:15:43 +09:00
parent 7dbda5d0a1
commit 3a297967e2

View File

@@ -17,7 +17,6 @@ from sklearn.preprocessing import StandardScaler, MinMaxScaler
from stock.analysis.AnalyzerSqlite import AnalyzerSqlite
from hts.BuySellChecker import BuySellChecker
from hts.HTS import HTS
from bithumb.Bithumb_daily import Bithumb_daily
class Bithumb_minute(HTS):
@@ -27,6 +26,7 @@ class Bithumb_minute(HTS):
bithumb = None
binance = None
TODAY = None
MAX_BUY_PRICE = None
def __init__(self, RESOURCE_PATH, today):
super().__init__(RESOURCE_PATH)
@@ -42,7 +42,7 @@ class Bithumb_minute(HTS):
self.bithumb = pybithumb.Bithumb(con_key, sec_key)
self.binance = ccxt.binance()
self.TODAY = today
self.MAX_BUY_PRICE = 8000
return
def bull_market(self, df, ticker):
@@ -626,7 +626,8 @@ class Bithumb_minute(HTS):
if max(bsLine['buy'][len(bsLine['buy']) - 2:]) > 100:
tmp = self.bithumb.get_balance(ticker)
balance = tmp[2]
count = round((balance * (bsLine['buy_weight'][len(bsLine['buy_weight']) - 1] / 100)) / bsLine['buy'][len(bsLine['buy']) - 1], 2)
#count = round((balance * (bsLine['buy_weight'][len(bsLine['buy_weight']) - 1] / 100)) / bsLine['buy'][len(bsLine['buy']) - 1], 2)
count = round(self.MAX_BUY_PRICE / bsLine['buy_weight'][len(bsLine['buy_weight']) - 1], 2)
order = self.bithumb.buy_limit_order(ticker, bsLine['buy'][len(bsLine['buy']) - 1], count)
# order: ('bid', 'BTC', 'C0101000000322993432', 'KRW')
if len(stock1['close']) > 0: