Skip to content

Commit

Permalink
upload for ali
Browse files Browse the repository at this point in the history
  • Loading branch information
nickhuangxinyu committed Feb 21, 2020
1 parent c76842b commit c623ba8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions config/backtest/backtest.config
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,20 @@ strategy = (
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;
},

{
unique_name = "sn";
max_position = 3;
Expand Down
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 @@ -220,8 +220,8 @@ int main() {
}
int period = param_cfg.lookup("period");
std::vector<std::string> file_v = dt.GetDataFilesNameByDate(start_date, period, true);
PrintVector(file_v);
Contractor ct(dt.GetValidFile(start_date, -40));
PrintVector(ct.GetAllTick());
std::unique_ptr<Sender> sender(new Sender("*:33333", "bind", "tcp", "mid_backtest.dat"));
std::unique_ptr<Sender> ordersender(new Sender("order_sub", "connect", "ipc", "order.dat"));
std::vector<BaseStrategy*> sv;
Expand Down
2 changes: 1 addition & 1 deletion src/simplearb/strategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ void Strategy::ModerateOrders(const std::string & ticker) {
std::string ticker = o->ticker;
MarketSnapshot shot = shot_map[ticker];
double reasonable_price = (o->side == OrderSide::Buy ? shot.asks[0] : shot.bids[0]);
bool is_price_move = (fabs(reasonable_price - o->price) >= min_price_move);
bool is_price_move = (fabs(reasonable_price - o->price) >= min_price_move/2);
if (!is_price_move) {
continue;
}
Expand Down

0 comments on commit c623ba8

Please sign in to comment.