GetChartBitmap throws IndexOutOfRangeException
Author: Ben_Zurich
Creation Date: 8/7/2014 11:55 AM
profile picture

Ben_Zurich

#1
Hi,

occasionally I'm getting the error

QUOTE:
Error Message
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at WealthLab.ChartRenderer.ConvertBarToX(Int32 bar)
at WealthLab.ChartControl.ChartDrawingObject.ConvertBarToX(Int32 bar)
at WealthLab.ChartControl.ChartDrawingObjectHandle.get_X()
at WealthLab.ChartDrawingObjects.CDOHorizontalLine.Render(Graphics g)
at WealthLab.ChartControl.DrawingObjectManager.a(Graphics A_0)
at WealthLab.ChartControl.Chart.GetChartBitmap(Int32 width, Int32 height)
at WealthLabPro.ChartForm.executor_ChartBitmapRequested(Object sender, ChartBitmapEventArgs e)
at WealthLab.TradingSystemExecutor.a(Int32 A_0, Int32 A_1)
at WealthLab.WealthScript.GetChartBitmap(Int32 width, Int32 height)
at Strategies.Compass.StepStrategy.Execute() in c:\Users\abg\Documents\Visual Studio 2013\Projects\WealthLab.Strategies.Compass\WealthLab.Strategies.Compass\StepStrategy.cs:line 2368


when processing

CODE:
Please log in to see this code.


I cannot figure out, however, when this happens.

Also, when I try to "Copy chart image to clipboard" a window pops up which shows:

QUOTE:
An unhandled exception of type 'System.IndexOutOfRangeException' occurred in WealthLab.dll
Additional information: Index was outside the bounds of the array.

profile picture

Ben_Zurich

#2
Screenshot

profile picture

Eugene

#3
Hi,

QUOTE:
Also, when I try to "Copy chart image to clipboard" a window pops up which shows:

I have never experienced that error in this context. Let's investigate.

1. Are you running any 3rd party utilities that may interfere with clipboard (included but not limited to text editors, multiple clipboard, RDP/VNC remote control etc.)? Please stop them all and retry.

2. Any graphics-related customizations and tweaks in the system, esp. 3rd party tools? In other words, this also seems like a problem induced by some incompatibility/interference specific to your software configuration. Also, the large looking cursor is a standard Windows Aero (large), not a 3rd party's?

3. The Function toolbar has lost focus (everything grayed out) with just one open strategy/chart window. How did you do that?
profile picture

Cone

#4
If it only happens with some symbols and not others, there's a good chance that the DRW file is corrupt. If that's the case, just click the eraser button to clear all drawing objects and try again.
profile picture

Ben_Zurich

#5
Hi Cone, thank you for your answer!

1. No. I have closed all progs and retried.

2. No, no 3rd party, big cursor is from Windows.

3. That was because I was on a breakpoint. It happens also when the focus is there.

Yes, in the our bond group it happens only with RX1 and only in Weekly mode and only when the 'to' date is earlier than 14.02.2014.

I have attached the RX1 file.
profile picture

Eugene

#6
Added a note to the Knowledge Base: Errors | Other > Charting problems.
profile picture

Ben_Zurich

#7
Thank you very much!

I could verify that's indeed the DRW file that caused the problem.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).