Skip to content

Commit

Permalink
revise config path
Browse files Browse the repository at this point in the history
  • Loading branch information
nickhuangxinyu committed Sep 13, 2019
1 parent 22d2e44 commit f813ff7
Show file tree
Hide file tree
Showing 16 changed files with 107 additions and 1,302 deletions.
19 changes: 4 additions & 15 deletions config/backtest/backtest.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ time_controller :
close_time = [ "14:00:59-14:59:00", "23:00:00-23:59:59" ];
force_close_time = [ "16:59:59-17:30:00" ];
};
legend = "nf:rg3:am50:mhc:*";
backtest_out_file = "backtest_record";
strategy = (
{
Expand All @@ -19,7 +18,6 @@ strategy = (
max_holding_sec = 3600000;
stop_loss_margin = 3.0;
max_loss_times = 2;
pairs = ( "au1906", "au1908" );
},

{
Expand All @@ -34,7 +32,6 @@ strategy = (
max_holding_sec = 360000000;
stop_loss_margin = 10.0;
max_loss_times = 2;
pairs = ( "IH1905", "IH1906" );
no_close_today = true;
},
{
Expand All @@ -49,7 +46,6 @@ strategy = (
max_holding_sec = 360000000;
stop_loss_margin = 10.0;
max_loss_times = 2;
pairs = ( "IF1905", "IF1906" );
no_close_today = true;
},
{
Expand All @@ -64,7 +60,6 @@ strategy = (
max_holding_sec = 360000000;
stop_loss_margin = 10.0;
max_loss_times = 2;
pairs = ( "IC1905", "IC1906" );
no_close_today = true;
},

Expand All @@ -83,7 +78,6 @@ strategy = (
max_holding_sec = 3600000;
stop_loss_margin = 3.0;
max_loss_times = 2;
pairs = ( "cu1906", "cu1907" );
},

{
Expand All @@ -98,19 +92,14 @@ strategy = (
max_holding_sec = 3600000;
stop_loss_margin = 3.0;
max_loss_times = 2;
pairs = ( "ni1906", "ni1907" );
}
);
data_file = [
// "/running/2019-05-10/data_binary.dat",
"/running/2019-05-20/data_binary.dat"
];

start_date = "2018-11-28";
start_date = "2019-09-11";
period = 300;
matcher_mode = "python";
message_line = 100000;

order_file = "order.dat";
exchange_file = "exchange.dat";
strat_file = "mid.dat";
order_file = "order_backtest.dat";
exchange_file = "exchange_backtest.dat";
strat_file = "mid_backtest.dat";
File renamed without changes.
98 changes: 98 additions & 0 deletions config/prod/prod.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
time_controller :
{
sleep_time = [ "10:14:20-10:30:00", "11:29:20-13:00:00", "03:58:20-08:55:00" ];
close_time = [ "14:00:59-14:59:00", "23:00:00-23:59:59" ];
force_close_time = [ "16:59:59-17:30:00" ];
};
strategy = (
{
unique_name = "au";
max_position = 5;
range_width = 2.0;
min_train_samples = 600;
min_range = 2.0;
min_profit = 1.0;
add_margin = 1.0;
spread_threshold = 3.0;
max_holding_sec = 3600000;
stop_loss_margin = 3.0;
max_loss_times = 2;
},

{
unique_name = "IH";
max_position = 1;
range_width = 2.0;
min_train_samples = 600;
min_range = 4.0;
min_profit = 1.0;
add_margin = 3.0;
spread_threshold = 3.0;
max_holding_sec = 360000000;
stop_loss_margin = 10.0;
max_loss_times = 2;
no_close_today = true;
},
{
unique_name = "IF";
max_position = 1;
range_width = 2.0;
min_train_samples = 600;
min_range = 4.0;
min_profit = 1.0;
add_margin = 3.0;
spread_threshold = 3.0;
max_holding_sec = 360000000;
stop_loss_margin = 10.0;
max_loss_times = 2;
no_close_today = true;
},
{
unique_name = "IC";
max_position = 1;
range_width = 2.0;
min_train_samples = 600;
min_range = 4.0;
min_profit = 1.0;
add_margin = 3.0;
spread_threshold = 3.0;
max_holding_sec = 360000000;
stop_loss_margin = 10.0;
max_loss_times = 2;
no_close_today = true;
},

{
unique_name = "cu";
max_position = 2;
tick_size = 10.0;
range_width = 2.0;
contract_size = 5;
min_train_samples= 600;
cancel_threshhold = 1000000000;
min_range = 4.0;
min_profit = 1.0;
add_margin = 1.0;
spread_threshold = 3.0;
max_holding_sec = 3600000;
stop_loss_margin = 3.0;
max_loss_times = 2;
},

{
unique_name = "ni";
max_position = 3;
range_width = 2.0;
min_train_samples = 600;
min_range = 4.0;
min_profit = 1.0;
add_margin = 3.0;
spread_threshold = 3.0;
max_holding_sec = 3600000;
stop_loss_margin = 3.0;
max_loss_times = 2;
}
);
order_file = "order.dat";
exchange_file = "exchange.dat";
strat_file = "mid.dat";
Binary file added external/common/include/caler.so
Binary file not shown.
Binary file modified external/common/lib/libcommontools.so
Binary file not shown.
Binary file modified external/common/libcommontools.so
Binary file not shown.
2 changes: 1 addition & 1 deletion src/backtest/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ int main() {
libconfig::Config param_cfg;
libconfig::Config contract_cfg;
std::string param_config_path = default_path + "/hft/config/backtest/backtest.config";
std::string contract_config_path = default_path + "/hft/config/backtest/contract.config";
std::string contract_config_path = default_path + "/hft/config/contract/contract.config";
param_cfg.readFile(param_config_path.c_str());
contract_cfg.readFile(contract_config_path.c_str());
try {
Expand Down
Loading

0 comments on commit f813ff7

Please sign in to comment.