Portfolio Backtester Multiple commission rules per strategy?

Questions about MultiCharts and user contributed studies.
wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Portfolio Backtester Multiple commission rules per strategy?

Postby wilkinsw » 02 Aug 2013

Hi,

I wish to carry out an optimisation to find optimal inputs when applied to a basket of instruments.

I do not want to optimise each constituent instrument individually (Don't want multiple strategies, instruments and signals).

Therefore, the solution seems to be one strategy, multiple instruments and one signal.

However I can't see a way to define commission rules for each instrument under the one strategy.

Is there any way I can define each instruments commission rules whilst only optimising one signal's inputs?

Thanks!

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Portfolio Backtester Multiple commission rules per strat

Postby Andrew MultiCharts » 09 Aug 2013

Hello Wilkinsw,

If you have 1 strategy with 1 signal and a number of symbols to backtest, the commission rules will be common for each symbols, since commissions are configured for each strategy, not each signal/symbol.

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Portfolio Backtester Multiple commission rules per strat

Postby wilkinsw » 31 Jul 2014

Sorry, it's been a year. This is still something I need. In fact need it even more, hence I'm back here again! Is it part of the MC 9.0?

To reiterate........

I want to optimize one signal applied to a basket of instruments.

I need to specify slippage and commission for each constituent instrument, as they vary from each other.

I can't see a way of doing this.

Please advise.

Thanks

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Portfolio Backtester Multiple commission rules per strat

Postby Henry MultiСharts » 01 Aug 2014

Hello Wilkinsw,

Commission rules are configured per strategy. The only way to have individual commission per signal/symbol is creating individual strategies.

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Portfolio Backtester Multiple commission rules per strat

Postby wilkinsw » 01 Aug 2014

For a basket of 5 instruments:

If my signal has 5 inputs I want to optimise, then by having 5 seperate strategies, each with its own instrument, then.......

I'll have 25 optimisable inputs, no?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Portfolio Backtester Multiple commission rules per strat

Postby Henry MultiСharts » 01 Aug 2014

For a basket of 5 instruments:
If my signal has 5 inputs I want to optimise, then by having 5 seperate strategies, each with its own instrument, then.......
I'll have 25 optimisable inputs, no?
That is correct.

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Portfolio Backtester Multiple commission rules per strat

Postby wilkinsw » 01 Aug 2014

So using correct costs per instrument means I have to optimize 25 instead of 5 variables. From both a statistical and time point of view this will give a highly undesirable outcome.

Has this changed for the most current version of MC?

If not could you see why this is needed?

Slippage in particular varies greatly per instrument. If I run an optimization on a basket the results are as good as useless if I've simply used an average basket slippage assumption. The optimisation will incorrectly migrate towards an area that fully exploits the underestimated instrument and avoids the overestimated instrument.

It's a major flaw. Is a solution in the pipes??

Thanks.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Portfolio Backtester Multiple commission rules per strat

Postby Henry MultiСharts » 05 Aug 2014

So using correct costs per instrument means I have to optimize 25 instead of 5 variables. From both a statistical and time point of view this will give a highly undesirable outcome.
Has this changed for the most current version of MC?
If not could you see why this is needed?
Slippage in particular varies greatly per instrument. If I run an optimization on a basket the results are as good as useless if I've simply used an average basket slippage assumption. The optimisation will incorrectly migrate towards an area that fully exploits the underestimated instrument and avoids the overestimated instrument.
It's a major flaw. Is a solution in the pipes??
Thanks.
This behavior has not been changed in MultiCharts 9.0. At the moment changing that is not something that is in our to-do list, though this suggestion is a reasonable one. Please submit a feature request to the Project Management of our web site so other users can vote for it: https://www.multicharts.com/pm/

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Portfolio Backtester Multiple commission rules per strat

Postby wilkinsw » 05 Aug 2014

Please vote for the specified change to the portfolio backtester/optimizer:

http://www.multicharts.com/pm/viewissue ... no=MC-1708

User avatar
swz168
Posts: 120
Joined: 30 Sep 2010
Location: Germany
Has thanked: 47 times
Been thanked: 32 times

Re: Portfolio Backtester Multiple commission rules per strat

Postby swz168 » 06 Aug 2014

Thanks for the feature request. Commission rules at instrument level is a must have for portfolio trading and backtesting.

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Portfolio Backtester Multiple commission rules per strategy?

Postby wilkinsw » 27 Feb 2019

Please Please Please. Let's get this sorted MC:



If I have a basket of instruments in PT, with greatly varying tick values and volatilities, commissions etc, and one signal applied (which I'm optimizing), I need costs per fill to be instrument specific and not signal specific. Otherwise the optimization will be steered by any biases (will over aggressively trade the underestimated cost instrument and under trade the overestimated cost instrument).

I suggest either:

-add the costs section to the dropdown menu when the user right clicks each instrument (and this will override the strategy level costs specified).

-or allow the user to specify a factor of QM specified "instrument default costs" under strategy level "commission rule".

I prefer the first option personally.

There's just a few details that need sorting in PT to make it a great back testing tool. IMO these are: instrument specific commission rules (detailed here) and bar magnifier. Sort them both out and I'd be happy to pay extra for a premium version of PT!

https://www.multicharts.com/pm/public/m ... es/MC-1708

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Portfolio Backtester Multiple commission rules per strategy?

Postby wilkinsw » 27 Mar 2019

Multicharts?

You could just add some new keywords that allow commission to be set in the signal (and let it be additive to what is also specified in strategy properties [but the user would probably set the to zero if using keywords instead]):

Code: Select all

if symbol=xxxx then set_cost_per_contract=10
else if symbol=yyyy then set_cost_per_contract=10
else raiseruntimeerror("symbol not found!");
How easy will that be to implement? I would say that is is essential.

If MC really wanted to show off they could allow the user to set costs based on fill types:

Code: Select all

if symbol=xxxx then begin
set_resting_aggressor_cost_per_contract=10; {resting stop triggered and filled}
set_passive_cost_per_contract=2; {resting limit order filled}
set_nextbar_aggressor_cost_per_contract=15; {aggressor next bar fill (typically a market order, but could be a marketable limit or converted stop order too}
end else if symbol=yyyy then begin
set_global_cost_per_contract=10; {sets a default cost of a fill, should the fill subtypes not be specified by the user (as with symbol "xxxx")}
end else begin
raiseruntimeerror("symbol not found!");
end;


This way we can both accurately model instrument trading costs and strategy trading style costs and prevent a PT optimisation from being steered towards cost related biases.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Portfolio Backtester Multiple commission rules per strategy?

Postby Henry MultiСharts » 02 Apr 2019

Hello wilkinsw,

This improvement is not as trivial as it seems. Unfortunately at the moment we cannot fit it into our roadmap.

RockyLee
Posts: 2
Joined: 12 Sep 2017
Has thanked: 1 time
Been thanked: 2 times

Re: Portfolio Backtester Multiple commission rules per strategy?

Postby RockyLee » 03 Apr 2023

Hi there, I was looking for something else but I found your inquiry. I think there is a workaround if you want to do what you want (far from optimal but could work).

1- Create fist strategy in portfolio with first instrument - In this strategy you have the optimizable variable
2- Create second strategy in the same portfolio - this strategy is a copy of the first strategy but instead of using an input you use an external variable.

With the first strategy, you populate the external variable with the value of the optimized input. The second strategy use it after.
The only thing I'm not sure is if the optimizer will populate the external output at the right time for it to be used by the second strategy... might worth the shot

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Portfolio Backtester Multiple commission rules per strategy?

Postby wilkinsw » 03 Apr 2023

Hi there, I was looking for something else but I found your inquiry. I think there is a workaround if you want to do what you want (far from optimal but could work).

1- Create fist strategy in portfolio with first instrument - In this strategy you have the optimizable variable
2- Create second strategy in the same portfolio - this strategy is a copy of the first strategy but instead of using an input you use an external variable.

With the first strategy, you populate the external variable with the value of the optimized input. The second strategy use it after.
The only thing I'm not sure is if the optimizer will populate the external output at the right time for it to be used by the second strategy... might worth the shot
I'm not following what this has to do with changing commission rules behavior in Portfolio trader, as per the OP?


Return to “MultiCharts”