Portfolio Tester with large MaxBarsBack on futures  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
saltminer
Posts: 9
Joined: 02 Feb 2015
Has thanked: 2 times

Portfolio Tester with large MaxBarsBack on futures

Postby saltminer » 11 Jun 2015

Hi MultiCharts folks,

I am creating a large portfolio of daily systems. The systems trade futures using day bars, and have quite high MaxBarsBack values, e.g. 250. Backtesting works fine on continuous futures.

A front month future, which of course is the symbol that must be traded live, sometimes doesn’t have much data going back into the past to create 250 bars (which is a whole year) of warm up in order to get trading live. There may be good data coming into the rollover date, but perhaps 3 months prior to that the data is thin and just dwindles out all together before the 250 bars can occur.

On a chart, it is possible to use the Merge Data feature, and use a continuous future as the historical and the front month future as the realtime symbol. Brilliant! However, I am in the Portfolio Trader and the Merge Data feature is not available there.

This means trading a future with day bars in the Portfolio Trader is very difficult or impossible, or at least, bound to small MaxBarsBack values.
Can you suggest a solution, or at least a workaround, to the problem? The project I’m working on is very important to a number of people at this end.

Cheers,
saltminer

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Portfolio Tester with large MaxBarsBack on futures

Postby JoshM » 12 Jun 2015

On a chart, it is possible to use the Merge Data feature, and use a continuous future as the historical and the front month future as the realtime symbol. Brilliant! However, I am in the Portfolio Trader and the Merge Data feature is not available there.

This means trading a future with day bars in the Portfolio Trader is very difficult or impossible, or at least, bound to small MaxBarsBack values.
Can you suggest a solution, or at least a workaround, to the problem?
Hello Saltminer,

What you could do is output the data from the daily chart (with the merged data sources) to a file, and then import that file into the QuoteManager as a new symbol. See exporting data from a chart for more. There's also a thread here about an indicator that outputs bar data to a file.

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

Re: Portfolio Tester with large MaxBarsBack on futures  [SOLVED]

Postby Henry MultiСharts » 12 Jun 2015

Hello saltminer,

That is possible to link multiple expired futures contracts + current contract to build a continuous futures data series for backtesting and trading. Such functionality is called Custom Futures.
Please refer to this guide to learn how to configure it:
https://www.multicharts.com/trading-sof ... om_Futures
Rollover of custom futures dataseries cannot be done in realtime. You need to close/open the chart to rollover.

In order to place orders from a custom futures chart in MultiCharts/Portfolio Trader – that is required to manually add Symbol Mapping entry: Custom Futures to current front month contract/the one you need to trade. Here is how to do that:
https://www.multicharts.com/trading-sof ... ol_Mapping
You will need to manually remap the custom futures/continuous contract to the front month contract when futures rollover.
MultiCharts will not cancel and replace the orders with the new contract month.
You need to do that manually or contact your broker for assistance.

saltminer
Posts: 9
Joined: 02 Feb 2015
Has thanked: 2 times

Re: Portfolio Tester with large MaxBarsBack on futures

Postby saltminer » 14 Jun 2015

Thanks Josh and thank you Henry; the Custom Futures is something I had previously played around with but had not done the extra step of symbol mapping. Fabulous!

I have an additional conundrum to solve around massive Portfolio trading; I've started a new thread.

viewtopic.php?f=19&t=48640


Return to “MultiCharts .NET”