Portfolio Trader doesn't follow the call structure on live

Questions about MultiCharts .NET and user contributed studies.
QGroup

Portfolio Trader doesn't follow the call structure on live

Postby QGroup » 19 Feb 2015

I'm deploying a strategy that will run on an IB account, but having some issues running it in the Portfolio trader. The prices are different when running a forward test and backtest with the exact same data (no reloading of data from IB).

I’ve read another post that had a problem with comparing data in TWS vs MC and tried the solution to this (disable “Generate new tick if total volume changes” and “Use server timestamps”) but as the data is in MC’s database it shouldn’t have any effect, and it didn’t.

I tried the same thing on MBT data, and the same differences occur here so I doubt it’s the datafeed that is the problem.

The problem I believe is the reason for it is that the Portfolio Trader doesn’t seem to work in realtime the way it’s intended to. Reading the documentation for this it’s supposed to go through every ticker on the end of the bar, and then call the Portfolio Manager once each ticker/strategy has been completed. I’ve verified that this is what happens in a backtest, by logging the calls of the functions.

When running the exact same setup in a forward test however, as soon as it start calculating on new incoming data it calls the Portfolio Manager on every tick, hence not in the sequence defined in the documentation:

Portfolio CalcBar on 09:58:55
Portfolio CalcBar on 09:58:56
Portfolio CalcBar on 09:58:56
Portfolio CalcBar on 09:58:56
Trader (EUR/USD) CalcBar on 09:58:57
Trader (GBP/USD) CalcBar on 09:58:57
Trader (USD/CHF) CalcBar on 09:58:57
Portfolio CalcBar on 09:58:57
Portfolio CalcBar on 09:58:57
.
.
.
Portfolio CalcBar on 09:58:57
Trader (AUD/USD) CalcBar on 09:58:58
Trader (USD/CAD) CalcBar on 09:58:58
Trader (USD/JPY) CalcBar on 09:58:58
Portfolio CalcBar on 09:58:58
Portfolio CalcBar on 09:58:58

I’ve tried forcing it to only execute on bar close with Bars.Status == EBarState.Close and this limits the calls from per tick to a per bar basis, but the Portfolio Manager is still executed prior to each ticker has executed the strategy:

Trader (EUR/USD) CalcBar on 10:02:57
Trader (GBP/USD) CalcBar on 10:02:57
Trader (USD/CHF) CalcBar on 10:02:57
Portfolio CalcBar on 10:02:57
Trader (AUD/USD) CalcBar on 10:03:57
Trader (USD/CAD) CalcBar on 10:03:57
Trader (USD/JPY) CalcBar on 10:03:57
Portfolio CalcBar on 10:03:57
Trader (USD/CHF) CalcBar on 10:03:58
Trader (EUR/USD) CalcBar on 10:03:59
Trader (GBP/USD) CalcBar on 10:04:00
Trader (USD/CHF) CalcBar on 10:04:57
Trader (EUR/USD) CalcBar on 10:04:59
Trader (AUD/USD) CalcBar on 10:05:00
Portfolio CalcBar on 10:05:00
Trader (GBP/USD) CalcBar on 10:05:03
Trader (USD/JPY) CalcBar on 10:05:03
Trader (USD/CAD) CalcBar on 10:05:04
Trader (GBP/USD) CalcBar on 10:05:56
Trader (AUD/USD) CalcBar on 10:05:57
Trader (EUR/USD) CalcBar on 10:05:57
Trader (USD/CHF) CalcBar on 10:05:57
Trader (USD/JPY) CalcBar on 10:05:57
Portfolio CalcBar on 10:05:57
Trader (USD/CAD) CalcBar on 10:05:58

The correct sequence would be AUD/USD, EUR/USD, GB/USD, USD/CAD, USD/CHF, USD/JPY and finally the Portfolio. It doesn’t matter if the calls to the strategy (Trader) is different, but the Portfolio call should show up after each ticker has been processed.

IOG is default to false, but IOG won’t work in the Portfolio Trader anyway, right? Is it something that I’ve missed or this a bug? How can I ensure that the forward testing equals backtest (of course the orders will be different, but I’m referring to the price being different)?

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

Re: Portfolio Trader doesn't follow the call structure on li

Postby Henry MultiСharts » 19 Feb 2015

Hello QGroup,

Please send us (support@multicharts.com) the following information for further analysis:
- Portfolio workspace you are using;
- in QuoteManager select the symbols you are using, make a right click on it->Export data->Export instrument (without data). Send us the QMD export file for analysis;
- in PowerLanguage .NET editor->File->Export->export the studies you are using for replicating this behavior; send us the pln file;
- specify the version and build number of MultiCharts you are running (in MultiCharts go to Help tab-> About);
- instructions for replicating this behavior.


Return to “MultiCharts .NET”