-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
34 lines (25 loc) · 1.03 KB
/
main.cpp
File metadata and controls
34 lines (25 loc) · 1.03 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
#include <iostream>
#include <vector>
#include <matplot/matplot.h>
#include "indicators.hpp"
#include "data_generation.hpp"
#include "plotting.hpp"
#include "statistics.hpp"
namespace plt = matplot;
int main() {
std::cout << "\n📈 Quantitative Finance Technical Analysis Tool\n";
std::cout << "Using Matplot++ for C++ Visualization\n" << std::endl;
std::vector<double> dates, opens, highs, lows, closes, volumes;
generateFinancialData(dates, opens, highs, lows, closes, volumes, 2000);
std::vector<double> sma20 = calculateSMA(closes, 20);
std::vector<double> sma50 = calculateSMA(closes, 50);
std::vector<double> sma100 = calculateSMA(closes, 100);
std::vector<double> rsi = calculateRSI(closes, 21);
auto [macdLine, signalLine, histogram] = calculateMACD(closes, 12, 26, 9);
printStatistics(closes, rsi, sma20);
plotPriceWithMovingAverages(dates, closes, sma20, sma50, sma100);
plotRSI(dates, rsi);
plotMACD(dates, macdLine, signalLine, histogram);
matplot::show();
return 0;
}