From c6f17bd857e7f0ec5e689a247913ce676d289a76 Mon Sep 17 00:00:00 2001 From: zhuzhenping Date: Tue, 11 Jul 2023 09:21:29 +0000 Subject: [PATCH] =?UTF-8?q?update=20src/core/context.cpp.=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AF=B9simnow724=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhuzhenping --- src/core/context.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/context.cpp b/src/core/context.cpp index ccc70f8..cbf9d46 100644 --- a/src/core/context.cpp +++ b/src/core/context.cpp @@ -1,4 +1,4 @@ -#include "context.h" +#include "context.h" #include #include #include @@ -27,7 +27,8 @@ context::context(): _ready_callback(nullptr), _update_callback(nullptr), _last_tick_time(0), - realtime_event() + realtime_event(), + _all_day(false) { } @@ -69,6 +70,7 @@ void context::init(boost::property_tree::ptree& ctrl, boost::property_tree::ptre } _max_position = ctrl.get("position_limit", 10000); _fast_mode = ctrl.get("fast_mode", false); + _all_day = ctrl.get("all_day", false); _loop_interval = ctrl.get("loop_interval", 1); const auto& section_config = include_config.get("section_config", "./section.csv"); _section = std::make_shared(section_config); @@ -273,7 +275,7 @@ estid_t context::place_order(untid_t untid,offset_type offset, direction_type di LOG_DEBUG("place_order _is_trading_ready"); return INVALID_ESTID; } - if(!_section->is_in_trading(get_last_time())) + if(!_section->is_in_trading(get_last_time())&& !_all_day) { LOG_DEBUG("place_order code not in trading %s", code.get_id()); return INVALID_ESTID; @@ -695,7 +697,7 @@ void context::handle_tick(const std::vector& param) _section->init(trading_day, last_tick.time); check_crossday(trading_day); } - if(!_section->is_in_trading(last_tick.time)) + if(!_section->is_in_trading(last_tick.time)&& !_all_day) { return; } -- Gitee