Skip to content

Commit

Permalink
simplearb use backtest version
Browse files Browse the repository at this point in the history
  • Loading branch information
nickhuangxinyu1 committed Apr 9, 2020
1 parent fc7e4f4 commit a2493c9
Show file tree
Hide file tree
Showing 5 changed files with 741 additions and 15 deletions.
5 changes: 3 additions & 2 deletions src/backtest/strategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void Strategy::ForceFlat() {
Close();
}
}
CalParams();
// CalParams();
}

bool Strategy::Close(bool force_flat) {
Expand Down Expand Up @@ -348,7 +348,7 @@ void Strategy::CloseLogic() {

if (HitMean()) {
if (Close()) {
CalParams();
// CalParams();
}
return;
}
Expand Down Expand Up @@ -582,6 +582,7 @@ void Strategy::DoOperationAfterFilled(Order* o, const ExchangeInfo& info) {
std::string a = o->tbd;
if (a.find("close") != string::npos) {
close_round++;
CalParams();
}
std::string oc = (position_map[hedge_ticker] == 0 ? "open" : "close");
Order* order = NewOrder(hedge_ticker, (o->side == OrderSide::Buy) ? OrderSide::Sell : OrderSide::Buy, info.trade_size, false, false, "", no_close_today);
Expand Down
Loading

0 comments on commit a2493c9

Please sign in to comment.