Skip to content

Commit

Permalink
[chore] 删除无用参数
Browse files Browse the repository at this point in the history
  • Loading branch information
xywanz committed Jun 3, 2021
1 parent df82dc6 commit cf30c62
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions src/strategy/strategy_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,20 @@
#include <dlfcn.h>

#include <fstream>
#include <thread>

#include "ft/base/contract_table.h"
#include "ft/base/log.h"
#include "ft/strategy/strategy.h"
#include "ft/utils/getopt.hpp"

static void Usage() {
printf("Usage: ./strategy_engine [--account=<account>]\n");
printf(" [--contracts=<file>] [-h -? --help]\n");
printf(" [--id=<id>] [--loglevel=level]\n");
printf(" [--strategy=<so>]\n");
printf("Usage: ./strategy_engine <--config=file> [-h -? --help]\n");
printf(" <--name=name> [--loglevel=level]\n");
printf(" <--strategy=so>\n");
printf("\n");
printf(" --account 账户\n");
printf(" --contracts 合约列表文件\n");
printf(" --config 配置文件\n");
printf(" -h, -?, --help 帮助\n");
printf(" --id 策略的唯一标识,用于接收订单回报\n");
printf(" --name 策略的唯一标识,用于接收订单回报\n");
printf(" --loglevel 日志等级(trace, debug, info, warn, error)\n");
printf(" --strategy 要加载的策略的动态库\n");
}
Expand All @@ -29,7 +26,6 @@ int main() {
std::string strategy_file = getarg("", "--strategy");
std::string log_level = getarg("info", "--loglevel");
std::string strategy_id = getarg("strategy", "--name");
uint64_t account_id = getarg(0ULL, "--account");
bool backtest_mode = getarg(false, "--backtest");
bool help = getarg(false, "-h", "--help", "-?");

Expand All @@ -40,11 +36,6 @@ int main() {

spdlog::set_level(spdlog::level::from_str(log_level));

if (account_id == 0) {
LOG_ERROR("Please input account id");
exit(EXIT_FAILURE);
}

ft::FlareTraderConfig config;
if (!config.Load(config_file)) {
LOG_ERROR("failed to load config file {}", config_file);
Expand Down Expand Up @@ -74,7 +65,7 @@ int main() {
exit(EXIT_FAILURE);
}

spdlog::info("ready to start strategy. id={}, account={}", strategy_id, account_id);
spdlog::info("ready to start strategy. name={}", strategy_id);
if (backtest_mode) {
strategy->RunBacktest();
} else {
Expand Down

0 comments on commit cf30c62

Please sign in to comment.