Portfolio Trader does not use the current date when using a Regular Trading Hours session template on US Equities.

Questions about MultiCharts and user contributed studies.
hughesfleming
Posts: 275
Joined: 22 Apr 2014
Has thanked: 70 times
Been thanked: 72 times

Portfolio Trader does not use the current date when using a Regular Trading Hours session template on US Equities.

Postby hughesfleming » 12 Jan 2018

Starting Jan 2, I changed my session template to regular trading hours and now Portfolio trader does not advance the date to the current trading date when left running overnight. I would like my strategy to trade only during regular trading hours but the date issue is making things unnecessarily difficult.

Everything works normally when you forward test or set live trading on but only on the day that the strategy was started. If left to run on its own, I run into problems the very next day. Symbols that should have been closed stay open and new symbols that should open stay flat. The date stays set to the previous trading date.

How can I force Portfolio Trader to respect the system clock?

Kind regards,

Alex

hughesfleming
Posts: 275
Joined: 22 Apr 2014
Has thanked: 70 times
Been thanked: 72 times

Re: Portfolio Trader does not use the current date when using a Regular Trading Hours session template on US Equities.

Postby hughesfleming » 12 Jan 2018

There is also some other odd behavior with session templates. Comparing the regular market hours session template to the premarket template, they don't seem to work the same way in Portfolio trader. To make things equal, I set the regular sessions template to start at 8:30 and left the default premarket sessions template untouched.

The strategy I am running holds positions overnight. The modified regular sessions template shows the positions open which is correct. The default premarket session template with exactly the same strategy shows the positions as flat for today. That is quite inconsistent.

regards,

Alex

User avatar
Mark Brown
Posts: 181
Joined: 29 Nov 2016
Has thanked: 111 times
Been thanked: 17 times

Re: Portfolio Trader does not use the current date when using a Regular Trading Hours session template on US Equities.

Postby Mark Brown » 10 Oct 2018

none of the session functions work when you include them in a study. i have had to resort to defining time instead of using sessions. the user functions are there and available but don't work. there seems to be a real disconnect between sessions in the data feed and sessions user functions.

if t>830 and t<1515 then begin

//start all code here

end;

hughesfleming
Posts: 275
Joined: 22 Apr 2014
Has thanked: 70 times
Been thanked: 72 times

Re: Portfolio Trader does not use the current date when using a Regular Trading Hours session template on US Equities.

Postby hughesfleming » 10 Oct 2018

This should be fixed in the current Portfolio Trader but I have not tested it. There was a date issue but it only caused problems if you stopped the strategy for some reason and then restarted it. Only then would you run into a problem. If you started PT normally and left if running then there was no problem with the dates. I start mine on Monday and I don't touch it until the next weekend. It has been working without problems.

Alex


Return to “MultiCharts”