Calling Bars.Time[1] on BarIndex > 0 causes exception  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
davewolfs
Posts: 89
Joined: 06 Feb 2013
Has thanked: 2 times
Been thanked: 11 times

Calling Bars.Time[1] on BarIndex > 0 causes exception

Postby davewolfs » 15 Mar 2013

Don't know why, if one calls Bars.Time[1] on bar index > 0 you get an exception.

This shouldn't happen. I should add that performance seems a bit slow with most of the time being spent in dam.dll.
Attachments
2013-03-16_1128.png
(282.38 KiB) Downloaded 770 times

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

Re: Calling Bars.Time[1] on BarIndex > 0 causes exception

Postby Henry MultiСharts » 18 Mar 2013

Hello davewolfs,

This is an internal process, not actual error, just ignore it.

davewolfs
Posts: 89
Joined: 06 Feb 2013
Has thanked: 2 times
Been thanked: 11 times

Re: Calling Bars.Time[1] on BarIndex > 0 causes exception

Postby davewolfs » 18 Mar 2013

Hello davewolfs,

This is an internal process, not actual error, just ignore it.
Ok, but this seems to be the cause for the first few bars in the chart not drawing indicator values, they are essentially skipped.

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

Re: Calling Bars.Time[1] on BarIndex > 0 causes exception  [SOLVED]

Postby Henry MultiСharts » 19 Mar 2013

Each script requires a particular number of bars to be calculated and give you any first result on chart. This number of bars depends on your script and is called MaxBarsBack.
For example:
If your code references Bars.Close[10] then it needs at least 11 bars on the price series for calculation. MaxbarsBack should be set to 10, these bars would be skipped to show you the first calculation result on bar #11 (real bar number on the chart, in the code bar number will be #1).


Return to “MultiCharts .NET”