Spaces:
Running
Running
Add 3 files
Browse files- README.md +7 -5
- index.html +257 -18
- prompts.txt +0 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: trading-insight
|
| 3 |
+
emoji: ⚛️
|
| 4 |
+
colorFrom: red
|
| 5 |
+
colorTo: gray
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- QwenSite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,258 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Interactive Trading Application</title>
|
| 7 |
+
<link rel="stylesheet" href="styles.css">
|
| 8 |
+
<script src="https://s3.tradingview.com/tv.js"></script>
|
| 9 |
+
</head>
|
| 10 |
+
<body>
|
| 11 |
+
|
| 12 |
+
<h1>Commodity Trading Dashboard</h1>
|
| 13 |
+
|
| 14 |
+
<div>
|
| 15 |
+
<label for="commodity">Select Commodity:</label>
|
| 16 |
+
<select id="commodity" onchange="updateChart()">
|
| 17 |
+
<option value="OANDA:WTICOUSD">Oil</option>
|
| 18 |
+
<option value="OANDA:XAGUSD">Silver</option>
|
| 19 |
+
<option value="OANDA:XAUUSD">Gold</option>
|
| 20 |
+
</select>
|
| 21 |
+
</div>
|
| 22 |
+
|
| 23 |
+
<div>
|
| 24 |
+
<label for="timeframe">Select Timeframe:</label>
|
| 25 |
+
<select id="timeframe" onchange="updateChart()">
|
| 26 |
+
<option value="1">1 Minute</option>
|
| 27 |
+
<option value="5">5 Minutes</option>
|
| 28 |
+
<option value="15">15 Minutes</option>
|
| 29 |
+
<option value="60">1 Hour</option>
|
| 30 |
+
<option value="240">4 Hours</option>
|
| 31 |
+
<option value="D">1 Day</option>
|
| 32 |
+
</select>
|
| 33 |
+
</div>
|
| 34 |
+
|
| 35 |
+
<div id="tradingview-chart"></div>
|
| 36 |
+
|
| 37 |
+
<h2>Indicators</h2>
|
| 38 |
+
<ul>
|
| 39 |
+
<li>RSI: <span id="rsi-value">Loading...</span></li>
|
| 40 |
+
<li>MACD: <span id="macd-value">Loading...</span></li>
|
| 41 |
+
<li>Stochastic: <span id="stochastic-value">Loading...</span></li>
|
| 42 |
+
<li>Awesome Oscillator: <span id="ao-value">Loading...</span></li>
|
| 43 |
+
<li>Momentum: <span id="momentum-value">Loading...</span></li>
|
| 44 |
+
</ul>
|
| 45 |
+
|
| 46 |
+
<h2>Recommendations</h2>
|
| 47 |
+
<div id="recommendations">
|
| 48 |
+
<p>RSI Recommendation: <span id="rsi-recommendation">Loading...</span></p>
|
| 49 |
+
<p>MACD Recommendation: <span id="macd-recommendation">Loading...</span></p>
|
| 50 |
+
<p>Stochastic Recommendation: <span id="stochastic-recommendation">Loading...</span></p>
|
| 51 |
+
<p>Awesome Oscillator Recommendation: <span id="ao-recommendation">Loading...</span></p>
|
| 52 |
+
<p>Momentum Recommendation: <span id="momentum-recommendation">Loading...</span></p>
|
| 53 |
+
</div>
|
| 54 |
+
|
| 55 |
+
<h2>Sentiment Analysis</h2>
|
| 56 |
+
<div id="sentiment-analysis">
|
| 57 |
+
<p>Retail Position Recommendation: <span id="retail-recommendation">Loading...</span></p>
|
| 58 |
+
<p>Market Maker Data: <span id="market-maker-data">Loading...</span></p>
|
| 59 |
+
</div>
|
| 60 |
+
|
| 61 |
+
<h2>Upcoming Economic Calendar</h2>
|
| 62 |
+
<div id="economic-calendar">
|
| 63 |
+
<table>
|
| 64 |
+
<thead>
|
| 65 |
+
<tr>
|
| 66 |
+
<th>Date</th>
|
| 67 |
+
<th>Event</th>
|
| 68 |
+
<th>Impact</th>
|
| 69 |
+
<th>Actual</th>
|
| 70 |
+
<th>Forecast</th>
|
| 71 |
+
</tr>
|
| 72 |
+
</thead>
|
| 73 |
+
<tbody id="calendar-body">
|
| 74 |
+
<tr>
|
| 75 |
+
<td colspan="5">Loading...</td>
|
| 76 |
+
</tr>
|
| 77 |
+
</tbody>
|
| 78 |
+
</table>
|
| 79 |
+
</div>
|
| 80 |
+
|
| 81 |
+
<script>
|
| 82 |
+
function updateChart() {
|
| 83 |
+
const commodity = document.getElementById("commodity").value;
|
| 84 |
+
const timeframe = document.getElementById("timeframe").value;
|
| 85 |
+
|
| 86 |
+
new TradingView.widget({
|
| 87 |
+
"container_id": "tradingview-chart",
|
| 88 |
+
"width": 980,
|
| 89 |
+
"height": 610,
|
| 90 |
+
"symbol": commodity,
|
| 91 |
+
"interval": timeframe,
|
| 92 |
+
"timezone": "Etc/UTC",
|
| 93 |
+
"theme": "light",
|
| 94 |
+
"style": "1",
|
| 95 |
+
"locale": "en",
|
| 96 |
+
"toolbar_bg": "#f1f3f6",
|
| 97 |
+
"enable_publishing": false,
|
| 98 |
+
"allow_symbol_change": true,
|
| 99 |
+
"details": true,
|
| 100 |
+
"hotlist": true,
|
| 101 |
+
"calendar": true,
|
| 102 |
+
"news": ["headlines"],
|
| 103 |
+
"studies": ["RSI", "MACD", "Stochastic", "AwesomeOscillator", "Momentum"]
|
| 104 |
+
});
|
| 105 |
+
|
| 106 |
+
// Fetch and display indicators and sentiment analysis
|
| 107 |
+
fetchIndicatorsAndSentiment(commodity, timeframe);
|
| 108 |
+
fetchEconomicCalendar();
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
function fetchIndicatorsAndSentiment(commodity, timeframe) {
|
| 112 |
+
// Placeholder for fetching indicator values and sentiment analysis
|
| 113 |
+
// Replace with actual API calls to fetch data from CTO and CFCT
|
| 114 |
+
|
| 115 |
+
// Simulated API response based on timeframe
|
| 116 |
+
const indicators = getIndicatorsBasedOnTimeframe(timeframe);
|
| 117 |
+
|
| 118 |
+
const sentiment = {
|
| 119 |
+
retailRecommendation: Math.random() > 0.5 ? "Bullish" : "Bearish",
|
| 120 |
+
marketMakerData: Math.random() > 0.5 ? "Long" : "Short"
|
| 121 |
+
};
|
| 122 |
+
|
| 123 |
+
// Update the UI with fetched data
|
| 124 |
+
document.getElementById("rsi-value").innerText = indicators.rsi.toFixed(2);
|
| 125 |
+
document.getElementById("macd-value").innerText = indicators.macd.toFixed(2);
|
| 126 |
+
document.getElementById("stochastic-value").innerText = indicators.stochastic.toFixed(2);
|
| 127 |
+
document.getElementById("ao-value").innerText = indicators.ao.toFixed(2);
|
| 128 |
+
document.getElementById("momentum-value").innerText = indicators.momentum.toFixed(2);
|
| 129 |
+
|
| 130 |
+
// Generate recommendations based on indicator values
|
| 131 |
+
document.getElementById("rsi-recommendation").innerText = getRSIRecommendation(indicators.rsi);
|
| 132 |
+
document.getElementById("macd-recommendation").innerText = getMACDRecommendation(indicators.macd);
|
| 133 |
+
document.getElementById("stochastic-recommendation").innerText = getStochasticRecommendation(indicators.stochastic);
|
| 134 |
+
document.getElementById("ao-recommendation").innerText = getAORecommendation(indicators.ao);
|
| 135 |
+
document.getElementById("momentum-recommendation").innerText = getMomentumRecommendation(indicators.momentum);
|
| 136 |
+
|
| 137 |
+
// Update sentiment analysis
|
| 138 |
+
document.getElementById("retail-recommendation").innerText = sentiment.retailRecommendation;
|
| 139 |
+
document.getElementById("market-maker-data").innerText = sentiment.marketMakerData;
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
function fetchEconomicCalendar() {
|
| 143 |
+
// Placeholder for fetching economic calendar data
|
| 144 |
+
// Replace with actual API call to fetch economic events
|
| 145 |
+
|
| 146 |
+
const events = [
|
| 147 |
+
{ date: "2025-06-01", event: "Manufacturing PMI", impact: "High", actual: "N/A", forecast: "52.5" },
|
| 148 |
+
{ date: "2025-06-03", event: "Non-Farm Payrolls", impact: "High", actual: "N/A", forecast: "200K" },
|
| 149 |
+
{ date: "2025-06-04", event: "Crude Oil Inventories", impact: "Medium", actual: "N/A", forecast: "N/A" },
|
| 150 |
+
{ date: "2025-06-05", event: "Interest Rate Decision", impact: "High", actual: "N/A", forecast: "2.00%" },
|
| 151 |
+
{ date: "2025-06-06", event: "Unemployment Rate", impact: "High", actual: "N/A", forecast: "4.0%" },
|
| 152 |
+
{ date: "2025-06-10", event: "Consumer Price Index (CPI)", impact: "High", actual: "N/A", forecast: "3.2%" },
|
| 153 |
+
{ date: "2025-06-12", event: "Retail Sales", impact: "Medium", actual: "N/A", forecast: "0.5%" },
|
| 154 |
+
{ date: "2025-06-14", event: "Federal Reserve Meeting Minutes", impact: "Medium", actual: "N/A", forecast: "N/A" }
|
| 155 |
+
];
|
| 156 |
+
|
| 157 |
+
const calendarBody = document.getElementById("calendar-body");
|
| 158 |
+
calendarBody.innerHTML = ""; // Clear previous data
|
| 159 |
+
|
| 160 |
+
// Display events in the calendar
|
| 161 |
+
events.forEach(event => {
|
| 162 |
+
const row = document.createElement("tr");
|
| 163 |
+
row.innerHTML = `
|
| 164 |
+
<td>${event.date}</td>
|
| 165 |
+
<td>${event.event}</td>
|
| 166 |
+
<td>${event.impact}</td>
|
| 167 |
+
<td>${event.actual}</td>
|
| 168 |
+
<td>${event.forecast}</td>
|
| 169 |
+
`;
|
| 170 |
+
calendarBody.appendChild(row);
|
| 171 |
+
});
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
function getIndicatorsBasedOnTimeframe(timeframe) {
|
| 175 |
+
// Simulated indicator values based on the selected timeframe
|
| 176 |
+
const baseValues = {
|
| 177 |
+
rsi: Math.random() * 100,
|
| 178 |
+
macd: Math.random() * 2 - 1,
|
| 179 |
+
stochastic: Math.random() * 100,
|
| 180 |
+
ao: Math.random() * 2 - 1,
|
| 181 |
+
momentum: Math.random() * 100
|
| 182 |
+
};
|
| 183 |
+
|
| 184 |
+
// Adjust values based on timeframe (this is just an example)
|
| 185 |
+
switch (timeframe) {
|
| 186 |
+
case "1":
|
| 187 |
+
baseValues.rsi += 5; // Simulate higher volatility for 1 min
|
| 188 |
+
break;
|
| 189 |
+
case "5":
|
| 190 |
+
baseValues.macd += 0.1; // Slightly adjust MACD for 5 min
|
| 191 |
+
break;
|
| 192 |
+
case "15":
|
| 193 |
+
baseValues.stochastic += 10; // Adjust Stochastic for 15 min
|
| 194 |
+
break;
|
| 195 |
+
case "60":
|
| 196 |
+
baseValues.ao += 0.5; // Adjust AO for 1 hour
|
| 197 |
+
break;
|
| 198 |
+
case "240":
|
| 199 |
+
baseValues.momentum += 15; // Adjust Momentum for 4 hours
|
| 200 |
+
break;
|
| 201 |
+
case "D":
|
| 202 |
+
baseValues.rsi -= 10; // Adjust RSI for daily
|
| 203 |
+
break;
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
return baseValues;
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
function getRSIRecommendation(rsi) {
|
| 210 |
+
if (rsi < 30) {
|
| 211 |
+
return "Buy (Oversold)";
|
| 212 |
+
} else if (rsi > 70) {
|
| 213 |
+
return "Sell (Overbought)";
|
| 214 |
+
} else {
|
| 215 |
+
return "Hold";
|
| 216 |
+
}
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
function getMACDRecommendation(macd) {
|
| 220 |
+
if (macd > 0) {
|
| 221 |
+
return "Buy";
|
| 222 |
+
} else {
|
| 223 |
+
return "Sell";
|
| 224 |
+
}
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
function getStochasticRecommendation(stochastic) {
|
| 228 |
+
if (stochastic < 20) {
|
| 229 |
+
return "Buy (Oversold)";
|
| 230 |
+
} else if (stochastic > 80) {
|
| 231 |
+
return "Sell (Overbought)";
|
| 232 |
+
} else {
|
| 233 |
+
return "Hold";
|
| 234 |
+
}
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
function getAORecommendation(ao) {
|
| 238 |
+
if (ao > 0) {
|
| 239 |
+
return "Buy";
|
| 240 |
+
} else {
|
| 241 |
+
return "Sell";
|
| 242 |
+
}
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
function getMomentumRecommendation(momentum) {
|
| 246 |
+
if (momentum > 0) {
|
| 247 |
+
return "Buy";
|
| 248 |
+
} else {
|
| 249 |
+
return "Sell";
|
| 250 |
+
}
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
// Initialize the chart on page load
|
| 254 |
+
window.onload = updateChart;
|
| 255 |
+
</script>
|
| 256 |
+
|
| 257 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-qwensite.hf.space/logo.svg" alt="qwensite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-qwensite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >QwenSite</a> - 🧬 <a href="https://enzostvs-qwensite.hf.space?remix=alterzick/trading-insight" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 258 |
</html>
|
prompts.txt
ADDED
|
File without changes
|