-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
49 lines (34 loc) · 1.32 KB
/
main.cpp
File metadata and controls
49 lines (34 loc) · 1.32 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
46
47
48
49
#include "mainwindow.h"
#include <QApplication>
#include "future.h"
Common::Logger::ConsoleLogger * Common::Logger::ConsoleLogger::p_instanse = 0;
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow app;
app.show();
timer<ch::microseconds> timer;
Strategy::dca res_test(10, 100, 90);
std::vector<std::pair<int,int>> ranges = Strategy::make_sub_range(MAX_ASSETS);
//for thread pool
// ThreadPool pool(4);
// pool.setJoin(true);
// timer.start();
// for(auto &item_range : ranges)
// {
//// std::cout<<"Try add task: " << item_range.first <<" to " << item_range.second <<"\n";
// pool.addTask([&]() { Strategy::calculateDCA(res_test, item_range.first, item_range.second); });
//// pool.addTask( std::ref(Strategy::calculateDCA), std::ref(res_test) , std::ref(item_range.first), std::ref(item_range.second));
//// Strategy::calculateDCA(res_test, item_range.first, item_range.second);
//
// }
// timer.stop().print();
auto strategy = Market::Strategy::Type::Scalping;
auto algo = Market::TraderAlgorithmFactory::createAlgo(strategy);
algo->init();
algo = Market::TraderAlgorithmFactory::createAlgo(Market::Strategy::Type::DayTrade);
algo->init();
auto algo_3 = algo->clone();
algo_3->init();
return a.exec();
}