Zorro Plugin !!top!! (2024)
// Custom user function callable from S-Lang double PLUGIN_CALL(char* name, double* params, int nParams) if(strcmp(name, "myFunction") == 0) return myFunction(params[0], params[1]); return -1; // error
function sentiment(ticker)
__declspec(dllexport) double PLUGIN_CALL(char* name, double* params, int n) if(strcmp(name, "add") == 0 && n == 2) return params[0] + params[1]; if(strcmp(name, "mul") == 0 && n == 2) return params[0] * params[1]; return 0; zorro plugin
Zorro Trader, automated trading, plugin architecture, S-Lang, sentiment analysis. References [1] Opteck GmbH. (2025). Zorro Trader Manual – Plugin Interface . [Online] Available: https://zorro-project.com/manual/Plugins.htm [2] Devine, J. (2022). Low-Latency Trading Systems . O'Reilly Media. [3] Vaswani, A., et al. (2017). Attention is All You Need. NeurIPS . [4] libcurl development team. (2024). libcurl – API for Client-Server Data Transfer . Appendix: Full Minimal Plugin Template // minimal_plugin.c #include <stdio.h> #include <string.h> __declspec(dllexport) int PLUGIN_INIT(void) return 0; __declspec(dllexport) int PLUGIN_EXIT(void) return 0; // Custom user function callable from S-Lang double
double PLUGIN_CALL(char* name, double* params, int nParams) if(strcmp(name, "sentiment") == 0 && nParams >= 1) // params[0] is a pointer to a string? Actually passed as double hack. // Better: pass ticker as string via a separate function. return get_sentiment((char*)(int)params[0]); // unsafe but illustrative Zorro Trader Manual – Plugin Interface
function run()