HKU_API Indicator operator+(const Indicator& ind1, const Indicator& ind2) { if (!ind1.getImp() || !ind2.getImp()) { return Indicator(); } IndicatorImpPtr p = make_shared<IndicatorImp>(); p->add(IndicatorImp::ADD, ind1.getImp(), ind2.getImp()); return p->calculate(); }
Indicator HKU_API WEAVE(const Indicator& ind1, const Indicator& ind2) { if (!ind1.getImp() || !ind2.getImp()) { HKU_ERROR("ind1 or ind2 is Null Indicator! [WEAVE]"); return Indicator(); } IndicatorImpPtr p = make_shared<IndicatorImp>(); p->add(IndicatorImp::WEAVE, ind1.getImp(), ind2.getImp()); return p->calculate(); }
Indicator Indicator::operator()(const Indicator& ind) { if (!m_imp) return Indicator(); if (!ind.getImp()) return Indicator(m_imp); IndicatorImpPtr p = m_imp->clone(); p->add(IndicatorImp::OP, IndicatorImpPtr(), ind.getImp()); return p->calculate(); }