-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_data.cpp
More file actions
19 lines (16 loc) · 759 Bytes
/
test_data.cpp
File metadata and controls
19 lines (16 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "market_data_analysis.cpp"
#include <iostream>
using namespace std;
int main() {
MarketDataAnalysis analysis("AAPL");
analysis.priceHistory_.fetchHistoricalData("2023-01-01", "2023-08-31", "1d");
double averagePrice = analysis.calculateAveragePrice();
cout << "Average Price: " << averagePrice << endl;
double volatility = analysis.calculateVolatility();
cout << "Volatility: " << volatility << endl;
vector<PricePoint> upwardTrends = analysis.getUpwardTrends();
cout << "Upward Trends: " << upwardTrends.size() << " data points" << endl;
vector<PricePoint> downwardTrends = analysis.getDownwardTrends();
cout << "Downward Trends: " << downwardTrends.size() << " data points" << endl;
return 0;
}