更新数据之后马上开始计算指标
This commit is contained in:
@@ -53,7 +53,7 @@ def get_index_recent_date(code: str, limit: int = None) -> pd.DataFrame:
|
||||
return df
|
||||
|
||||
|
||||
def main():
|
||||
def main_calc_process():
|
||||
if datetime.today().weekday() >= 5:
|
||||
logger.info(f"非交易日")
|
||||
return
|
||||
@@ -111,9 +111,10 @@ def main():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
...
|
||||
# main()
|
||||
logger.info(datetime.now())
|
||||
schedule.every().day.at("19:00").do(main)
|
||||
while True:
|
||||
schedule.run_pending()
|
||||
time.sleep(1)
|
||||
# logger.info(datetime.now())
|
||||
# schedule.every().day.at("19:00").do(main)
|
||||
# while True:
|
||||
# schedule.run_pending()
|
||||
# time.sleep(1)
|
||||
|
||||
@@ -9,6 +9,7 @@ import time
|
||||
import traceback
|
||||
from dingtalk import DingTalkBot
|
||||
import os
|
||||
from signal_calc import main_calc_process
|
||||
|
||||
webhook = "https://oapi.dingtalk.com/robot/send?access_token=21de667159edadd33172c6ec414a2addf9c6359189350ffd36819d2a20e8a0f4"
|
||||
secret = "SEC43a0fa0b29717f98637a119b92a0bd5f7b2b6da671bdd2bd1279ed8323454d5e"
|
||||
@@ -95,6 +96,7 @@ def main():
|
||||
if len(res) == 0:
|
||||
res = db_manager.insert_dataframe(df, "index_kline")
|
||||
logger.info(res)
|
||||
main_calc_process()
|
||||
except Exception as e:
|
||||
error_message = f"{e}\n{traceback.format_exc()}"
|
||||
logger.error(error_message)
|
||||
|
||||
Reference in New Issue
Block a user