WealthScript: enhancement suggestions
Author: electricessence
Creation Date: 7/13/2017 4:01 PM
profile picture


I've been working on some useful abstractions that allow me to write much more expressive code in my scripts. It's a real time saver and the code reads much more fluidly than the repetitious Bars[i] everywhere.

One compliment I have is the Cache provided by bars and DataSeries. It does what I need it to do.

1) The first thing I would like to see happen with WealthLab and WealthScripts is PLEASE have Bars and DataSeries inherit from List<T> or at least implement IList<T> since the basic implementation is the same. Not sure why this wasn't this way in the first place.

That said, I've made extensions for AsEnumerable<T>() that work but it obviously is additional unnecessary overhead.

2) There needs to be a better way for the developer to 'play it safe' and not be concerned with 'cheating' accidentally. Either a 'protected' version of a WealthScript base class that 'feeds' bars to the strategy one at a time in a way that the consumer doesn't need to write their own for loop.
The abstractions I've been working on do a great job of handling this and making the code readable as if there is only one point in time (at a time) that you have access to (relatively). So instead of writing:

Please log in to see this code.

You write:
Please log in to see this code.

You can then write
Please log in to see this code.
, etc...

Would love to see an IObservable<BarSeriesPoint> or TPL.DataFlow implementation.

3) Along with IEnumerable<T> implementations and the Cache collection, I would love to see WealthLab go super lazy... Make it so that a strategy need not load any bars at all until requested and subsequently will render indicator data only as far back as needed to execute.

4) Finally, more parallelization. Processing data would be much easier to parallelize if properly implementing IEnumerable<T> or possibly TPL.DataFlow. But most important, allow scripts themselves to be easily spawned and tested in parallel.

Thanks. Looking forward to your comments.
I will eventually release the abstractions as open source when I get things nailed down but would be willing to preemptively do so if there was interest.

This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).