Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, Quad, VoroneTZ, 1 invisible), 623 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Stat functions crashing in evaluate() #486047
06/03/22 18:13
06/03/22 18:13
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
var r2 = LinearRegSlope(AssetC+NumBars-50,20); crashes (similar to Hurst, FractalDimension, MaxVal, etc) while Spearman() and R2() don't.

Re: Stat functions crashing in evaluate() [Re: Zheka] #486060
06/06/22 09:04
06/06/22 09:04
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
Data and price series are a) expected in reverse order and b) only valid in the run function or in functions called by run().

https://zorro-project.com/manual/en/series.htm

I'm pretty sure that includes AssetC.

Re: Stat functions crashing in evaluate() [Re: Zheka] #486062
06/06/22 09:56
06/06/22 09:56
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
LinearRegSlope(), etc will crash in objective() even if fed with a standard var array (of pip-based equity curve). How can one use Zorro's stat functions in objective()/ evaluate()?

Last edited by Zheka; 06/06/22 09:59.
Re: Stat functions crashing in evaluate() [Re: Zheka] #486063
06/06/22 10:49
06/06/22 10:49
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
Evaluate and objective are for evaluating results. Indicators and price series are released at session end.

TA-Lib indicators work anyway only with series according to the manual, I guess you cannot use them with arbitrary data. You can see in the manual or in the functions.h list which functions are from the TA-Lib.

For regression use the polyfit function. LinearRegSlope is a TA-Lib indicator and not for general statistics.

If you need indicator returns in evaluate for some reason then get them while the session is still running, for instance in the EXITRUN.

Re: Stat functions crashing in evaluate() [Re: Zheka] #486065
06/06/22 18:05
06/06/22 18:05
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
Indeed, the manual states that the input for such functions should be a 'series'.

However, I always used them in run() with standard arrays without a problem (a var* is a var*, right?) It only crashes in optimize()...

TA_Lib by itself operates with standard arrays as input -so why limit this to series() in Zorro?

I don't understand the distinction you make on 'indicators' vs ... : TA_Lib provides 'functions', incl. some pretty common ones like MaxVal() or LinearRegSlope().

I am not calculating 'indicators' in optimize(). I would like to use measures based off equity curve (e.g. its slope) as a constituent of the train objective. Shall I write my own functions for that??

Re: Stat functions crashing in evaluate() [Re: Zheka] #486078
06/08/22 05:54
06/08/22 05:54
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
I am sure that you'll manage that, like any other user.

BTW, the crash was in fact a bug. It was supposed to print an error instead. This will be fixed.

It would help your cause when you explained why and for what strategy you have all those strange requests and issues. We did so far > 1200 systems and tools with Zorro, often very exotic, but never had to use a ta-lib indicator in result evaluation. But it can be still implemented if it serves any useful purpose.

Re: Stat functions crashing in evaluate() [Re: Zheka] #486079
06/08/22 10:59
06/08/22 10:59
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
I would like to use measures based off equity curve as a constituent of the train objective.

For that, I would like to use a min/max of a time series, linear reg slope, correlation, etc...elementary statistical functions..

Those happen to already be available in Zorro from TA_Lib.

TA_Lib inherently provides a list of functions, consuming standard arrays/pointers.

For some reason, you call them 'indicators' and only restricted their use to Zorro's 'series' objects (...but they actually work with std arrays in run(), but not in optimize())...

I really don't understand what's so 'indicatory' (and therefore 'strange' in your opinion) about linear regression or min/max of a series of values...

Re: Stat functions crashing in evaluate() [Re: Zheka] #486081
06/08/22 11:37
06/08/22 11:37
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Ok, but why are you not doing this in the EXITRUN?

Ta-lib functions need a special handling due to the reversed order of time series. That's why they cannot be arbitrarily called.

Re: Stat functions crashing in evaluate() [Re: Zheka] #486083
06/08/22 12:07
06/08/22 12:07
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784
I didn't know trade and strategy statistics are available already in the EXITRUN. Is there anything NOT available in EXITRUN compared to objective()?

If Zorro reverses the order of series() under the hood to get meaningful/expected results from TA_Lib functions, then a user can do the same manually when feeding an std array...but the functions can still work..

Re: Stat functions crashing in evaluate() [Re: Zheka] #486089
06/08/22 14:44
06/08/22 14:44
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Depends on what you mean with 'statistics'. There are no statistics in the exitrun. But all is there that you could use with ta-lib functions, like prices, series, equity curve, etc.

Re: Stat functions crashing in evaluate() [Re: Zheka] #486095
06/08/22 18:45
06/08/22 18:45
Joined: Jul 2017
Posts: 784
Z
Zheka Offline OP
User
Zheka  Offline OP
User
Z

Joined: Jul 2017
Posts: 784

Re: Stat functions crashing in evaluate() [Re: Zheka] #486106
06/09/22 09:16
06/09/22 09:16
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Winloss is available at any bar and derived values like R2, Ulcer, Mean, etc only in objective().

As a rule of thumb, any value that is calculated only once based on the complete data, is, obviously, only available after session end.

Page 1 of 2 1 2

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1