init
This commit is contained in:
@@ -37,19 +37,6 @@ class HTS_etf(HTS):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def connect2StockDB(self):
|
|
||||||
|
|
||||||
self.conn_stock = sqlite3.connect(os.path.join(self.RESOURCE_PATH, "resources/stock.db"))
|
|
||||||
self.cursor_stock = self.conn_stock.cursor()
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
def disconnectStockDB(self):
|
|
||||||
|
|
||||||
self.cursor_stock.close()
|
|
||||||
self.conn_stock.close()
|
|
||||||
return
|
|
||||||
|
|
||||||
def sellStocks(self, stock_code=None, bs_sell_price=None):
|
def sellStocks(self, stock_code=None, bs_sell_price=None):
|
||||||
check = False
|
check = False
|
||||||
jangoDic = self.requstJango()
|
jangoDic = self.requstJango()
|
||||||
@@ -211,7 +198,6 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
hts = HTS_etf(RESOURCE_PATH)
|
hts = HTS_etf(RESOURCE_PATH)
|
||||||
hts.connect2DB("hts.db")
|
hts.connect2DB("hts.db")
|
||||||
hts.connect2StockDB()
|
|
||||||
|
|
||||||
today_str = today.strftime('%Y%m%d')
|
today_str = today.strftime('%Y%m%d')
|
||||||
hts.buyRealTime(today_str, stock_code, analyzed_day=1000)
|
hts.buyRealTime(today_str, stock_code, analyzed_day=1000)
|
||||||
@@ -219,6 +205,5 @@ if __name__ == "__main__":
|
|||||||
db_filename = os.path.join(RESOURCE_PATH, "hts.db")
|
db_filename = os.path.join(RESOURCE_PATH, "hts.db")
|
||||||
hts.insertStockData(stock_code, today)
|
hts.insertStockData(stock_code, today)
|
||||||
|
|
||||||
hts.disconnectStockDB()
|
|
||||||
hts.disconnect()
|
hts.disconnect()
|
||||||
print("done...")
|
print("done...")
|
||||||
@@ -37,18 +37,6 @@ class HTS_etf(HTS):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def connect2StockDB(self):
|
|
||||||
|
|
||||||
self.conn_stock = sqlite3.connect(os.path.join(self.RESOURCE_PATH, "resources/stock.db"))
|
|
||||||
self.cursor_stock = self.conn_stock.cursor()
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
def disconnectStockDB(self):
|
|
||||||
|
|
||||||
self.cursor_stock.close()
|
|
||||||
self.conn_stock.close()
|
|
||||||
return
|
|
||||||
|
|
||||||
def sellStocks(self, stock_code=None, bs_sell_price=None):
|
def sellStocks(self, stock_code=None, bs_sell_price=None):
|
||||||
check = False
|
check = False
|
||||||
@@ -211,7 +199,6 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
hts = HTS_etf(RESOURCE_PATH)
|
hts = HTS_etf(RESOURCE_PATH)
|
||||||
hts.connect2DB("hts.db")
|
hts.connect2DB("hts.db")
|
||||||
hts.connect2StockDB()
|
|
||||||
|
|
||||||
today_str = today.strftime('%Y%m%d')
|
today_str = today.strftime('%Y%m%d')
|
||||||
hts.buyRealTime(today_str, stock_code, analyzed_day=1000)
|
hts.buyRealTime(today_str, stock_code, analyzed_day=1000)
|
||||||
@@ -219,6 +206,5 @@ if __name__ == "__main__":
|
|||||||
db_filename = os.path.join(RESOURCE_PATH, "hts.db")
|
db_filename = os.path.join(RESOURCE_PATH, "hts.db")
|
||||||
hts.insertStockData(stock_code, today)
|
hts.insertStockData(stock_code, today)
|
||||||
|
|
||||||
hts.disconnectStockDB()
|
|
||||||
hts.disconnect()
|
hts.disconnect()
|
||||||
print("done...")
|
print("done...")
|
||||||
Reference in New Issue
Block a user