Skip to content

Commit

Permalink
minor bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qlu committed Dec 6, 2019
1 parent 59752e8 commit 2e23b77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions core/extensions/xtp/src/order_mapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Created by qlu on 2019/1/14.
//

#ifndef WC_2_ORDER_MAPPER_H
#define WC_2_ORDER_MAPPER_H
#ifndef KF_EXT_XTP_ORDER_MAPPER_H
#define KF_EXT_XTP_ORDER_MAPPER_H

#include <string>
#include <spdlog/spdlog.h>
Expand Down Expand Up @@ -134,4 +134,4 @@ namespace kungfu
}
}
}
#endif //WC_2_ORDER_MAPPER_H
#endif //KF_EXT_XTP_ORDER_MAPPER_H
4 changes: 2 additions & 2 deletions core/python/kungfu/wingchun/book/position.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ def apply_quote(self, quote):
pre_margin = self.margin
self.margin = self.contract_multiplier * self.settlement_price * self.volume * self.margin_ratio
self.book.avail -= (self.margin - pre_margin)
elif is_valid_price(quote.last_price):
if is_valid_price(quote.last_price):
self.last_price = quote.last_price
elif is_valid_price(quote.pre_settlement_price):
if is_valid_price(quote.pre_settlement_price):
self.pre_settlement_price = quote.pre_settlement_price
self._on_interval_check(self.ctx.now())

Expand Down

0 comments on commit 2e23b77

Please sign in to comment.