Skip to content

Commit aeeccd4

Browse files
committed
deleting the tracking files
1 parent d338914 commit aeeccd4

10 files changed

+709
-1848
lines changed

assets/css/main.css

+699-620
Large diffs are not rendered by default.

pages/graph_prediction.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
alphaCloses.reverse();
7878

7979
// Fetch LSTM prediction data
80-
const lstmResponse = await fetch(`https://csa-ai.stu.nighthawkcodingsociety.com/api/lstm/${symbol}`);
80+
const lstmResponse = await fetch(`http://localhost:8017/api/lstm/${symbol}`);
8181
const lstmData = await lstmResponse.json();
8282

8383
let lstmTimes = [];

pages/statslive.html

+9-52
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ <h2>Volume: <span class="font-bold">${volume}</span></h2>
125125
const data = response.data;
126126

127127
// Display stock info
128-
129-
// feature in testing: <button onclick="getAdditionalStockInfo()" class="btn">Get Additional Information</button>
130-
131128
const changeColor = data.d > 0 ? 'green' : 'red';
132129
document.getElementById("stockInfo").innerHTML = `
133130
<h2><b>Stock Information:</b></h2>
@@ -143,22 +140,19 @@ <h2><b>Stock Information:</b></h2>
143140
<p><br>
144141
</p>
145142
`;
143+
144+
// Fetch monthly stock data from Alpha Vantage API and render chart
145+
await fetchMonthlyStockData(symbol);
146146
} catch (error) {
147147
console.error(error);
148148
}
149-
150-
// Subscribe to symbol for real-time updates
151-
subscribe(symbol);
152-
153-
// Fetch monthly stock data from Alpha Vantage API and render chart
154-
fetchMonthlyStockData(symbol);
155149
}
156150

157151
// Function to fetch monthly stock data from Alpha Vantage API and render chart
158152
async function fetchMonthlyStockData(symbol) {
159153
const rapidApiKey = '48e23c6bf3msh9a6baf3e68d9a4ep14546ajsn1a39e98c4ad5';
160154
const rapidApiHost = 'alpha-vantage.p.rapidapi.com';
161-
const url = `https://${rapidApiHost}/query?function=TIME_SERIES_MONTHLY_ADJUSTED&symbol=${symbol}&datatype=json&output_size=compact`;
155+
const url = `https://${rapidApiHost}/query?function=TIME_SERIES_DAILY_ADJUSTED&symbol=${symbol}&datatype=json&output_size=full`;
162156

163157
const requestOptions = {
164158
method: 'GET',
@@ -169,13 +163,13 @@ <h2><b>Stock Information:</b></h2>
169163
};
170164

171165
try {
172-
const response = await fetch(url, requestOptions);
173-
const data = await response.json();
166+
const response = await axios.get(url, requestOptions);
167+
const data = response.data;
174168

175169
// Process stock data for chart
176-
let seriesData = Object.keys(data['Monthly Adjusted Time Series']).map(key => ({
170+
let seriesData = Object.keys(data['Time Series (Daily)']).map(key => ({
177171
x: new Date(key),
178-
y: parseFloat(data['Monthly Adjusted Time Series'][key]['5. adjusted close'])
172+
y: parseFloat(data['Time Series (Daily)'][key]['5. adjusted close'])
179173
}));
180174

181175
// Render chart using ApexCharts
@@ -189,7 +183,7 @@ <h2><b>Stock Information:</b></h2>
189183
function renderStockChart(seriesData) {
190184
var chartOptions = {
191185
series: [{
192-
name: 'Monthly Closed Stock Market Data',
186+
name: 'Time Series (Daily)',
193187
data: seriesData
194188
}],
195189
chart: {
@@ -254,43 +248,6 @@ <h2><b>Stock Information:</b></h2>
254248
var chart = new ApexCharts(document.querySelector("#stockChart"), chartOptions);
255249
chart.render();
256250
}
257-
// Function to fetch additional stock information
258-
async function getAdditionalStockInfo() {
259-
const symbol = document.getElementById("symbol").value;
260-
261-
try {
262-
// Fetch additional stock information using the Finnhub API
263-
const additionalInfo = await getAdditionalStockInformation(symbol);
264-
265-
// Display the additional stock information
266-
document.getElementById("stockInfo").innerHTML += `
267-
<h2><b>Additional Information</b></h2>
268-
<ul>
269-
${additionalInfo.map(info => `
270-
<li><b>Description:</b> ${info.description}</li>
271-
<li><b>Display Symbol:</b> ${info.displaySymbol}</li>
272-
<li><b>Type:</b> ${info.type}</li>
273-
<br>
274-
`).join('')}
275-
</ul>
276-
`;
277-
} catch (error) {
278-
console.error(error);
279-
}
280-
}
281-
282-
// Function to fetch additional stock information from the Finnhub API
283-
function getAdditionalStockInformation(symbol) {
284-
return new Promise((resolve, reject) => {
285-
finnhubClient.symbolSearch(symbol, (error, data, response) => {
286-
if (error) {
287-
reject(error);
288-
} else {
289-
resolve(data.result);
290-
}
291-
});
292-
});
293-
}
294251

295252
</script>
296253

pages/testprediction.html

-138
This file was deleted.

pages/v1oldstats.html

-89
This file was deleted.

pages/v1prediction.html

-44
This file was deleted.

0 commit comments

Comments
 (0)