Skip to content

TA-Lib/ta-lib-zig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TA-Lib

This is a Zig wrapper for TA-LIB.

Installation

  1. Add ta-lib-zig as a dependency in your build.zig.zon:
zig fetch --save "git+https://github.com/ta-lib/ta-lib-zig#main"
  1. In your build.zig, add the httpz module as a dependency you your program:
const ta_lib = b.dependency("ta_lib", .{
    .target = target,
    .optimize = optimize,
});

// the executable from your call to b.addExecutable(...)
exe.root_module.addImport("ta_lib", ta_lib.module("ta_lib"));

Examples

A simple example using the Momentum indicator:

const ta = @import("ta_lib");

const prices = [_]f64{ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 };

const result = try ta.MOM(allocator, &prices, 5);
defer allocator.free(result);

About

Zig wrapper for TA-Lib (http://ta-lib.org)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages