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.
Calling Bars.Time[1] on BarIndex > 0 causes exception [SOLVED]
Calling Bars.Time[1] on BarIndex > 0 causes exception
- Attachments
-
- 2013-03-16_1128.png
- (282.38 KiB) Downloaded 770 times
- 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
Hello davewolfs,
This is an internal process, not actual error, just ignore it.
This is an internal process, not actual error, just ignore it.
Re: Calling Bars.Time[1] on BarIndex > 0 causes exception
Ok, but this seems to be the cause for the first few bars in the chart not drawing indicator values, they are essentially skipped.Hello davewolfs,
This is an internal process, not actual error, just ignore it.
- 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]
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).
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).