Portfolio Trader missing some bar close times  [SOLVED]

Questions about MultiCharts and user contributed studies.
User avatar
pcrespo
Posts: 49
Joined: 07 Feb 2015
Has thanked: 7 times
Been thanked: 4 times

Portfolio Trader missing some bar close times

Postby pcrespo » 25 May 2016

Hi all. I feel like this is a noob question, but I've read the documentation and FAQ to no avail.

My data provider is IQFeed. I'm testing the continuous-adjusted ES in Portfolio Trader, and I've selected @ES#C under the CME exchange with default exchange settings.

For the strategy, I'm using test code which simply makes a trade at every bar close:

Code: Select all

Inputs:
NumberOfContracts ( 1 );

Variables:
goLong ( false );


if BarStatus(2)=2 then
if goLong then
begin
goLong = false;
Buy ( "Long" ) NumberOfContracts contracts next bar market;
Sell ("SellOut") all contracts next bar market;
end
else begin
goLong = True;
SellShort ("Short") NumberOfContracts contracts next bar market;
BuyToCover ("BuyOut") all contracts next bar market;
end;
I tested the "strategy" on 1-hour bars. As expected, it alternates long/short every hour. However, the exchange closes at 4:15pm, reopens at 4:30pm, closes again at 5pm and re-opens at 6pm. I would like trade list to reflect that, but instead, it reports a trade a 4pm, then 4:30pm, then 6pm, so for some reason it's skipping the 4:15 and 5pm.

I thought maybe I needed to do something in QuoteManager, but when I open a 1-hour @ES#C chart in Multicharts, the 4:15 and 5pm bars are present.

So my question is, why would PT behave differently than MC, and more importantly, what am I doing wrong?

Many thanks

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

Re: Portfolio Trader missing some bar close times

Postby Henry MultiСharts » 26 May 2016

Hello pcrespo,

Please attach a screenshot of the session settings you are using for this instrument.

User avatar
pcrespo
Posts: 49
Joined: 07 Feb 2015
Has thanked: 7 times
Been thanked: 4 times

Re: Portfolio Trader missing some bar close times

Postby pcrespo » 26 May 2016

The top left and top middle windows are screenshots from PT. The bottom two are from QuoteManager, showing that I'm using the symbol dictionary sessions. The top right window shows the dictionary settings of the symbol I'm testing.

I see the dictionary settings say there should be a close at 4:15pm Central Time rather than 4pm like I thought. Either way, that's being missed, as is the 3:15pm CT close.

I've also attached the trade list of the Performance Report, and highlighted the problem I'm talking about. (Times are in EST zone.)
Attachments
trade list.png
(51.1 KiB) Downloaded 779 times
settings_screenshot.png
(60.6 KiB) Downloaded 778 times

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

Re: Portfolio Trader missing some bar close times  [SOLVED]

Postby Henry MultiСharts » 27 May 2016

Hello pcrespo,

There is nothing incorrect in the application operation/setup, the code is executed as expected. Your code is calculated on bar close (if BarStatus(2)=2 then) and the order is sent on the next bar open (Buy ( "Long" ) NumberOfContracts contracts next bar market), which is reflected on the screenshots you have provided.

Please study the following information:
https://www.multicharts.com/trading-sof ... Calculated

User avatar
pcrespo
Posts: 49
Joined: 07 Feb 2015
Has thanked: 7 times
Been thanked: 4 times

Re: Portfolio Trader missing some bar close times

Postby pcrespo » 27 May 2016

Edit: ohh wow, duh, of course it can't trade while the market is closed, that's why it waits until the re-open. Haha some questions are too dumb for the FAQ which is why I couldn't find my answer there.

Thanks and sorry for this thread lol.


Return to “MultiCharts”