update BLOCKSETNUM

This commit is contained in:
fasiondog 2024-05-21 06:29:00 +08:00
parent e81b34f95b
commit 6bcbc47c24

View File

@ -9,9 +9,6 @@
#include "IBlockSetNum.h" #include "IBlockSetNum.h"
#include "../Indicator.h" #include "../Indicator.h"
#include "../crt/KDATA.h"
#include "../crt/REF.h"
#include "../crt/ALIGN.h"
#include "../../StockManager.h" #include "../../StockManager.h"
#if HKU_SUPPORT_SERIALIZATION #if HKU_SUPPORT_SERIALIZATION
@ -23,6 +20,7 @@ namespace hku {
IBlockSetNum::IBlockSetNum() : IndicatorImp("BLOCKSETNUM", 1) { IBlockSetNum::IBlockSetNum() : IndicatorImp("BLOCKSETNUM", 1) {
setParam<KQuery>("query", KQueryByIndex(-100)); setParam<KQuery>("query", KQueryByIndex(-100));
setParam<Block>("block", Block()); setParam<Block>("block", Block());
setParam<string>("market", "SH");
setParam<bool>("ignore_context", false); setParam<bool>("ignore_context", false);
} }
@ -39,7 +37,7 @@ void IBlockSetNum::_calculate(const Indicator& ind) {
dates = k.getDatetimeList(); dates = k.getDatetimeList();
} else { } else {
q = getParam<KQuery>("query"); q = getParam<KQuery>("query");
dates = StockManager::instance().getTradingCalendar(q); dates = StockManager::instance().getTradingCalendar(q, getParam<string>("market"));
} }
size_t total = dates.size(); size_t total = dates.size();