Skip to content

C / C++

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

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

const char *spec = "{\"seed\":1,\"population\":8,\"generations\":3,"
                   "\"mutation_rate\":0.2,\"crossover_rate\":0.6,\"fitness\":\"sharpe\","
                   "\"search_space\":{\"indicators\":[{\"name\":\"rsi\",\"param_ranges\":[{\"min\":2,\"max\":30,\"step\":1}]}],"
                   "\"rules\":\"single_threshold\",\"max_conditions\":1},\"elitism\":1,\"top\":5}";

WickraDarwin *d = wickra_darwin_new(spec);
const char *cmd = "{\"cmd\":\"evolve\",\"data\":{ /* symbol -> candles */ }}";
char *report = wickra_darwin_command(d, cmd);   /* JSON response */

printf("%s\n", report);
wickra_darwin_free(d);

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

More