- ago
Hello,

Forgive me if I am posting something someone else has already posted. I am new (sort of) to Wealth-Lab and was curious about something.

Is it possible to create our own extensions for WL8?

I see that there is a Deep Learning extension now (linked below): 

https://www.wealth-lab.com/Discussion/WealthLab-Deep-Learning-12220

One thing I don't see in any of the extension lists is a feature testing functionality. I've got a small suite of tools I made in Python (bleh) for testing the statistical soundness of features. This is really helpful in designing custom features (indicators) or just testing any of the standard indicators. It lets you know about basic stats, tests mutual information, mean breaks, and helps to look for where the most valuable information in the feature exists (if any).

I would love to be able to rebuild this in C# for use in Wealth-Lab. However, I wasn't able to find anything on this with my rapid search in the discussions and FAQ.

Any help would be greatly appreciated.

Regards,
atariaf
0
466
Solved
13 Replies

Reply

Bookmark

Sort
- ago
#1
I see the extension API now.
0
Glitch8
 ( 6.11% )
- ago
#2
That sounds very interesting! Check the WL8 Client Extension, which would let you create your own full-fledged extension tool that would appear in the Extensions menu. We tried to document as much as possible but feel free to reach out with any questions.

https://www.wealth-lab.com/Support/ExtensionApi/WealthLabClientExtension
1
Best Answer
- ago
#3
Guess it's time to get a C# LSP for my text editor and dig in. This should be fun.
0
Cone8
 ( 2.67% )
- ago
#4
fwiw, Indicator extensions available:
https://www.wealth-lab.com/extension/detail/IndicatorProfiler
https://www.wealth-lab.com/extension/detail/finantic.IndicatorSelection
0
- ago
#5
QUOTE:
statistical soundness of features.


Have a look at the finantic.IndicatorSelection extension. I think that one comes close...
0
- ago
#6
QUOTE:
suite of tools I made in Python for testing the statistical soundness of features. This is really helpful in designing custom features (indicators) or just testing any of the standard indicators.

If you're looking for a numerical analysis library, check out https://numerics.mathdotnet.com/

And that library will do simple statistics (mean, std dev, percentile, quartiles) out of the box. Now if you want to do statistical testing, then I would recommend a stat package, but that's another topic.
1
- ago
#7
I saw the Math.NET. That looks like it would be good for the simple stuff. Do you know of any stat packages? I wrote my own Mutal information, relative entropy, and mean break tests in Python (following the Timothy Masters methods in his book "Statistically Sound Indicators for Financial Market Prediction). I am sure I can rewrite them in C#, and I probably will, but it would be cool if there was something like sklearn for C#.
0
- ago
#8
QUOTE:
Do you know of any stat packages?

And exactly what statistical analyses are you looking to do?

I'm been thinking about a discriminate analysis from the Symbols Ranking tab against select ScoreCard metrics. I'm also looking at an all-possible-subset multi-variant regression analysis (also on ScoreCard metrics), but that's a lower priority.

Most of the WL metrics can be copied onto the Windows Clipboard. From there, most stat packages can read these stats in (just like Excel does).

Now if you want two-way communication between WL and the stat package, then I would look at R.NET, but I haven't used it in that capacity. I'm not even sure R.NET has been upgraded to .NET 8.0 yet. But check out https://www.wealth-lab.com/Discussion/Using-the-R-statistics-program-with-WL-7247
0
- ago
#9
I am just looking to recreate the statistical soundness checks from that book I mentioned. Its basic stats (range, range iqr, etc) then mutaul information between target and feature/s, relative entropy, and mean break tests. Not too complicated in the grand scheme of things, but they are nice to have when developing indicators and then testing them for soundness.

Basically, it's a good way to get a read on an indicator's possible predictive power against a specific target or group of targets (SPY, QQQ, whatever). It also checks that the indicator itself doesn't suffer any major breaks in its mean.

Another portion of the tool I created in python actually measures the close-to-close (ctc) returns against an indicator's fractals. This is really helpful in discovering where the most valuable information in an indicator lies (spoiler, it's usually in the tails of the indicators) by giving you a table of ctc profit factor above and below the fractal point. This is a pretty simple optimization table.

The part that gets computationally heavy is adding in permutations tests to get solo/unbiased p-vals to see whether or not the information obtained from the test is likely random chance or not.

I don't believe it would need two-way communication. It is pretty simple in nature. Just sound testing indicators and looking for predictive power.
0
- ago
#10
QUOTE:
adding in permutations tests to get solo/unbiased p-vals to see whether or not the information obtained from the test is likely random chance or not.

If you can express your testing method into a multi-variant linear equation (and I suspect you can), you can use stepwise regression to test each term in that equation. The process performs a "contrasting" F-test (including, then excluding each term) and returns a P (of significance) for each term. This is done automatically, so you have limited steering control with most packages.

Most stat packages support some form of stepwise linear regression.
0
- ago
#11
Yeah, but I think that method would assume a normal distribution and a linear relationship. I try to account for the serial correllation in financial time series data and the permutation tests help avoid false positives against markets that have inherent autocorrelation and regime changes. 🤷🏼‍♂️

Sure doesn't help development time, though. Ha
0
- ago
#12
QUOTE:
I think that method would assume a normal distribution and a linear relationship.

The contrasting F-test does assume a normal distribution of random error, so it would be invalid for a Sharpe Ratio term because its error is highly skewed. And yes, you are summing the individual terms, so there's some assumption of linearity there.

But the stepwise process will give you a contrasting P for each individual term, which is what you're after. It's just the overall model, which assumes linearity (since we are summing terms) may not apply. You just need to ignore the P for the overall model.

It might be interesting to see how linear the individual terms are to each other. You could test for that. And if they aren't linear out of the box, you could transform them (e.g. say take their derivative once or twice) until they become linear, then fit that differential model. I suppose that would make this a full research project. :-)

QUOTE:
tests [to] help avoid false positives against markets that have inherent autocorrelation

Hmm. So you hold positions for the long-term as an investor, not a trader. I didn't appreciate that.
0
- ago
#13
I understand what you mean about the step wise tests. The tests I want to code (looks like I will have to code them after all) are just designed to tell me whether or not to have confidence in their results.

I'm not sure about the investor/trader part. I definitely would classify myself as a trader. 🤣

The permutation tests are just testing the test results. All financial data and the indicators created with them are inherently correlated. The permutation tests just use a series correlated permutation method (to keep the integrity of the time series data intact) and retest them (sometimes thousand of times) and produce a p-val to help determine how likely the test results are due to random chance or if there is a statistical significance to the results. That's all.

It's also a good set of tools to help with designing stationary indicators. The less they deviate from their own mean, the easier it is for ML models to pull information from them without the worry of outlier events really messing up their results.

Also, idk if this time stamps or not, but in responding to this at 0150 thanks to my toddler waking up and needing a hand back to sleep. I may have misread or misspoke about something. 🤣
0

Reply

Bookmark

Sort