Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -115,9 +115,8 @@ def create_ui():
|
|
| 115 |
with gr.Row():
|
| 116 |
gr.HTML("""
|
| 117 |
<div class="header">
|
| 118 |
-
<h1
|
| 119 |
<p>Advanced Technical Analysis & AI-Powered Predictions for Indonesian Stock Exchange</p>
|
| 120 |
-
<p><a href="https://huggingface.co/spaces/akhaliq/anycoder" style="color: white;">Built with anycoder</a></p>
|
| 121 |
</div>
|
| 122 |
""")
|
| 123 |
|
|
@@ -126,8 +125,8 @@ def create_ui():
|
|
| 126 |
# FIX: Change Dropdown to Textbox for flexible user input
|
| 127 |
stock_selector = gr.Textbox(
|
| 128 |
value="BBCA",
|
| 129 |
-
label="
|
| 130 |
-
info="Contoh: BBCA, ADRO, TLKM
|
| 131 |
)
|
| 132 |
|
| 133 |
with gr.Row():
|
|
@@ -136,10 +135,10 @@ def create_ui():
|
|
| 136 |
maximum=90,
|
| 137 |
value=30,
|
| 138 |
step=7,
|
| 139 |
-
label="
|
| 140 |
)
|
| 141 |
analyze_btn = gr.Button(
|
| 142 |
-
"
|
| 143 |
variant="primary",
|
| 144 |
size="lg"
|
| 145 |
)
|
|
@@ -148,7 +147,7 @@ def create_ui():
|
|
| 148 |
with gr.Tabs() as tabs:
|
| 149 |
|
| 150 |
# Tab 1: Stock Overview & Fundamentals
|
| 151 |
-
with gr.TabItem("
|
| 152 |
with gr.Row():
|
| 153 |
company_name = gr.Textbox(label="Company Name", interactive=False)
|
| 154 |
current_price = gr.Number(label="Current Price (IDR)", interactive=False)
|
|
@@ -160,13 +159,13 @@ def create_ui():
|
|
| 160 |
volume = gr.Number(label="Volume", interactive=False)
|
| 161 |
|
| 162 |
fundamentals_text = gr.Textbox(
|
| 163 |
-
label="
|
| 164 |
lines=8,
|
| 165 |
interactive=False
|
| 166 |
)
|
| 167 |
|
| 168 |
# Tab 2: Technical Analysis
|
| 169 |
-
with gr.TabItem("
|
| 170 |
price_chart = gr.Plot(label="Price & Technical Indicators")
|
| 171 |
technical_chart = gr.Plot(label="Technical Indicators Analysis")
|
| 172 |
|
|
@@ -176,7 +175,7 @@ def create_ui():
|
|
| 176 |
bb_position = gr.Textbox(label="Bollinger Band Position", interactive=False)
|
| 177 |
|
| 178 |
# Tab 3: Trading Signals
|
| 179 |
-
with gr.TabItem("
|
| 180 |
with gr.Row():
|
| 181 |
overall_signal = gr.Textbox(label="๐ฆ Overall Signal", interactive=False, scale=2)
|
| 182 |
signal_strength = gr.Slider(
|
|
@@ -187,7 +186,7 @@ def create_ui():
|
|
| 187 |
)
|
| 188 |
|
| 189 |
signals_text = gr.Textbox(
|
| 190 |
-
label="
|
| 191 |
lines=10,
|
| 192 |
interactive=False
|
| 193 |
)
|
|
@@ -198,7 +197,7 @@ def create_ui():
|
|
| 198 |
stop_loss = gr.Number(label="Recommended Stop Loss", interactive=False)
|
| 199 |
|
| 200 |
# Tab 4: AI Predictions
|
| 201 |
-
with gr.TabItem("
|
| 202 |
prediction_chart = gr.Plot(label="Price Forecast (Chronos-Bolt)")
|
| 203 |
|
| 204 |
with gr.Row():
|
|
@@ -207,7 +206,7 @@ def create_ui():
|
|
| 207 |
predicted_change = gr.Number(label="Expected Change (%)", interactive=False)
|
| 208 |
|
| 209 |
prediction_summary = gr.Textbox(
|
| 210 |
-
label="
|
| 211 |
lines=5,
|
| 212 |
interactive=False
|
| 213 |
)
|
|
|
|
| 115 |
with gr.Row():
|
| 116 |
gr.HTML("""
|
| 117 |
<div class="header">
|
| 118 |
+
<h1>IDX Stock Analysis & Prediction</h1>
|
| 119 |
<p>Advanced Technical Analysis & AI-Powered Predictions for Indonesian Stock Exchange</p>
|
|
|
|
| 120 |
</div>
|
| 121 |
""")
|
| 122 |
|
|
|
|
| 125 |
# FIX: Change Dropdown to Textbox for flexible user input
|
| 126 |
stock_selector = gr.Textbox(
|
| 127 |
value="BBCA",
|
| 128 |
+
label="Input Simbol Saham IDX",
|
| 129 |
+
info="Contoh: BBCA, ADRO, TLKM"
|
| 130 |
)
|
| 131 |
|
| 132 |
with gr.Row():
|
|
|
|
| 135 |
maximum=90,
|
| 136 |
value=30,
|
| 137 |
step=7,
|
| 138 |
+
label="Prediction Days"
|
| 139 |
)
|
| 140 |
analyze_btn = gr.Button(
|
| 141 |
+
"Analyze Stock",
|
| 142 |
variant="primary",
|
| 143 |
size="lg"
|
| 144 |
)
|
|
|
|
| 147 |
with gr.Tabs() as tabs:
|
| 148 |
|
| 149 |
# Tab 1: Stock Overview & Fundamentals
|
| 150 |
+
with gr.TabItem("Stock Overview"):
|
| 151 |
with gr.Row():
|
| 152 |
company_name = gr.Textbox(label="Company Name", interactive=False)
|
| 153 |
current_price = gr.Number(label="Current Price (IDR)", interactive=False)
|
|
|
|
| 159 |
volume = gr.Number(label="Volume", interactive=False)
|
| 160 |
|
| 161 |
fundamentals_text = gr.Textbox(
|
| 162 |
+
label="Company Information",
|
| 163 |
lines=8,
|
| 164 |
interactive=False
|
| 165 |
)
|
| 166 |
|
| 167 |
# Tab 2: Technical Analysis
|
| 168 |
+
with gr.TabItem("Technical Analysis"):
|
| 169 |
price_chart = gr.Plot(label="Price & Technical Indicators")
|
| 170 |
technical_chart = gr.Plot(label="Technical Indicators Analysis")
|
| 171 |
|
|
|
|
| 175 |
bb_position = gr.Textbox(label="Bollinger Band Position", interactive=False)
|
| 176 |
|
| 177 |
# Tab 3: Trading Signals
|
| 178 |
+
with gr.TabItem("Trading Signals"):
|
| 179 |
with gr.Row():
|
| 180 |
overall_signal = gr.Textbox(label="๐ฆ Overall Signal", interactive=False, scale=2)
|
| 181 |
signal_strength = gr.Slider(
|
|
|
|
| 186 |
)
|
| 187 |
|
| 188 |
signals_text = gr.Textbox(
|
| 189 |
+
label="Detailed Signals",
|
| 190 |
lines=10,
|
| 191 |
interactive=False
|
| 192 |
)
|
|
|
|
| 197 |
stop_loss = gr.Number(label="Recommended Stop Loss", interactive=False)
|
| 198 |
|
| 199 |
# Tab 4: AI Predictions
|
| 200 |
+
with gr.TabItem("AI Predictions"):
|
| 201 |
prediction_chart = gr.Plot(label="Price Forecast (Chronos-Bolt)")
|
| 202 |
|
| 203 |
with gr.Row():
|
|
|
|
| 206 |
predicted_change = gr.Number(label="Expected Change (%)", interactive=False)
|
| 207 |
|
| 208 |
prediction_summary = gr.Textbox(
|
| 209 |
+
label="Prediction Analysis",
|
| 210 |
lines=5,
|
| 211 |
interactive=False
|
| 212 |
)
|