How to debug "Max bars forward error"?

Questions about MultiCharts .NET and user contributed studies.
kengonn
Posts: 7
Joined: 21 Aug 2015
Has thanked: 6 times

How to debug "Max bars forward error"?

Postby kengonn » 15 Sep 2015

Hi,

I keep getting this error: "Max bars forward error. Bars reference value : -21828" when I'm referencing future prices in the StartCalc() method of my Signal. Does anyone know how to resolve this? I'm replicating the code found in Multicharts.Net programming guide, and my code goes like this:

for (int index = 0; index < Bars.FullSymbolData.Count; index++) {
Output.WriteLine("{0:d-M-yyyy HH:mm}", Bars.FullSymbolData.Time[-index]);
}

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

Re: How to debug "Max bars forward error"?

Postby Henry MultiСharts » 24 Sep 2015

Hello kengonn,

The code is trying to output future bars that do not exist. It should not do that. You can only output the data that exists.

kengonn
Posts: 7
Joined: 21 Aug 2015
Has thanked: 6 times

Re: How to debug "Max bars forward error"?

Postby kengonn » 24 Sep 2015

Hi Henry, I understand what the code does, and I'm simply replicating the sample code in the MultiCharts.NET-ProgrammingGuide-v1.1 (please refer to page 23) - I didn't make any changes. Have a look at this:

for (int index = 0; index < Bars.FullSymbolData.Count; index++) {
Output.WriteLine("{0:d-M-yyyy HH:mm}", Bars.FullSymbolData.Time[-index]);
}

what is wrong with this code? As far as I can tell, there's nothing wrong. Yet Multicharts still give me an error :(. Is it because I'm loading a lot of data? The data I'm using is 1 min OHLC FX spot from 2001 till 2015.

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

Re: How to debug "Max bars forward error"?

Postby Henry MultiСharts » 01 Oct 2015

Hello kengonn,

We were unable to replicate this behavior on our end using MultiCharts .NET64 Version 9.1 Release Candidate (Build 11712). The code was calculated fine on 4 795 427 bars.

What exact version and build number of MultiCharts are you running? (in MultiCharts go to Help tab-> About)

Please send us (support@multicharts.com) the following information for further analysis:
- 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;
- instructions for replicating the error.


Return to “MultiCharts .NET”