|
|
|
@ -415,6 +415,10 @@ def custom_post(): |
|
|
|
else: |
|
|
|
else: |
|
|
|
flash('使用投組功能請先登入。', 'warning') |
|
|
|
flash('使用投組功能請先登入。', 'warning') |
|
|
|
return redirect(url_for('login')) |
|
|
|
return redirect(url_for('login')) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Ensure plotly backend is set |
|
|
|
|
|
|
|
pd.options.plotting.backend = "plotly" |
|
|
|
|
|
|
|
|
|
|
|
port = pd.read_csv(request.files['csv_file'], index_col=0, parse_dates=True) |
|
|
|
port = pd.read_csv(request.files['csv_file'], index_col=0, parse_dates=True) |
|
|
|
role = request.form.get('role') |
|
|
|
role = request.form.get('role') |
|
|
|
lookback = int(request.form.get('lookback')) |
|
|
|
lookback = int(request.form.get('lookback')) |
|
|
|
@ -538,6 +542,10 @@ def result_view(): |
|
|
|
else: |
|
|
|
else: |
|
|
|
sid = request.args.get('strategy_id') |
|
|
|
sid = request.args.get('strategy_id') |
|
|
|
strategy_id = request.args.get('strategy_id') |
|
|
|
strategy_id = request.args.get('strategy_id') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Ensure plotly backend is set (fixes Railway deployment issue) |
|
|
|
|
|
|
|
pd.options.plotting.backend = "plotly" |
|
|
|
|
|
|
|
|
|
|
|
sql="""select * from strategy where id=%s;""" |
|
|
|
sql="""select * from strategy where id=%s;""" |
|
|
|
conn = psycopg2.connect(**SQL_CONFIG) |
|
|
|
conn = psycopg2.connect(**SQL_CONFIG) |
|
|
|
with conn: |
|
|
|
with conn: |
|
|
|
|