mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-02 20:08:26 +08:00
加速组合指标计算(continue)
This commit is contained in:
parent
53c6dc04fd
commit
a498d4e725
@ -1476,4 +1476,31 @@ bool IndicatorImp::alike(const IndicatorImp &other) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
std::list<IndicatorImpPtr> IndicatorImp::getAllSubNodes() const {
|
||||
std::list<IndicatorImpPtr> result;
|
||||
if (m_left) {
|
||||
result.push_back(m_left);
|
||||
auto sub_nodes = m_left->getAllSubNodes();
|
||||
result.splice(result.end(), sub_nodes);
|
||||
}
|
||||
if (m_right) {
|
||||
result.push_back(m_right);
|
||||
auto sub_nodes = m_right->getAllSubNodes();
|
||||
result.splice(result.end(), sub_nodes);
|
||||
}
|
||||
if (m_three) {
|
||||
result.push_back(m_three);
|
||||
auto sub_nodes = m_three->getAllSubNodes();
|
||||
result.splice(result.end(), sub_nodes);
|
||||
}
|
||||
for (auto iter = m_ind_params.begin(); iter != m_ind_params.end(); ++iter) {
|
||||
if (iter->second) {
|
||||
result.push_back(iter->second);
|
||||
auto sub_nodes = iter->second->getAllSubNodes();
|
||||
result.splice(result.end(), sub_nodes);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
} /* namespace hku */
|
||||
|
@ -218,6 +218,8 @@ private:
|
||||
void execute_if();
|
||||
void execute_corr();
|
||||
|
||||
std::list<IndicatorImpPtr> getAllSubNodes() const;
|
||||
|
||||
protected:
|
||||
static size_t _get_step_start(size_t pos, size_t step, size_t discard);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user