A newer version of the Gradio SDK is available: 6.22.0
title: XAUUSD Signal Dashboard
emoji: 🪙
colorFrom: yellow
colorTo: red
sdk: gradio
sdk_version: 4.44.1
app_file: app.py
pinned: false
XAUUSD Signal Dashboard (Educational)
Signal-only viewer for XAUUSD using a pre-trained PPO reinforcement-learning model (JonusNattapong/Reinforcement-Learning-for-Gold-Trading-Model).
This app does not place any trades. It shows what the model would recommend (BUY / SELL / HOLD) with SL/TP levels, for you to review and execute manually on your own MT5 demo account.
Important: timeframe
The underlying model was trained only on 15-minute XAUUSD bars. This app
fetches native 15-minute data from TwelveData to match that exactly — do not
change INTERVAL in app.py to another timeframe, or predictions become
statistically meaningless (the model has never seen that data distribution).
Setup
- Create a new Space on Hugging Face → SDK: Gradio.
- Upload
app.py,requirements.txt, and thisREADME.md. - Go to Settings → Variables and secrets and add a secret:
TWELVEDATA_API_KEY= your TwelveData API key
- The Space will build automatically. First load may take ~30s while the PPO model and normalization stats download from the Hub (cached after that).
How it works
- Fetch the latest ~200 bars of XAU/USD at 15min interval from TwelveData.
- Compute the exact 9 features the model was trained on (log return, ATR, RSI, EMA diff, rolling volatility, time-of-day sin/cos).
- Build the 13-dim observation (9 features + a flat/no-position state — this app always asks "starting flat right now, what would the model do?").
- Normalize using the published
vecnormalize.pklstats and run the PPO policy to get an action + confidence. - Convert the model's ATR feature back into price terms to draw SL (1R) and TP1/TP2/TP3 (1.5R / 3R / 5.3R) levels on the chart.
Disclaimer
Educational analysis only — not financial advice. The referenced model's published backtest metrics (Sharpe 7.56, 69% win rate) are self-reported by the original author and unusually high; treat them with skepticism and only use this on a demo account. Trading involves risk of loss.