From 852924c4e05f1a9cf515de91af27a861abf29279 Mon Sep 17 00:00:00 2001 From: Matteo Zanetti <97408052+matteozanettii@users.noreply.github.com> Date: Tue, 22 Sep 2026 16:28:03 +0200 Subject: [PATCH 1/5] Add zscoreFS function signature with inputs and outputs --- toolbox/utilities/functionSignatures.json | 78 +++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/toolbox/utilities/functionSignatures.json b/toolbox/utilities/functionSignatures.json index 0545b392d..b42737e5d 100644 --- a/toolbox/utilities/functionSignatures.json +++ b/toolbox/utilities/functionSignatures.json @@ -338,5 +338,83 @@ "purpose": "Table of fundamental company information" } ] + }, + "zscoreFS": { + "inputs": [ + { + "name": "X", + "kind": "required", + "type": [ + "numeric", + "table" + ], + "purpose": "Input data. Vector, Matrix, 3D array or table" + }, + { + "name": "loc", + "kind": "optional", + "type": [ + [ + "char", + "choices={'median','mean'}" + ], + [ + "string", + "choices={'median','mean'}" + ] + ], + "purpose": "Location measure to use ('median' or 'mean')" + }, + { + "name": "scale", + "kind": "optional", + "type": [ + [ + "char", + "choices={'mad','Qn','Sn','std','modmadp'}" + ], + [ + "string", + "choices={'mad','Qn','Sn','std','modmadp'}" + ] + ], + "purpose": "Scale measure to use" + }, + { + "name": "dim", + "kind": "optional", + "type": [ + "numeric", + "scalar", + "integer", + ">=1" + ], + "purpose": "Dimension to operate along" + } + ], + "outputs": [ + { + "name": "Z", + "type": [ + "numeric", + "table" + ], + "purpose": "Centered and scaled version of X" + }, + { + "name": "mu", + "type": [ + "numeric" + ], + "purpose": "Location estimate" + }, + { + "name": "sigma", + "type": [ + "numeric" + ], + "purpose": "Scale estimate" + } + ] } } From 09ea3cf5ae015719ddf6bf3cb468c086e0eb9822 Mon Sep 17 00:00:00 2001 From: Matteo Zanetti <97408052+matteozanettii@users.noreply.github.com> Date: Wed, 23 Sep 2026 15:40:36 +0200 Subject: [PATCH 2/5] Refactor function signatures in JSON Updated parameter 'kind' from 'optional' to 'ordered' for multiple entries and changed type from 'numeric' to 'double'. Also fixed the function signatures errors from zscore --- toolbox/utilities/functionSignatures.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/toolbox/utilities/functionSignatures.json b/toolbox/utilities/functionSignatures.json index b42737e5d..d9548e2e6 100644 --- a/toolbox/utilities/functionSignatures.json +++ b/toolbox/utilities/functionSignatures.json @@ -345,14 +345,14 @@ "name": "X", "kind": "required", "type": [ - "numeric", + "double", "table" ], "purpose": "Input data. Vector, Matrix, 3D array or table" }, { "name": "loc", - "kind": "optional", + "kind": "ordered", "type": [ [ "char", @@ -367,7 +367,7 @@ }, { "name": "scale", - "kind": "optional", + "kind": "ordered", "type": [ [ "char", @@ -382,9 +382,9 @@ }, { "name": "dim", - "kind": "optional", + "kind": "ordered", "type": [ - "numeric", + "double", "scalar", "integer", ">=1" @@ -396,7 +396,7 @@ { "name": "Z", "type": [ - "numeric", + "double", "table" ], "purpose": "Centered and scaled version of X" @@ -404,14 +404,14 @@ { "name": "mu", "type": [ - "numeric" + "double" ], "purpose": "Location estimate" }, { "name": "sigma", "type": [ - "numeric" + "double" ], "purpose": "Scale estimate" } From 28f7cdf5acaae92cb075b9a94e488afcb7126830 Mon Sep 17 00:00:00 2001 From: Matteo Zanetti <97408052+matteozanettii@users.noreply.github.com> Date: Thu, 24 Sep 2026 17:17:43 +0200 Subject: [PATCH 3/5] Simplify type definitions in functionSignatures.json Removed redundant array structure for type definitions in function signatures. --- toolbox/utilities/functionSignatures.json | 127 ++++++---------------- 1 file changed, 31 insertions(+), 96 deletions(-) diff --git a/toolbox/utilities/functionSignatures.json b/toolbox/utilities/functionSignatures.json index d9548e2e6..2f68bb148 100644 --- a/toolbox/utilities/functionSignatures.json +++ b/toolbox/utilities/functionSignatures.json @@ -6,14 +6,9 @@ "name": "market", "kind": "namevalue", "type": [ - [ - "char", - "choices={'Nasdaq','SP500','NYSE','FTSEMIB','London','DAX40','CAC40','Nikkei225'}" - ], - [ - "string", - "choices={'Nasdaq','SP500','NYSE','FTSEMIB','London','DAX40','CAC40','Nikkei225'}" - ] + "char", + "string", + "choices={'Nasdaq','SP500','NYSE','FTSEMIB','London','DAX40','CAC40','Nikkei225'}" ], "purpose": "Market or index name" }, @@ -31,14 +26,9 @@ "name": "Source", "kind": "namevalue", "type": [ - [ - "char", - "choices={'static','dynamic'}" - ], - [ - "string", - "choices={'static','dynamic'}" - ] + "char", + "string", + "choices={'static','dynamic'}" ], "purpose": "Source used to build the market universe" }, @@ -86,15 +76,9 @@ "name": "ticker", "kind": "required", "type": [ - [ - "char" - ], - [ - "string" - ], - [ - "cellstr" - ] + "char", + "string", + "cellstr" ], "purpose": "Ticker symbol or collection of ticker symbols" }, @@ -102,14 +86,9 @@ "name": "LastPeriod", "kind": "namevalue", "type": [ - [ - "char", - "choices={'1d','5d','1mo','3mo','6mo','1y','2y','5y','10y','ytd','max'}" - ], - [ - "string", - "choices={'1d','5d','1mo','3mo','6mo','1y','2y','5y','10y','ytd','max'}" - ] + "char", + "string", + "choices={'1d','5d','1mo','3mo','6mo','1y','2y','5y','10y','ytd','max'}" ], "purpose": "Time span to download" }, @@ -117,14 +96,9 @@ "name": "interval", "kind": "namevalue", "type": [ - [ - "char", - "choices={'1m','2m','5m','15m','30m','60m','90m','1h','1d','5d','1wk','1mo','3mo'}" - ], - [ - "string", - "choices={'1m','2m','5m','15m','30m','60m','90m','1h','1d','5d','1wk','1mo','3mo'}" - ] + "char", + "string", + "choices={'1m','2m','5m','15m','30m','60m','90m','1h','1d','5d','1wk','1mo','3mo'}" ], "purpose": "Sampling interval requested to Yahoo Finance" }, @@ -173,21 +147,15 @@ "type": [ [ "char", - "choices={'candle','line','ma','boll'}" - ], - [ "string", "choices={'candle','line','ma','boll'}" ], [ "struct", - "scalar", - "field Name required", - "Name choices={'candle','line','ma','boll'}", - "admissible fields depend on Name: candle->{Name,widthFactor,upColor,downColor}; line->{Name}; ma->{Name,maFastLen,maMidLen,maSlowLen,showMACrossovers}; boll->{Name,bollWindow,bollNumStd}" + "scalar" ] ], - "purpose": "Type of plot in the top panel; \n when supplied as a struct, \n it also controls the suboptions associated with the selected visualization" + "purpose": "Type of plot in the top panel; when supplied as a struct, it also controls suboptions (field Name required). Admissible fields: candle->{Name,widthFactor,upColor,downColor}; line->{Name}; ma->{Name,maFastLen,maMidLen,maSlowLen,showMACrossovers}; boll->{Name,bollWindow,bollNumStd}" }, { "name": "bottomPanelMode", @@ -195,21 +163,15 @@ "type": [ [ "char", - "choices={'rsi','stoch','macd','williamsr','roc'}" - ], - [ "string", "choices={'rsi','stoch','macd','williamsr','roc'}" ], [ "struct", - "scalar", - "field Name required", - "Name choices={'rsi','stoch','macd','williamsr','roc'}", - "admissible fields depend on Name: rsi->{Name,topRSI,lowRSI,rsiLen}; stoch->{Name,topStoch,lowStoch,stochLen,stochSmooth}; macd->{Name,macdFastLen,macdSlowLen,macdSigLen}; williamsr->{Name,topWilliams,lowWilliams,wrLen}; roc->{Name,rocLen}" + "scalar" ] ], - "purpose": "Indicator shown in the bottom panel; when supplied as a struct, it also controls the suboptions associated with the selected indicator" + "purpose": "Indicator shown in the bottom panel; when supplied as a struct, it also controls suboptions (field Name required). Admissible fields: rsi->{Name,topRSI,lowRSI,rsiLen}; stoch->{Name,topStoch,lowStoch,stochLen,stochSmooth}; macd->{Name,macdFastLen,macdSlowLen,macdSigLen}; williamsr->{Name,topWilliams,lowWilliams,wrLen}; roc->{Name,rocLen}" }, { "name": "showPanelHelp", @@ -264,15 +226,9 @@ "name": "ticker", "kind": "required", "type": [ - [ - "char" - ], - [ - "string" - ], - [ - "cellstr" - ] + "char", + "string", + "cellstr" ], "purpose": "Ticker symbol or collection of ticker symbols" }, @@ -280,14 +236,9 @@ "name": "RankBy", "kind": "namevalue", "type": [ - [ - "char" , - "choices={'marketCap','trailingPE','forwardPE','priceToBook','beta','enterpriseValue','profitMargins','returnOnEquity','returnOnAssets','totalRevenue'}" - ], - [ - "string" , - "choices={'marketCap','trailingPE','forwardPE','priceToBook','beta','enterpriseValue','profitMargins','returnOnEquity','returnOnAssets','totalRevenue'}" - ] + "char", + "string", + "choices={'marketCap','trailingPE','forwardPE','priceToBook','beta','enterpriseValue','profitMargins','returnOnEquity','returnOnAssets','totalRevenue'}" ], "purpose": "Numeric variable used to rank rows in descending order" }, @@ -301,9 +252,6 @@ ], [ "char", - "choices={'all','basic','valuation','performance'}" - ], - [ "string", "choices={'all','basic','valuation','performance'}" ] @@ -316,9 +264,6 @@ "type": [ [ "char", - "choices={'all','basic','valuation','performance'}" - ], - [ "string", "choices={'all','basic','valuation','performance'}" ], @@ -354,14 +299,9 @@ "name": "loc", "kind": "ordered", "type": [ - [ - "char", - "choices={'median','mean'}" - ], - [ - "string", - "choices={'median','mean'}" - ] + "char", + "string", + "choices={'median','mean'}" ], "purpose": "Location measure to use ('median' or 'mean')" }, @@ -369,14 +309,9 @@ "name": "scale", "kind": "ordered", "type": [ - [ - "char", - "choices={'mad','Qn','Sn','std','modmadp'}" - ], - [ - "string", - "choices={'mad','Qn','Sn','std','modmadp'}" - ] + "char", + "string", + "choices={'mad','Qn','Sn','std','modmadp'}" ], "purpose": "Scale measure to use" }, From e50bdd13b1599b52ad89c21dcd180dff981f595e Mon Sep 17 00:00:00 2001 From: Matteo Zanetti <97408052+matteozanettii@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:36:31 +0200 Subject: [PATCH 4/5] Refactor function signatures to use array syntax, AND OR Logic fixed --- toolbox/utilities/functionSignatures.json | 121 +++++++++------------- 1 file changed, 51 insertions(+), 70 deletions(-) diff --git a/toolbox/utilities/functionSignatures.json b/toolbox/utilities/functionSignatures.json index 2f68bb148..cdbbbac7f 100644 --- a/toolbox/utilities/functionSignatures.json +++ b/toolbox/utilities/functionSignatures.json @@ -6,9 +6,9 @@ "name": "market", "kind": "namevalue", "type": [ - "char", - "string", - "choices={'Nasdaq','SP500','NYSE','FTSEMIB','London','DAX40','CAC40','Nikkei225'}" + ["char"], + ["string"], + ["choices={'Nasdaq','SP500','NYSE','FTSEMIB','London','DAX40','CAC40','Nikkei225'}"] ], "purpose": "Market or index name" }, @@ -26,9 +26,9 @@ "name": "Source", "kind": "namevalue", "type": [ - "char", - "string", - "choices={'static','dynamic'}" + ["char"], + ["string"], + ["choices={'static','dynamic'}"] ], "purpose": "Source used to build the market universe" }, @@ -76,9 +76,9 @@ "name": "ticker", "kind": "required", "type": [ - "char", - "string", - "cellstr" + ["char"], + ["string"], + ["cellstr"] ], "purpose": "Ticker symbol or collection of ticker symbols" }, @@ -86,9 +86,9 @@ "name": "LastPeriod", "kind": "namevalue", "type": [ - "char", - "string", - "choices={'1d','5d','1mo','3mo','6mo','1y','2y','5y','10y','ytd','max'}" + ["char"], + ["string"], + ["choices={'1d','5d','1mo','3mo','6mo','1y','2y','5y','10y','ytd','max'}"] ], "purpose": "Time span to download" }, @@ -96,9 +96,9 @@ "name": "interval", "kind": "namevalue", "type": [ - "char", - "string", - "choices={'1m','2m','5m','15m','30m','60m','90m','1h','1d','5d','1wk','1mo','3mo'}" + ["char"], + ["string"], + ["choices={'1m','2m','5m','15m','30m','60m','90m','1h','1d','5d','1wk','1mo','3mo'}"] ], "purpose": "Sampling interval requested to Yahoo Finance" }, @@ -145,33 +145,23 @@ "name": "topPanelMode", "kind": "namevalue", "type": [ - [ - "char", - "string", - "choices={'candle','line','ma','boll'}" - ], - [ - "struct", - "scalar" - ] - ], - "purpose": "Type of plot in the top panel; when supplied as a struct, it also controls suboptions (field Name required). Admissible fields: candle->{Name,widthFactor,upColor,downColor}; line->{Name}; ma->{Name,maFastLen,maMidLen,maSlowLen,showMACrossovers}; boll->{Name,bollWindow,bollNumStd}" + ["char"], + ["string"], + ["choices={'candle','line','ma','boll'}"], + ["struct", "scalar"] + ], + "purpose": "Type of plot in the top panel; when supplied as a struct, it also controls the suboptions associated with the selected visualization" }, { "name": "bottomPanelMode", "kind": "namevalue", "type": [ - [ - "char", - "string", - "choices={'rsi','stoch','macd','williamsr','roc'}" - ], - [ - "struct", - "scalar" - ] - ], - "purpose": "Indicator shown in the bottom panel; when supplied as a struct, it also controls suboptions (field Name required). Admissible fields: rsi->{Name,topRSI,lowRSI,rsiLen}; stoch->{Name,topStoch,lowStoch,stochLen,stochSmooth}; macd->{Name,macdFastLen,macdSlowLen,macdSigLen}; williamsr->{Name,topWilliams,lowWilliams,wrLen}; roc->{Name,rocLen}" + ["char"], + ["string"], + ["choices={'rsi','stoch','macd','williamsr','roc'}"], + ["struct", "scalar"] + ], + "purpose": "Indicator shown in the bottom panel; when supplied as a struct, it also controls the suboptions associated with the selected indicator" }, { "name": "showPanelHelp", @@ -226,9 +216,9 @@ "name": "ticker", "kind": "required", "type": [ - "char", - "string", - "cellstr" + ["char"], + ["string"], + ["cellstr"] ], "purpose": "Ticker symbol or collection of ticker symbols" }, @@ -236,9 +226,9 @@ "name": "RankBy", "kind": "namevalue", "type": [ - "char", - "string", - "choices={'marketCap','trailingPE','forwardPE','priceToBook','beta','enterpriseValue','profitMargins','returnOnEquity','returnOnAssets','totalRevenue'}" + ["char"], + ["string"], + ["choices={'marketCap','trailingPE','forwardPE','priceToBook','beta','enterpriseValue','profitMargins','returnOnEquity','returnOnAssets','totalRevenue'}"] ], "purpose": "Numeric variable used to rank rows in descending order" }, @@ -246,15 +236,10 @@ "name": "ExplainFields", "kind": "namevalue", "type": [ - [ - "logical", - "scalar" - ], - [ - "char", - "string", - "choices={'all','basic','valuation','performance'}" - ] + ["logical", "scalar"], + ["char"], + ["string"], + ["choices={'all','basic','valuation','performance'}"] ], "purpose": "Display explanation of available fields or presets" }, @@ -262,14 +247,10 @@ "name": "Fields", "kind": "namevalue", "type": [ - [ - "char", - "string", - "choices={'all','basic','valuation','performance'}" - ], - [ - "cellstr" - ] + ["char"], + ["string"], + ["choices={'all','basic','valuation','performance'}"], + ["cellstr"] ], "purpose": "Field preset or custom list of output variables" } @@ -290,8 +271,8 @@ "name": "X", "kind": "required", "type": [ - "double", - "table" + ["double"], + ["table"] ], "purpose": "Input data. Vector, Matrix, 3D array or table" }, @@ -299,9 +280,9 @@ "name": "loc", "kind": "ordered", "type": [ - "char", - "string", - "choices={'median','mean'}" + ["char"], + ["string"], + ["choices={'median','mean'}"] ], "purpose": "Location measure to use ('median' or 'mean')" }, @@ -309,9 +290,9 @@ "name": "scale", "kind": "ordered", "type": [ - "char", - "string", - "choices={'mad','Qn','Sn','std','modmadp'}" + ["char"], + ["string"], + ["choices={'mad','Qn','Sn','std','modmadp'}"] ], "purpose": "Scale measure to use" }, @@ -331,8 +312,8 @@ { "name": "Z", "type": [ - "double", - "table" + ["double"], + ["table"] ], "purpose": "Centered and scaled version of X" }, From e5b98206e901f23acd3b8269d6b76ab2233f46bb Mon Sep 17 00:00:00 2001 From: Giacomo Boschi <119525078+BoschiGiacomo@users.noreply.github.com> Date: Tue, 29 Sep 2026 19:35:01 +0200 Subject: [PATCH 5/5] Remove 'modmadp' placeholder from zscoreFS scale choices --- toolbox/utilities/functionSignatures.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolbox/utilities/functionSignatures.json b/toolbox/utilities/functionSignatures.json index cdbbbac7f..48e8a955e 100644 --- a/toolbox/utilities/functionSignatures.json +++ b/toolbox/utilities/functionSignatures.json @@ -292,7 +292,7 @@ "type": [ ["char"], ["string"], - ["choices={'mad','Qn','Sn','std','modmadp'}"] + ["choices={'mad','Qn','Sn','std'}"] ], "purpose": "Scale measure to use" },