Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ta-lib/ta_libc.h
✓ #include <ta-lib/ta_libc.h>
Calculates a simple moving average (SMA) over price data
#include <ta-lib/ta_libc.h>
#include <iostream>
#include <vector>
int main() {
TA_RetCode ret;
TA_Initialize();
std::vector<double> close = {10.0, 11.0, 12.0, 13.0, 14.0};
std::vector<double> out(5);
int outBeg, outNb;
ret = TA_SMA(0, 4, close.data(), 3, &outBeg, &outNb, out.data());
if (ret == TA_SUCCESS) {
std::cout << "SMA calculated" << std::endl;
}
TA_Shutdown();
return 0;
}
Audit
Dependencies
No dependency data recorded yet.
Resources
No resource links recorded.