- ago
Is it possible to optimize advanced position sizer parameters? Or how to make them optimizable like "Percent" or "Max Open Pos"?
I am using MaxEntriesPerBar advanced position sizer and want to backtest "Max Entries" parameter (I think that it's same as "Max Entry Signals" param, whitch is not configurable for optimization) and I don't know how to make it optimazable.
Maybe there is kind of workaround to backtest position sizing parameters?
Pls help
0
193
Solved
9 Replies

Reply

Bookmark

Sort
- ago
#1
Yes, this is a limitation: PosSizer's parameters cannot be optimized.
0
- ago
#2
The problem I'm trying to solve is that for example I'm using a percent of equity position size and limit order strategy. I use 20% of equity per position and recieve 200 limit signals. It's not possible to open 200 limit orders on Binance with 20% of equity per limit order - it's only possible to open 5 limit orders (100% / 20%). So I want to backtest whats the optimum amount of signals per bar for the strategy (amount of signals automatically determines position size in percents and visa versa). Is there any way I can do it?
0
- ago
#3
As for a workaround, maybe with some C# knowledge you could pass a custom PositionSize to a StrategyOptimizer instance?
0
- ago
#4
QUOTE:
As for a workaround, maybe with some C# knowledge you could pass a custom PositionSize to a StrategyOptimizer instance?


I can do it. But from whitch class?

It's really not obvious for me yet how everything is organized in Wealthlab. There is documentation about classes and modules on it's own... But the big picture article on how the clases relate betwen each other - can't understand it yet... Maybe you can advice me some kind of helpfull article describing wealthlab architecture? Thank you in advance!
1
- ago
#5
Sorry if I wasn't clear. I purported that it might be done from your WealthScript (C#) Strategy. Here's relevant reading on the Strategy architecture: Anatomy of a Wealth-Lab Strategy
0
Cone8
 ( 23.52% )
- ago
#6
QUOTE:
I want to backtest whats the optimum amount of signals per bar for the strategy (amount of signals automatically determines position size in percents and visa versa).
Use StrategyRunner.PerformOptimization(). Look for the Build 45 highlights reel for a demonstration. https://youtu.be/0M174KVKGbA You'll need to modify your strategy to manage the number of signals per bar and create an optimization variable for that. Further, you'll need a way to prioritize your limit signals in an a-priori way, like calculating percent from trigger price.

If it's just for this one test, you'll probably get this done more more quickly if you just "manually optimize" Max Entry Signals by running it 10 or 20 times with different values. If you do it that way, you'll still need a way to prioritize your limit signals, but you only have to assign the value to Transaction.Weight.
1
- ago
#7
QUOTE:
Use StrategyRunner.PerformOptimization(). Look for the Build 45 highlights reel for a demonstration. You'll need to modify your strategy to manage the number of signals per bar and create an optimization variable for that. Further, you'll need a way to prioritize your limit signals in an a-priori way, like calculating percent from trigger price.

Thank you!
QUOTE:
If it's just for this one test, you'll probably get this done more more quickly if you just "manually optimize" Max Entry Signals by running it 10 or 20 times with different values. If you do it that way, you'll still need a way to prioritize your limit signals, but you only have to assign the value to Transaction.Weight.

I'm not looking for easy ways ))
Discovering Wealthlab and have a lot of joy while doing it !!!
0
- ago
#8
QUOTE:
You'll need to modify your strategy to manage the number of signals per bar and create an optimization variable for that

I found a PostExecute method in UserStrategyBase and I am trying to access all transactions list from it to filter them there. I found all transaction list in Backtester class - public List<Transaction> Orders. Possibly I can delete some excess transactions from this list. Also I have found Signals list in StrategyBase class which is not documented. Whitch list should I use Bactester.Orders or StrategyBase.Signals (undocumented) to delete excess signals?
0
Cone8
 ( 23.52% )
- ago
#9
Correct, delete the Transactions from Backtester.Orders.

There's an example in this thread how to prune signals -
https://www.wealth-lab.com/Discussion/How-to-limit-signals-sent-to-C2-8377
1
Best Answer

Reply

Bookmark

Sort