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