-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathloadCommand.cpp
More file actions
43 lines (37 loc) · 1.31 KB
/
Copy pathloadCommand.cpp
File metadata and controls
43 lines (37 loc) · 1.31 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
// Backtesting Engine in C++
//
// (c) 2026 Ryan McCaffery | https://mccaffers.com
// This code is licensed under MIT license (see LICENSE.txt for details)
// ---------------------------------------
#include "loadCommand.hpp"
#include <boost/decimal/literals.hpp>
#include <nlohmann/json.hpp>
#include "env.hpp"
#include "redisLoader.hpp"
#include "trading_definitions.hpp"
int LoadCommand::run() {
using namespace boost::decimal::literals;
using namespace trading_definitions;
const Configuration config{
.RUN_ID = "UNIQUE_IDENTIFIER",
.SYMBOLS = "EURUSD,AUDUSD",
.LAST_MONTHS = 2,
.STRATEGY = Strategy{
.UUID = "",
.TRADING_VARIABLES = TradingVariables{
.STRATEGY = "RandomStrategy",
.STOP_DISTANCE_IN_PIPS = 1.5_DD,
.LIMIT_DISTANCE_IN_PIPS = 1.5_DD,
.TRADING_SIZE = 1_DD,
},
.OHLC_VARIABLES = {
OHLCVariables{.OHLC_COUNT = 60, .OHLC_MINUTES = 100},
},
.STRATEGY_VARIABLES = StrategyVariables{
.OHLC_RSI_VARIABLES = OHLCRSIVariables{.RSI_LONG = 60, .RSI_SHORT = 40},
},
},
};
const nlohmann::json j = config;
return RedisLoader::load(j.dump(), env::getOr("REDIS_HOST", "127.0.0.1"));
}