init
This commit is contained in:
@@ -352,23 +352,32 @@ class BuySellChecker:
|
||||
else:
|
||||
buy, buy_weight = self.getBuyPriceAndWeight_122630(last_index, data)
|
||||
sell, sell_weight = self.getSellPriceAndWeight(last_index, data)
|
||||
if data.index[last_index].strftime('%H:%M:%S') > datetime.strptime(datetime.today().strftime("%Y-%m-%d 15:10:00"), "%Y-%m-%d %H:%M:%S").strftime('%H:%M:%S'):
|
||||
buy, buy_weight = -1, -1
|
||||
|
||||
if sell > 0 and 'last_buy' in bsLine[stock_code]:
|
||||
if bsLine[stock_code]['last'] == 'buy':
|
||||
if sell - bsLine[stock_code]['last_buy'] < 0.007:
|
||||
sell, weight = -1, -1
|
||||
if sell > 0:
|
||||
if 'last_buy' in bsLine[stock_code]:
|
||||
if bsLine[stock_code]['last'] == 'buy':
|
||||
if sell - bsLine[stock_code]['last_buy'] < 0.007:
|
||||
sell, weight = -1, -1
|
||||
else:
|
||||
sell, weight = -1, -1
|
||||
if 'last' in bsLine[stock_code] and bsLine[stock_code]['last'] != 'buy':
|
||||
sell, weight = -1, -1
|
||||
|
||||
bsLine[stock_code]['buy'] = [buy]
|
||||
bsLine[stock_code]['buy_weight'] = [buy_weight]
|
||||
bsLine[stock_code]['sell'] = [sell]
|
||||
bsLine[stock_code]['sell_weight'] = [sell_weight]
|
||||
bsLine[stock_code]['buy'][last_index] = buy
|
||||
bsLine[stock_code]['buy_weight'][last_index] = buy_weight
|
||||
bsLine[stock_code]['sell'][last_index] = sell
|
||||
bsLine[stock_code]['sell_weight'][last_index] = sell_weight
|
||||
|
||||
if buy > 0:
|
||||
bsLine[stock_code]['last'] = 'buy'
|
||||
bsLine[stock_code]['last_buy'] = buy
|
||||
bsLine[stock_code]['buy_count'] += 1
|
||||
if sell > 0:
|
||||
bsLine[stock_code]['last'] = 'sell'
|
||||
bsLine[stock_code]['last_buy'] = -1
|
||||
bsLine[stock_code]['buy_count'] = 0
|
||||
|
||||
else:
|
||||
# Type=False, 시뮬레이션 적용
|
||||
@@ -399,11 +408,6 @@ class BuySellChecker:
|
||||
sell, weight = -1, -1
|
||||
if 'last' in bsLine[stock_code] and bsLine[stock_code]['last'] != 'buy':
|
||||
sell, weight = -1, -1
|
||||
#if data.index[last_index].strftime('%H:%M:%S') > datetime.strptime(datetime.today().strftime("%Y-%m-%d 15:10:00"), "%Y-%m-%d %H:%M:%S").strftime('%H:%M:%S'):
|
||||
# if 'last' in bsLine[stock_code] and bsLine[stock_code]['last'] == 'buy':
|
||||
# sell, weight = data['close'][last_index], -1
|
||||
# bsLine[stock_code]['last'] = ''
|
||||
# bsLine[stock_code]['last_buy'] = -1
|
||||
|
||||
bsLine[stock_code]['buy'][last_index] = buy
|
||||
bsLine[stock_code]['buy_weight'][last_index] = buy_weight
|
||||
|
||||
Reference in New Issue
Block a user