51int simple_ta_length(
double value,
const char* function,
const char* argument);
53int simple_ta_length(std::int64_t value,
const char* function,
const char* argument);
57inline double ta_number(
double value) {
return value; }
72 std::optional<T> object_;
77 if (!object_) object_.emplace(std::forward<Make>(make)());
80 bool bound()
const {
return object_.has_value(); }
82 template <
class Make,
class... Args>
83 decltype(
auto)
compute(Make&& make, Args&&... args) {
84 return bind(std::forward<Make>(make)).compute(std::forward<Args>(args)...);
86 template <
class Make,
class... Args>
87 decltype(
auto)
recompute(Make&& make, Args&&... args) {
88 return bind(std::forward<Make>(make)).recompute(std::forward<Args>(args)...);
101 static constexpr std::size_t
kChunk = 1024;
106 bool empty()
const {
return count_ == 0; }
108 long long last_bar()
const {
return first_bar_ + count_ - 1; }
111 void write(
long long bar,
double value, std::size_t keep);
114 double at(
long long bar)
const;
119 void ensure_slots(std::size_t keep);
120 std::size_t slot(std::size_t offset)
const;
121 void push(
double value);
122 void drop_front_chunks(std::size_t keep);
125 std::size_t head_ = 0;
126 long long first_bar_ = 0;
127 long long count_ = 0;
170 Result update(
double src,
long long length,
bool advance,
bool want_max,
171 const char* function);
181 long long prev_length = 0;
182 long long max_length = 0;
183 bool started =
false;
188 BarState saved_state_;
189 long long current_bar_ = 0;
190 bool has_bar_ =
false;
191 long long first_exec_bar_ = 0;
192 long long own_bar_ = -1;
201 double compute(
double src,
double length);
202 double recompute(
double src,
double length);
211 double compute(
double src,
double length);
212 double recompute(
double src,
double length);
221 double compute(
double src,
double length);
222 double recompute(
double src,
double length);
231 double compute(
double src,
double length);
232 double recompute(
double src,
double length);
266 bool latched_ =
false;
268 std::optional<ta::ATR> atr_;
277#define PINEFORGE_HAS_TA_SERIES_LENGTH 1
decltype(auto) recompute(Make &&make, Args &&... args)
decltype(auto) compute(Make &&make, Args &&... args)
long long last_bar() const
WindowCacheCapacity cache_capacity() const
HeldHistory(WindowCacheCapacity cache)
double at(long long bar) const
WindowCacheStats cache_stats() const
void write(long long bar, double value, std::size_t keep)
long long first_bar() const
static constexpr std::size_t kChunk
ta::SupertrendResult recompute(double factor, double atr_period, double high, double low, double close)
ta::SupertrendResult compute(double factor, double atr_period, double high, double low, double close)
double recompute(double src, double length)
SeriesHighestBars(WindowCacheCapacity cache)
SeriesHighestBars()=default
double compute(double src, double length)
double compute(double src, double length)
double recompute(double src, double length)
SeriesHighest(WindowCacheCapacity cache)
double recompute(double src, double length)
double compute(double src, double length)
SeriesLowestBars(WindowCacheCapacity cache)
SeriesLowestBars()=default
SeriesLowest(WindowCacheCapacity cache)
double compute(double src, double length)
double recompute(double src, double length)
Result update(double src, long long length, bool advance, bool want_max, const char *function)
SeriesWindowExtreme(WindowCacheCapacity cache)
static constexpr long long kMaxBarsBack
double ta_number(double value)
int simple_ta_length(double value, const char *function, const char *argument)
bool is_na(const Line &h)
WindowCacheCapacity & window_cache_capacity()