forked from SteppieD/tradinggame
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_dashboard_chart.html
More file actions
45 lines (40 loc) · 1.79 KB
/
test_dashboard_chart.html
File metadata and controls
45 lines (40 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test Dashboard Chart Update</title>
<script>
// Test that chart will update with portfolio data
console.log("Testing portfolio chart update...");
// Simulated portfolio values
const aug12 = 1000; // Initial investment
const aug13 = 1036.50; // After FCEL sale
const aug14 = 1043.32; // Current (from your calculation)
console.log("Portfolio Performance:");
console.log(`Aug 12: $${aug12} (0.0%)`);
console.log(`Aug 13: $${aug13} (+${((aug13-1000)/1000*100).toFixed(2)}%)`);
console.log(`Aug 14: $${aug14} (+${((aug14-1000)/1000*100).toFixed(2)}%)`);
// Compare to benchmarks
const spyReturn = 0.34; // SPY up 0.34% today
const iwmReturn = 1.94; // IWM up 1.94% today
console.log("\nBenchmark Comparison:");
console.log(`SPY (2-day): ~+${spyReturn}%`);
console.log(`IWM (2-day): ~+${iwmReturn}%`);
console.log(`Your Portfolio: +${((aug14-1000)/1000*100).toFixed(2)}%`);
console.log("\nOutperformance:");
console.log(`vs SPY: +${(((aug14-1000)/1000*100) - spyReturn).toFixed(2)}%`);
console.log(`vs IWM: +${(((aug14-1000)/1000*100) - iwmReturn).toFixed(2)}%`);
</script>
</head>
<body>
<h1>Chart Update Test</h1>
<p>Check console for results. Dashboard chart will now auto-update with your performance!</p>
<ul>
<li>Aug 12: $1,000 (Initial)</li>
<li>Aug 13: $1,036.50 (After FCEL sale)</li>
<li>Aug 14: $1,043.32 (Current)</li>
</ul>
<p><strong>You're up +4.33% vs SPY +0.34% and IWM +1.94%!</strong></p>
</body>
</html>