hikyuu2/hikyuu_cpp/hikyuu/indicator/crt/BACKSET.h
2019-05-13 23:02:17 +08:00

36 lines
767 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* BACKSET.h
*
* Copyright (c) 2019 hikyuu.org
*
* Created on: 2019-5-13
* Author: fasiondog
*/
#ifndef INDICATOR_CRT_BACKSET_H_
#define INDICATOR_CRT_BACKSET_H_
#include "../Indicator.h"
namespace hku {
/**
* 向前赋值将当前位置到若干周期前的数据设为1
* @details
* <pre>
* 用法BACKSET(X,N),X非0,则将当前位置到N周期前的数值设为1。
* 例如BACKSET(CLOSE>OPEN,2)若收阳则将该周期及前一周期数值设为1,否则为0
* </pre>
* @ingroup Indicator
*/
Indicator HKU_API BACKSET(int n = 2);
Indicator BACKSET(const Indicator& ind, int n = 2);
inline Indicator BACKSET(const Indicator& ind, int n) {
return BACKSET(n)(ind);
}
} /* namespace */
#endif /* INDICATOR_CRT_BACKSET_H_ */