Update app.py
Browse files
app.py
CHANGED
@@ -43,7 +43,7 @@ def run_crypto_analysis(symbols, interval):
|
|
43 |
combined_data = combined_data.reset_index()
|
44 |
combined_data = combined_data[['Date', 'Symbol', 'Close', 'Signal_1x', 'Signal_2x', 'Signal_3x', 'VuManchu_Signal']]
|
45 |
combined_data['Date'] = combined_data['Date'].dt.date
|
46 |
-
|
47 |
|
48 |
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
49 |
output_file = f"output/all_crypto_signals_{interval}_{timestamp}.csv"
|
@@ -82,9 +82,9 @@ def run_asset_analysis(symbols, interval):
|
|
82 |
if all_data:
|
83 |
combined_data = pd.concat(all_data)
|
84 |
combined_data = combined_data.reset_index()
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
|
89 |
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
90 |
output_file = f"output/all_stocks_signals_{interval}_{timestamp}.csv"
|
@@ -109,8 +109,6 @@ def filter_latest_signals(df, signal_column, interval):
|
|
109 |
start_date = today - timedelta(days=15) # Last week for daily interval
|
110 |
elif interval == '1wk':
|
111 |
start_date = today - timedelta(days=60) # Last month for weekly interval
|
112 |
-
elif interval == '1h':
|
113 |
-
start_date = today - timedelta(days=5) # Last week for weekly interval
|
114 |
else:
|
115 |
start_date = today - timedelta(days=15) # Default to last week
|
116 |
|
@@ -189,7 +187,7 @@ with gr.Blocks() as iface:
|
|
189 |
with gr.Row():
|
190 |
analysis_type = gr.Radio(["Cryptocurrency", "Asset"], label="Select Analysis Type")
|
191 |
symbols = gr.Textbox(label="Enter symbols (comma-separated) or leave blank for default", placeholder="e.g., BTC,ETH,ADA or AAPL,MSFT,GOOGL")
|
192 |
-
interval = gr.Radio(["
|
193 |
|
194 |
with gr.Row():
|
195 |
signal_filter = gr.Dropdown(["All", "Signal_1x", "Signal_2x", "Signal_3x", "VuManchu_Signal"], label="Filter by Signal", value="All")
|
|
|
43 |
combined_data = combined_data.reset_index()
|
44 |
combined_data = combined_data[['Date', 'Symbol', 'Close', 'Signal_1x', 'Signal_2x', 'Signal_3x', 'VuManchu_Signal']]
|
45 |
combined_data['Date'] = combined_data['Date'].dt.date
|
46 |
+
combined_data = combined_data.sort_values('Date', ascending=False) # Sort by date in descending order
|
47 |
|
48 |
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
49 |
output_file = f"output/all_crypto_signals_{interval}_{timestamp}.csv"
|
|
|
82 |
if all_data:
|
83 |
combined_data = pd.concat(all_data)
|
84 |
combined_data = combined_data.reset_index()
|
85 |
+
combined_data = combined_data[['Date', 'Symbol', 'Close', 'Signal_1x', 'Signal_2x', 'Signal_3x', 'VuManchu_Signal']]
|
86 |
+
combined_data['Date'] = combined_data['Date'].dt.date
|
87 |
+
combined_data = combined_data.sort_values('Date', ascending=False) # Sort by date in descending order
|
88 |
|
89 |
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
90 |
output_file = f"output/all_stocks_signals_{interval}_{timestamp}.csv"
|
|
|
109 |
start_date = today - timedelta(days=15) # Last week for daily interval
|
110 |
elif interval == '1wk':
|
111 |
start_date = today - timedelta(days=60) # Last month for weekly interval
|
|
|
|
|
112 |
else:
|
113 |
start_date = today - timedelta(days=15) # Default to last week
|
114 |
|
|
|
187 |
with gr.Row():
|
188 |
analysis_type = gr.Radio(["Cryptocurrency", "Asset"], label="Select Analysis Type")
|
189 |
symbols = gr.Textbox(label="Enter symbols (comma-separated) or leave blank for default", placeholder="e.g., BTC,ETH,ADA or AAPL,MSFT,GOOGL")
|
190 |
+
interval = gr.Radio(["1d", "1wk"], label="Select Time Interval")
|
191 |
|
192 |
with gr.Row():
|
193 |
signal_filter = gr.Dropdown(["All", "Signal_1x", "Signal_2x", "Signal_3x", "VuManchu_Signal"], label="Filter by Signal", value="All")
|