- ago
Hi,

I have a strategy that worked normally before the new update. But after this update, I am getting the following error when I run the backtest:

QUOTE:
System.FormatException: String 'NULL' was not recognized as a valid Boolean.
at System.Boolean.Parse(ReadOnlySpan`1 value)
at System.Boolean.Parse(String value)
at RepositoryCandidate.StopWorker(String , RepositoryCandidate )
at WealthLab.Core.Tokenizer.get_TokenBoolean()
at IdentifierField.VerifyGenericInterpreter(Object , IdentifierField )
at WealthLab.ChartWPF.StrategyPlotFactory.RegisterStrategyPlot(ChartPane pane, String mdo)
at WealthLab.ChartWPF.CoreChart.set_StrategyDrawnObjects(Dictionary`2 value)
at WealthLab.ChartWPF.CoreChart.SetupStrategyItems(StrategyBase sb, BarHistory bars, Backtester bt)
at AlgoBroadcaster.PopRequest(Object , StrategyBase , BarHistory , Backtester , AlgoBroadcaster )
at WealthLab8.cwStrategy.PostObserver(BarHistory value, StrategyBase second)
at WealthLab8.cwStrategy.InsertObserver(Object init, EventArgs map)
at System.Windows.Threading.DispatcherTimer.FireTick()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)


Is there an email that I can send the complete strategy code to be verified?

Thanks in advance.
0
1,022
Solved
11 Replies

Reply

Bookmark

Sort
- ago
#1
Hi Emilio,

We suspect some of the strategy's settings even more than the code in this case. Please click File > "Open WL User Data Folder", go to Strategies and email the raw XML file of your strategy in question at support@wealth-lab.com. Thanks.
0
- ago
#2
I received the following exception to one of my strategies after installing build 11 (from build 10) when it worked fine in the earlier release.

QUOTE:
System.FormatException: String 'NULL' was not recognized as a valid Boolean.
at System.Boolean.Parse(ReadOnlySpan`1 value)
at System.Boolean.Parse(String value)
at RepositoryCandidate.StopWorker(String , RepositoryCandidate )
at WealthLab.Core.Tokenizer.get_TokenBoolean()
at IdentifierField.VerifyGenericInterpreter(Object , IdentifierField )
at WealthLab.ChartWPF.StrategyPlotFactory.RegisterStrategyPlot(ChartPane pane, String mdo)
at WealthLab.ChartWPF.CoreChart.set_StrategyDrawnObjects(Dictionary`2 value)
at WealthLab.ChartWPF.CoreChart.SetupStrategyItems(StrategyBase sb, BarHistory bars, Backtester bt)
at AlgoBroadcaster.PopRequest(Object , StrategyBase , BarHistory , Backtester , AlgoBroadcaster )
at WealthLab8.cwStrategy.PostObserver(BarHistory value, StrategyBase second)
at WealthLab8.cwStrategy.InsertObserver(Object init, EventArgs map)
at System.Windows.Threading.DispatcherTimer.FireTick()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)


I could isolate the problem to a call to method DrawBarAnnotation which has been reproduced below.

CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript9 { public class MyStrategy : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) {          int idx = bars.Count - 1;          DrawBarAnnotation("x", idx, true, WLColor.Black, 10); } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { if (!HasOpenPosition(bars, PositionType.Long)) { //code your buy conditions here } else { //code your sell conditions here } } //declare private variables below } }
0
- ago
#3
I had a similar problem and isolated it down to a call to DrawBarAnnotation. See my post for more details.
1
Glitch8
 ( 12.08% )
- ago
#4
Yes, DrawBarAnnotation is unfortunately broken in Build 11, it's already repaired, and we'll publish a Build11-B update on the site asap.
1
Best Answer
Glitch8
 ( 12.08% )
- ago
#5
To those affected by the DrawBarAnnotation issue in Build 11:

Can you please un-install WL8 using Windows Add/Remove Program, and then downloading and install Build 11 again?

We rectified the DrawBarAnnotation issue but since the version number did not change, folks who want to refresh their current Build 11 should uninstall first and then reinstall.

Note, this won't remove any of your Strategies, DataSets, etc.
1
- ago
#6
I ran install WL8SetupB11B before I saw this, and as you said it didn't work. So I attempted to uninstall Wealthlab 8. The uninstall appeared to run, but I can still run Wealthlab 8, so apparently it didn't uninstall it. Even after a restart of Windows 10 Wealthlab 8 is still installed. If I try to run install WL8SetupB11B, it doesn't appear to apply your fix to DrawBarAnnotation.
0
Glitch8
 ( 12.08% )
- ago
#7
Check your Add/Remove Programs, sometimes there is more than 1 WL8 present. This happens, I noticed, if someone installs a patch without previously removing WL8.

If you see any WL8's present in Windows Add/Remove Programs, remove them.

Then, install WL8 again.
0
- ago
#8
I uninstalled it, but Wealthlab 8 is still installed. I downloaded WL8SetupB11B again and tried installing it. Now I get the response below and it won't continue the install - all I can do is cancel.

0
- ago
#9
DrawText had the same problem? Was it also fixed in this build 11 revision?

Because I uninstalled and reinstalled the build revision as stated above but my strategy kept returning the error.
0
Glitch8
 ( 12.08% )
- ago
#10
Yes, DrawText experienced the same issue and we have repaired that one for Build 12. For now, please just comment out the DrawText calls. Very sorry for the disruption!
1
- ago
#11
Ok, thanks!
0

Reply

Bookmark

Sort