Custom indicators and TA-lib

Posted By: bot

Custom indicators and TA-lib - 12/14/20 10:01

I see ta-lib.zip as part of Zorro installation but cannot find anywhere where this is used. Can you please point to where it is used?

Also, what are the exact definitions of these functions, what do they do and where are the source codes for these?

SETSERIES(Data,Period);

series(x,y);

Finally, do the functions inside indicators.c get called for each tick and from where/how?
Posted By: AndrewAMD

Re: Custom indicators and TA-lib - 12/14/20 13:50

It’s precompiled into Zorro.
Posted By: bot

Re: Custom indicators and TA-lib - 12/14/20 15:52

How about this?

Also, what are the exact definitions of these functions, what do they do and where are the source codes for these?

SETSERIES(Data,Period);

series(x,y);

Finally, do the functions inside indicators.c get called for each tick and from where/how?
Posted By: AndrewAMD

Re: Custom indicators and TA-lib - 12/14/20 16:17

Zorro is not open source. Some functions are open source. The ones that are have a check mark in this list are open source and zipped up in the source folder:
https://zorro-trader.com/manual/en/funclist.htm

You are responsible for calling series() and indicator functions on the script side. Zorro iteratively calls the run() function, which is where you place your indicator function calls.

The free tutorial with the free Zorro software starts here. It's well worth your time, as it will answer most of your questions:
https://zorro-project.com/manual/en/tutorial_var.htm
Posted By: bot

Re: Custom indicators and TA-lib - 12/14/20 17:04

Thank you for the links, I don't need the source code, but want the function definition like inputs/outputs so that I can use to write my own indicators for Zorro.

I see SETSERIES(Data,Period); is used heavily inside indicators.c but cannot find the function definition for it.

Can someone from Zorro dev team answer on this pls?
Posted By: AndrewAMD

Re: Custom indicators and TA-lib - 12/14/20 17:38

Originally Posted by bot
Thank you for the links, I don't need the source code, but want the function definition like inputs/outputs so that I can use to write my own indicators for Zorro.

I see SETSERIES(Data,Period); is used heavily inside indicators.c but cannot find the function definition for it.
You never call SETSERIES() in Zorro, ever. It's buried in the backend and not callable in the script.

series() is defined here:
https://zorro-project.com/manual/en/series.htm
Posted By: AndrewAMD

Re: Custom indicators and TA-lib - 12/14/20 17:41

Also, this page teaches you how to write your own indicators:
https://zorro-project.com/manual/en/tutorial_lowpass.htm

Check out Petra's blog series on writing indicators in Zorro:
https://financial-hacker.com/petra-on-programming-a-new-zero-lag-indicator/
https://financial-hacker.com/petra-on-programming-the-smoothed-obv/
https://financial-hacker.com/petra-on-programming-a-unique-trend-indicator/
https://financial-hacker.com/petra-on-programming-the-correlation-cycle-indicator/
https://financial-hacker.com/petra-on-programming-truncated-indicators/
https://financial-hacker.com/petra-on-programming-the-compare-price-momentum-oscillator/
https://financial-hacker.com/petra-on-programming-4-dimensions-of-strength/
https://financial-hacker.com/petra-on-programming-the-gann-hi-lo-activator/
https://financial-hacker.com/petra-on-programming-get-rid-of-noise/
Posted By: bot

Re: Custom indicators and TA-lib - 12/14/20 18:07

Thank you that is useful.

One thing that isn't clear to me is where to add the custom indicators? in indicators.c file?

Also, in the same file most of the indicators call SETSERIES, as in example below:

// Awesome Oscillator
var AO(var* Data)
{
var R = SMA(Data,5)-SMA(Data,34);
SETSERIES(Data,34);
return R;
}

That is the reason I want too know what is the purpose of SETSERIES function?
Posted By: AndrewAMD

Re: Custom indicators and TA-lib - 12/14/20 20:06

Originally Posted by bot
One thing that isn't clear to me is where to add the custom indicators? in indicators.c file?

Also, in the same file most of the indicators call SETSERIES, as in example below:

// Awesome Oscillator
var AO(var* Data)
{
var R = SMA(Data,5)-SMA(Data,34);
SETSERIES(Data,34);
return R;
}

That is the reason I want too know what is the purpose of SETSERIES function?
Zorro ignores the indicators.c file completely, and therefore you should ignore indicators.c. It is impossible for you (the script-writer) to use SETSERIES, so ignore that too.

You put your custom indicator function either in a header file and include it, or put it above the run() function. Both have the same effect of working.
Posted By: bot

Re: Custom indicators and TA-lib - 01/04/21 23:14

What does the SETSERIES function do? Why is it used in few places? e.g. in // Awesome Oscillator

SETSERIES(Data,34);

What does the series function do?

How to access the TA LIB functions?
© 2024 lite-C Forums