+1 888 340 6572
MultiCharts Project Management
Go to the previous open issue
Go to the previous issue (open or closed)
Please log in to bookmark issues
Open Bug report MC-1871

portfolio backtesting ascii map files starts on line 52

Go to the next issue (open or closed)
Go to the next open issue

discussion here: http://www.multicharts.com/discussion/viewtopic.php?f=19&t=48556&p=115611#p115611

I load a bunch of ascii-mapped instruments via quote manager. I can chart (and load chart signals) fine.

But when I add these to portfolio trader and try to backtest, it skips the first 51 lines of the file!! (skips 50 data-rows if you exclude the header).

So the first bar processed by the portfolio trader backtester is always line 52. everything before that is skipped.

I have verified this on 3 separate ascii files, which I have attached. when trying to backtest 2015/04/27 the first bar calculated is on line 52.

I pretty much verified this. the first 51 bars "to be used" in the file are eaten.

if I add 51 extra lines on the weekend (20150426) they are ignored, and the first 51 lines from 20150427 are still eaten.

if I add 51 extra lines for friday (20150424) those are eaten and all my lines for 20150427 are backtested properly.

See the attached ascii file. for the Portfolio Backtest, I'm using exchange time, with a data range from "4/24/2015" to "4/30/2015"

I verified this by adding a signal which will output the Bar.TimeValue during CalcBar()

When I set the "Data Range" to 5000 Bars Back from 04/27/2015, I still see the same problem (the first 51 bars are skipped).

Also in the various files I have tested, the first 51 lines are skipped, regardless as to how many lines are in the actual file (each file is different)

Additionally, my signal has no problems obtaining the first 51 bars is I apply it to a normal chart, only the portfolio trader is seeing this issue.

Steps to reproduce this issue

Signal: create a strategy that Output.Writeline(this.Bars.TimeValue) in the CalcBar() method
Instruments: Load ascii files via quote manager (Security, UNDEF or SMART exchange)

add instrument(s) and signal to portfolio manager

set the PortfolioTrader.Data settings: Data Range, TimeZone Exchange. so that the bars in your text files will be included.

open PowerLanguage.NET editor so you can view the Output window.

hit backtest button, watch the bars output to the Powerlanguage.NET output window. The first 51 bars will be missing from each security.

You can use the attached ZIP for your ascii import, choose the date range 04/27/2015 to 04/30/2015.

Comments (3)
user-offline.png  novaleaf (novaleaf)
May 20, 2015 - 01:57

Here is my hack of a workaround.[/b]My mitigation is to duplicate the first bar (lines 2 to 52) in the ascii file. This charts fine (duplicates ignored) and Portfolio Trader now works. so something about bringing ascii into portfolio trading eats the first 51 lines.

user-offline.png  novaleaf (novaleaf)
May 20, 2015 - 21:35

Workaround as per JoshM's thread comments:  setting "Maximum number of bars study will reference" to zero solves the problem.
Action items for multicharts dev:
1) Portfolio Properties should be accessible via the dropdown menu, or a tab-window such as the Data and Portfolio Settings tabs. It is non-obvious that the only way to access Portfolio Properties is to right-click the root.
2) Portfolio Property for "Maximum number of bars study will reference" is broken, or very confusing to use. This is functionally not the same as MaxBarsBack. In practice it seems to be used to skip bars, not include bars.

user-offline.png  MultiCharts Support (MultiCharts)
Feb 11, 2016 - 23:33

This is how MultiCharts and Portfolio Trader are working by design, as a study needs several bars to get calculated. If you want to, set it to 0 and modify your studies to have 0 bars enough to get script and all the functions calculated.

Issue basics
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (2)
People involved
Times and dates
  • Posted at
  • Last updated
Issue details
  • Reproducability
    Not determined
  • Severity
Attachments (1)
Commits (0)
There are no code checkins for this issue
Duplicate issues (0)
This issue does not have any duplicates