移植 A_Share_DP 引擎;本地缓存与 60s tip;月线由日线 UTC 聚合;不碰主站 analyze/缠论叠层。 Co-authored-by: Cursor <cursoragent@cursor.com>
40 lines
1.0 KiB
Python
40 lines
1.0 KiB
Python
"""Flask 应用入口(瘦身 factory)。"""
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
import os
|
|
|
|
_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
if _ROOT not in sys.path:
|
|
sys.path.append(_ROOT)
|
|
|
|
from flask import Flask
|
|
|
|
from config import FLASK_HOST, FLASK_PORT
|
|
from api.analyze import bp as analyze_bp
|
|
from api.pages import bp as pages_bp
|
|
from api.symbols import bp as symbols_bp
|
|
from api.trend import bp as trend_bp
|
|
from api.wyckoff_crypto import bp as wyckoff_crypto_bp, ensure_scheduler
|
|
|
|
|
|
def create_app() -> Flask:
|
|
app = Flask(__name__)
|
|
app.register_blueprint(pages_bp)
|
|
app.register_blueprint(analyze_bp)
|
|
app.register_blueprint(symbols_bp)
|
|
app.register_blueprint(trend_bp)
|
|
app.register_blueprint(wyckoff_crypto_bp)
|
|
# Start crypto wyckoff tip scheduler (daemon); disable with CRYPTO_WYCKOFF_DISABLE=1
|
|
try:
|
|
ensure_scheduler()
|
|
except Exception:
|
|
pass
|
|
return app
|
|
|
|
|
|
app = create_app()
|
|
|
|
if __name__ == "__main__":
|
|
app.run(debug=True, host=FLASK_HOST, port=FLASK_PORT)
|