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.
Need setting commission and slippage for individual futures in Portfolio Trader
Re: Need setting commission and slippage for individual futures in Portfolio Trader
By the way, this functionality is also needed for testing a mixed portfolio of futures, stocks, and/or forex.
Re: Need setting commission and slippage for individual futures in Portfolio Trader
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
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
Re: Need setting commission and slippage for individual futures in Portfolio Trader
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(...)
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(...)
Re: Need setting commission and slippage for individual futures in Portfolio Trader
How? Would you mind detailing it please?
Quantopian allows setting slippage and commission per bar to even account for the impact of volatility.
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
Code: Select all
set_nextbar_aggressor_slippage=15
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 ; ) )
Re: Need setting commission and slippage for individual futures in Portfolio Trader
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!!
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!!
Re: Need setting commission and slippage for individual futures in Portfolio Trader
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
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