mjj38
- ago
https://towardsdatascience.com/ensemble-methods-in-machine-learning-what-are-they-and-why-use-them-68ec3f9fef5f

One of the ways to apply this to strategies is to simplify the results of a strategy to three states long, neutral, short. Say you have a great trend strategy (or a few trend strategies and you use a voting system for direction) and you apply a regime filter where the bias is based on the state of your trend strategy (i.e. ensemble strategy).

The building block would look like a condition block where you select a strategy(s)
3
832
8 Replies

Reply

Bookmark

Sort
- ago
#1
Let's first clarify what this thing is intended to do and how it should work. What's the difference from Metastrategy? What do those "three states" have to do with Blocks?
0
mjj38
- ago
#2
You simplify a strategy output to either Long = 1, Neutral = 0, Short = -1

Now think of it as just a condition where you can treat it as an indicator.
Example: [Strategy X] == [1 (or long)]

Extending it to the next step would be to say:
Example: Sum ([Strategy X], [Strategy Y], [Strategy Z]) >= 2

You can also think of this as a way to extend existing logic by making Strategies essentially a complicated condition.
1
- ago
#3
Thanks for the clarification. First thing, the binary wave idea doesn't seem to properly treat systems which take multiple positions.

My concern is that since Blocks cater mostly to folks who cannot code, this idea seems "overqualified" to fit the concept.

Those who possess coding skills can approach this with the help of the StrategyRunner class (which is covered in the QuickRef). At any rate, implementing this might take exposing a property in the StrategyRunner to access a system's binary wave in an easier manner.
0
mjj38
- ago
#4
QUOTE:
Thanks for the clarification. First thing, the binary wave idea doesn't seem to properly treat systems which take multiple positions.

Very true. It's more of a bias tool.

QUOTE:
My concern is that since Blocks cater mostly to folks who cannot code, this idea seems "overqualified" to fit the concept.

I think you are underestimating the use cases for building blocks. I never used this functionality in WL6, but I use the new building block functionality all the time. I am a decent programmer but I use building blocks because it's so quick and easy. I only code things now because either a) it can't be implemented in building blocks or b) I have a viable strategy and I want to source control and version the code.

Think how much coding it would entail to accomplish this through C# code. If this could be done through a drag and drop that would be amazing.

Another benefit to keeping strategies in the BB form would be as you create new efficiencies in the BB's themselves that would carry over automatically to all existing strategies.

If the ensemble functionality is too complex for BB then maybe it can be incorporated when/if the Machine Learning Strategy Evolver gets developed. That would be an easier fit as all it does is evolve a series of conditions.

Just food for thought ...
1
- ago
#5
From a technical standpoint, if this request is feasible then I'd envision things like:

a) exposing a property in the StrategyRunner to access the aggregate position of a system (the binary wave)
b) a strategy name picker not limited to only Blocks but listing all available strategies (excluding Untitled and itself)
0
Glitch8
 ( 11.81% )
- ago
#6
If/when this feature eventually gets implemented I'd see it being a part of our Power Pack, to shield less experienced users :)
0
Glitch8
 ( 11.81% )
- ago
#7
I'm not clear how this Ensemble Building Block would function. Say I'm backtesting on the Nasdaq 100. The Building Block would return "long" as long as I have at least one open position out of all the symbols?

Or is the idea that it would run the Strategy on each symbol and work on a symbol by symbol basis?
0
mjj38
- ago
#8
You can also think of it as a meta-indicator building block system. A combination of conditions that gets reused (essentially a strategy with a size of 1). Right now you have to recreate every condition group or create a custom indicator to accomplish the same thing.

QUOTE:
I'm not clear how this Ensemble Building Block would function. Say I'm backtesting on the Nasdaq 100. The Building Block would return "long" as long as I have at least one open position out of all the symbols??

It would act the same as a meta-condition block. It shouldn't be linked to specific symbols, just a set of conditions that make up the strategy. You should be able to run it on anything you want that makes sense.

Specifically, lets assume we are using the Dual Donchian Breakout as our ensemble strategy running on the SPY. The BB block criteria for the "buy at market" would be when the ensemble is long or if using multiple ensemble's when 2 out of 3 are long, etc.

QUOTE:
Or is the idea that it would run the Strategy on each symbol and work on a symbol by symbol basis?
I think you want to have the flexibility to do either.

There are a lot of uses, such as:
a) better regime / trend filter - If you have a very good trend system, it often acts as a great regime filter or trend filter for other strategies.
b) Say you have a dip buying strategy that is only in the market 20% of the time. You use the dip buyer as a ensemble condition where your new strategy only trades when the dip buyer isn't long(flat or short). There by utilizing your capital when it isn't being used.

This probably explains it better than I can.
https://www.amazon.com/Advances-Financial-Machine-Learning-Marcos-ebook/dp/B079KLDW21/ref=sr_1_1?keywords=Advances+in+Financial+Machine+Learning&qid=1637249172&qsid=137-4861929-2247524&sr=8-1&sres=1119482089%2C3030410676%2C1839217715%2C0578973839%2C1492032646%2C0691218706%2C1108792898%2C1800208863%2C1848168136%2CB07335JNW1%2C1492024333%2CB08R15M359%2C1118959167%2C0128156309%2CB07HCDTPVJ%2C1673289673&srpt=ABIS_BOOK

https://www.buildalpha.com/ensemble-2/
0

Reply

Bookmark

Sort