Topic: Coding Errors and How to fix

I Started This Topic to discuses  the error raised when compiling indicators , people like me with no coding experience may face some difficulties to fix these errors even they appear to be simple things.

1st:
ERROR: Indicator compilation failed in file [Donchian One Band.cs]
     Line 179 Column 38: A local variable named 'iBar' cannot be declared in this scope because it would give a different meaning to 'iBar', which is already used in a 'parent or current' scope to denote something else.

THE IDEA OF Indicator: to draw only one band ( if trend is up so draw lower band && if Down draw higher band  but the previous err raised  ,BUT when i looked into the original DC i find that the iBar already used twice without any problem

NB: i used the logic of two indicators ( DC original & Gann HiLo activator )

Donchian One Band attached

Thanks for help in advance

Post's attachments

Donchian One Band (1).cs 17.7 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Coding Errors and How to fix

You cannot use "iBar" because it is already used. Use "br" or some other name in that context.

Re: Coding Errors and How to fix

Hello Pop and thnx for reply
I made the change and it compiled fine but the line didnot change from up to dn or from dn to up when trend change it only draw one line either up or dn , and that one side line change with shift change !!!!!  what is the wrong in the code ???

thankx in advance

regards

Re: Coding Errors and How to fix

I face that error alot when trying to add extra lines to an indicator , The indicators compiled well and the generator runs everything is ok  but the graph window collapsed

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.OverflowException: Overflow error.
   at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
   at System.Drawing.Graphics.DrawLines(Pen pen, Point[] points)
   at ForexStrategyBuilder.SmallIndicatorChart.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Thanks in advance

Post's attachments

error.gif
error.gif 3.51 kb, 1 downloads since 2014-01-12 

You don't have the permssions to download the attachments of this post.

Re: Coding Errors and How to fix

Search for overflow error, ton of info out there, should definitely be of help. Don't forget to add "C#" into search phrase.

Re: Coding Errors and How to fix

I asked in other .Net forum and received these answers

1-GDI+ library tries to draw with a very large Int32 value, so make sure when you create a Series object the values to assign are not out of reasonable bounds.


OR

2- allocating a lot of GDI objects that are not disposed in a timely manner.

And thanks god i donot know how to use them !!!!!

Re: Coding Errors and How to fix

What forum was that?

There you have it - you have unreasonable values somewhere, too little or too large! Overflow is a bad error, it takes a lot of time to track down. Krog made a tracing technique thread, read it and go from there. I'm not sure you have a problem with Int value, start from double values, especially those, which go into components.

Re: Coding Errors and How to fix

Hi

Does someone know how to resolve this problem ?

I have the same situation.

EA works I think, but some errors attacking me all the time sad

Post's attachments

Clipboard02.jpg 124.26 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Coding Errors and How to fix

Your coded indicator in use or standard or downloaded from somewhere?