Need setting commission and slippage for individual futures in Portfolio Trader

Questions about MultiCharts and user contributed studies.
regtracer
Posts: 28
Joined: 28 Dec 2016
Been thanked: 2 times

Need setting commission and slippage for individual futures in Portfolio Trader

Postby regtracer » 13 May 2019

Hello,

I'm testing a portfolio of futures in Portfolio Trader but found that the current commission and slippage settings are not sufficient to produce correct backtest results. For example, a future contract IF traded on CFFEX has a commission of CNY 30 per contract, and an assumed slippage of 2 ticks=120 CNY, while another future contract RB also traded on SHFE has a commission of CNY 5 per contract and a slippage of 1 tick=5 CNY. I can't set them as single values in the current simplified commission and slippage GUI settings.

I hope there would be an API such as set_commission(...) and set_slippage(...) so that we can set these values in code. In this way we don't need to mess up with the GUI but get the greatest flexibility.

regtracer
Posts: 28
Joined: 28 Dec 2016
Been thanked: 2 times

Re: Need setting commission and slippage for individual futures in Portfolio Trader

Postby regtracer » 13 May 2019

By the way, this functionality is also needed for testing a mixed portfolio of futures, stocks, and/or forex.

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

Re: Need setting commission and slippage for individual futures in Portfolio Trader

Postby wilkinsw » 13 May 2019

Hi Regtracer,

What you're requesting is one of the most popular feature requests. I think it's essential too.

MC say it's too big a task to implement. Maybe they should launch a crowd funding solution to the raise the funds to make these vital improvements!

Also note that there is no Bar Magnifier in PT too; so make sure you don't use stop losses that are too close to a stop entry (as an example) as PT will overestimate the frequency with which you don't get stopped out. Always cross validate PT performance reports in MC with BM on for individual symbols.

viewtopic.php?t=41963

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

regtracer
Posts: 28
Joined: 28 Dec 2016
Been thanked: 2 times

Re: Need setting commission and slippage for individual futures in Portfolio Trader

Postby regtracer » 13 May 2019

Yeah, it's essential for accurate portfolio backtesting. The commission rates of China's future markets also vary. Some are defined as fixed amount per contract, while others are defined as a percentage of traded value.

Quantopian allows setting slippage and commission per bar to even account for the impact of volatility.

Please provide two API in the code:

set_commission(...)
set_slippage(...)

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

Re: Need setting commission and slippage for individual futures in Portfolio Trader

Postby wilkinsw » 18 May 2019


Quantopian allows setting slippage and commission per bar to even account for the impact of volatility.
How? Would you mind detailing it please?

I think one should set commission and then set slippage costs based on fill type at the top of a signal's code. Multicharts, in turn should recognise the respective fill types:

Code: Select all

set_commission=2

e.g. if assuming resting limit filled on touch:

Code: Select all

set_passive_slippage=15


e.g. if assuming resting limit filled if next price is touched and trading a thick depth instrument:

Code: Select all

set_passive_slippage=-5
e.g. if sending a market order next bar increased probability of crossing the spread vs filled at last traded:

Code: Select all

set_nextbar_aggressor_slippage=15
e.g. if a resting stop is triggered and executed; in many products this will result in a fill at last traded price most of the time.

Code: Select all

set_resting_aggressor_slippage=5

The values shown are for illustrative purposes only. You could then build a function which outputs what these values should be depending on the instrument being tested on. Insert that function in the signal's code and the place the outputted variables in place of the values shown above and you're good to go!

Will put an end to gaming a PT optimisation based on overly optimistic/pessimistic trading costs! (Well..... we would need Bar Magnifier too for that ; ) )

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

Re: Need setting commission and slippage for individual futures in Portfolio Trader

Postby wilkinsw » 05 Nov 2019

Multicharts...would be great for an update please.

Just to re emphasize how daft the current PT commission setup is.....

If i've got a mix of USD and JPY denominated products in PT with a communal commission of $10 then that will show as a 10JPY commission for a JPY product, instead of c. 1100jpy!!

Let's get this sorted please. Bare minimum; communal commission and slippage should be converted to portfolio currency!!

amadeu1
Posts: 67
Joined: 11 Feb 2008
Has thanked: 1 time
Been thanked: 6 times

Re: Need setting commission and slippage for individual futures in Portfolio Trader

Postby amadeu1 » 26 Nov 2019

I think we need this slippage setting NOW ....for futures trading especially . Its vital when you create a futures portfolio. How can the Bobl slippage be the same as the Coffee Slippage ? Obviously the tick size alone and the minmove are two factors that have huge influence on slippage. I have been trading many years and I know the average slippage for a S&P futures limit order for example.

It would be even better if you had the chance to encode two different slippages -- the slippages for limit orders are very different than for stop orders. So would be good to have also. But most important is to finally get different slippage settings for different markets in portfoliotrader


Return to “MultiCharts”