Hi,
since build 28 or 29 I have an runtime error when creating a new instance of BarHistory in a C# project (Visual Studio):
In C# Code Editor it's working fine.
Do you have any idea?
Thanks!
since build 28 or 29 I have an runtime error when creating a new instance of BarHistory in a C# project (Visual Studio):
CODE:
BarHistory bh = new BarHistory("AAPL", HistoryScale.Daily);
In C# Code Editor it's working fine.
Do you have any idea?
Thanks!
Rename
Delete referenced assemblies in your VS project and add them again.
I have done that but I get the same error.
And sorry, it's not an compile error, it's an runtime error! In VS it compiles successfully.
When I use the compiled strategy in WL, I get the compile error:
And sorry, it's not an compile error, it's an runtime error! In VS it compiles successfully.
When I use the compiled strategy in WL, I get the compile error:
QUOTE:
Backtest Error: Could not compile the Strategy.
We promoted the MassageColors method from IndicatorBase up to TimeSeries, to provide more flexibility controlling colors in coded strategies. Can you recompile your coded strategy library?
It doesn't help.
Try "Clean Solution" and then "Rebuild Solution" (not just Build).
This is what I did. But it runs into the same error.
It seems clear your solution is pointing to an outdated or incorrect build artifact.
Even if I make a new solution (console app) from the scratch I get the error:
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=WealthLab.Core
StackTrace:
at WealthLab.Indicators.IndicatorFactory.get_MassageColors()
at WealthLab.Core.TimeSeries..ctor(List`1 dateTimes, Boolean fillNaN)
at WealthLab.Core.BarHistory.RegisterTag()
at WealthLab.Core.BarHistory..ctor(String symbol, Frequency scale)
at ConsoleApp1.Program.Main(String[] args) in ...
CODE:
using WealthLab.Core; namespace ConsoleApp1 { internal class Program { static void Main(string[] args) { BarHistory bh = new BarHistory("AAPL", Frequency.Daily); } } }
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=WealthLab.Core
StackTrace:
at WealthLab.Indicators.IndicatorFactory.get_MassageColors()
at WealthLab.Core.TimeSeries..ctor(List`1 dateTimes, Boolean fillNaN)
at WealthLab.Core.BarHistory.RegisterTag()
at WealthLab.Core.BarHistory..ctor(String symbol, Frequency scale)
at ConsoleApp1.Program.Main(String[] args) in ...
Okay, we're going to look into it. Stand by!
Looks like we need a hotfix for compiled strategies affected in the current build.
Many thanks for fixing the problem. It works like expected again!
Correction: In VS the Problem still exists (error when creating instances of BarHistory). In the Frontend it's solved.
We made sure it's working in VS. Whatever said in posts #5 and #1 still applies.
Update:
If I create a new C# strategy in WL and debug it in VS (WL as attached process), it works without error.
If I use the same line
in an console app (I use this for thesting purposes to speed up the debugging process), it fails with the error in Post #1
This behavior did not exist in previous releases!
If I create a new C# strategy in WL and debug it in VS (WL as attached process), it works without error.
If I use the same line
CODE:
BarHistory bh = new BarHistory("AAPL", HistoryScale.Daily);
in an console app (I use this for thesting purposes to speed up the debugging process), it fails with the error in Post #1
This behavior did not exist in previous releases!
Using our libraries in console apps or external applications isn't supported. Still, it looks like your console app is probably referencing an outdated copy of the library.
Ok, as long as I can debug, no problem for me
Just installed Win11. All is working fine again!
I am experiencing the same issue. It is preventing all my unit tests from running.
I am already at Win11. I implemented all latest updates.
I tried comments #1 and #5.
I tried being explicit in the project file to the new version of the libraries.
I tried searching for and deleting all old versions of the WealthLab dlls.
I am going to try branching next.
Please let me know other suggestions. Thanks Phil
I am already at Win11. I implemented all latest updates.
I tried comments #1 and #5.
I tried being explicit in the project file to the new version of the libraries.
I tried searching for and deleting all old versions of the WealthLab dlls.
I am going to try branching next.
Please let me know other suggestions. Thanks Phil
This is really interesting, my unit test under Win10 do what they should. It's just this one runtime error. Ok, I let you know when I have found the reason (although i think that's a Microsoft issue, this would'nt be the first time)
This remains an issue for me. As you say it might be a visual studio issue rather than a wealthlab issue.
I created a new project and implemented a simple unit test:
With the project dependency assembly set to my previous version (build 26) it works.
However if I change to the latest version (build 30) if fails with the error message you report.
It still suggests to me that the BarHistory constructor needs something initialized in TimeSeries Indicators that I did not need previously.
Thank for the help
I created a new project and implemented a simple unit test:
CODE:
using WealthLab.Core; namespace TestProject { [TestClass] public class UnitTest1 { [TestMethod] public void TestMethod1() { var bars = new BarHistory("AAPL", HistoryScale.Daily); var result = bars.Count > 0; Assert.IsTrue(result); } } }
With the project dependency assembly set to my previous version (build 26) it works.
However if I change to the latest version (build 30) if fails with the error message you report.
It still suggests to me that the BarHistory constructor needs something initialized in TimeSeries Indicators that I did not need previously.
Thank for the help
Your Response
Post
Edit Post
Login is required