Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

where is source of mcpp.exe and how to use gen_code.exe to generate a new indicator? #56

Open
cloudslee opened this issue Jan 20, 2025 · 1 comment
Assignees

Comments

@cloudslee
Copy link

where is source of mcpp.exe and how to use gen_code.exe to generate a new indicator?
because i want to add a new indicator, magic nine turn

@mario4tier
Copy link
Member

I recommend an ubuntu or macOS setup for dev with TA-Lib... WSL on windows would also do.

It should work on windows native, but I do not actively use it for development anymore (I use a windows VM only for packaging and running ta_regtest).

mcpp.exe

From https://mcpp.sourceforge.net/download.html

For convenience, I did embed the .exe in the repos https://github.com/TA-Lib/ta-lib/tree/main/src/tools/gen_code

how to use gen_code

Just a heads-up, this is not trivial, but if you are willing to spend a few days to get started, I am here to help (when asking a question, consider putting your latest code in a fork so I can review all changes instead of going back and forth with small code excerpt).

gen_code generates the ta_XXXX.c files (and more). The function signature (the API) is defined in C in one of the "table file": https://github.com/TA-Lib/ta-lib/tree/main/src/ta_abstract/tables

Best way to start is to cut&paste&rename an existing "similar" function in a table, rebuild and run gen_code... and verify that a new ta_func/TA_xxxx.c file is created.

You then modify the non-generated portion of TA_xxxx.c file to put your own code. You can always add/remove parameters by changing the table and rebuilding+running gen_code.

To test the logic, rebuild ta_regtest after a gen_code. Again, cut&paste an existing "similar" function for testing.

Submit code

Create a PR on the dev branch (not main).

@mario4tier mario4tier self-assigned this Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants