Skip to content

C / C++

The C ABI hub. A single wickra_genome.h header + prebuilt library links from C, C++, or any C-capable language. Drive it with the JSON command protocol.

bash
# prebuilt wickra_genome.h + library per platform:
# github.com/wickra-lib/wickra-genome/releases
c
#include "wickra_genome.h"

const char *spec = "{\"features\":[{\"kind\":\"price\",\"field\":\"close\"}],"
                   "\"symbols\":[\"AAA\",\"BBB\",\"CCC\"],"
                   "\"normalize\":\"z_score\",\"metric\":\"euclid\",\"seed\":24333}";

WickraGenome *g = wickra_genome_new(spec);
wickra_genome_command(g, "{\"cmd\":\"build\",\"data\":{ /* symbol -> candles */ }}");
char *out = wickra_genome_command(g, "{\"cmd\":\"similar\",\"symbol\":\"AAA\",\"k\":2}");

printf("%s\n", out);
wickra_genome_free(g);

The header is generated by cbindgen and is the same ABI the C#, Go, Java and R bindings link against.

More