DrawLine value parameter fails supposedly with Overflow error in WLP log
Author: mkbryan
Creation Date: 4/24/2015 9:53 AM
profile picture

mkbryan

#1
When running a successfully compiled strategy in WLP, the DrawLine function fails (nothing is drawn in the PricePane), but changing the double value parameter to double constant works, though. After the DrawLine failure, the WLP.log contains errors like the following:

2015-04-23 22:36:31,299 [1] ERROR WealthLabPro.ChartForm [(null)] - Overflow error.

The value prints to the debug window showing a value in the range of the bars on the PricePane - so it's not an overflow and should not be invisible. If the value for the DrawLine is the constant (from the debug window), then DrawLine works and the line is visible as expected.

There's too much code to post right now and there doesn't appear anything like this here http://www2.wealth-lab.com/WL5Wiki/kbErrorsStrategy.ashx?HL=error,wealthlabpro or in the forum. Further searches on the wiki are fruitless.

Thanks in advance for any and all help.

BTW this is WLP 6.8 64 bit.
profile picture

Eugene

#2
Since that "Overflow error" is too general to be helpful and may be misleading, please show some example code that reliably demonstrates the error. Don't forget to indicate the data you're working with: data provider, bar scale, symbol (for single-stock backtest, or symbols if multi-symbol backtest), data loading range.

As an alternative, you could try debugging your Strategy code: How can I debug my trading strategies in Wealth-Lab?

P.S.
QUOTE:
there doesn't appear anything like this here

Actually it does: #1, #2 and #3.

profile picture

mkbryan

#3
Thanks, Eugene. I'm missing something with the Forum search. After searching for overflow (and waiting), no results were returned. What I am doing wrong?

I'm working on stripping down the code to reproduce the error. Stay tuned. Film at 11.
profile picture

Eugene

#4
You're not doing anything wrong Marc. I'm using Google to perform content search on the forum as described in post #4 in this thread.

Looking forward to seeing your code.
profile picture

mkbryan

#5
Thanks for the Google search help - this is essential for content searches on the forum site. This is what I was missing.

I think I've found the problem. When the value parameter to DrawLine is 0.0, the line does not appear and subsequently, the Drawing Tools do not work. A simple check for if (value > 0.0) before the call to DrawLine eliminates the problem.
profile picture

Eugene

#6
Glad that you've found the solution. Nonetheless, I'm unable to reproduce it in neither linear nor semi-log chart mode:
CODE:
Please log in to see this code.
profile picture

mkbryan

#7
Try a horizontal line, i.e. both values are 0.
profile picture

Eugene

#8
Makes no difference.
profile picture

mkbryan

#9
The problem occurred with semi-log scale. I prior post http://www.wealth-lab.com/Forum/Posts/S-amp-C-2013-07-The-Step-Candle-Pattern-Vervoort-33342 described the issue of 0.0 on a semi-log scale (log(0.0) = -infinity).

The code line is as follows: level is a double, which when equal to 0.0 causes a problem. This code line is inside a strategy specific PlotLine function with level as a parameter.
CODE:
Please log in to see this code.


thinkscript.Pane == PricePane, BarNum.Bar > 0, color is one of Color enums, linestyle is one of LineStyle enums, and 0 < width < 5.

It would be helpful for others if an exception were thrown if any of the cosmetic chart function like DrawLine don't like a value. As it is now, WLP is silent apart from the overly general "overflow error" in the WLP.log file.

I'm considering policing the strategy specific PlotLine parameters based on the LogScale property of the ChartPane object.
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).