I'm trying to call PlotTimeSeriesLine() from within a code library, but Visual Studio says this call doesn't exist in the current context. So I assume I need to pass an instance of UserStrategyBase, but that can't be found either--strange. (Yes, I added references to WealthLab.Core, etc.)
Please point me to an example where an instance of a strategy is being passed into a DLL library routine. I can take it from there. Or perhaps there's a built-in instance of UserStrategyBase I should be referencing to call PlotTimeSeriesLine() from inside Visual Studio library code.
Please point me to an example where an instance of a strategy is being passed into a DLL library routine. I can take it from there. Or perhaps there's a built-in instance of UserStrategyBase I should be referencing to call PlotTimeSeriesLine() from inside Visual Studio library code.
Rename
Yeah, you'd need to have your class library object accept a parameter of UserStrategyBase. For example you might have a method named PerformFancyCalcs, which would scope out like this:
Then, in your WL7 code, pass "this" as the "usb" parameter instance.
CODE:
public void PerformFancyCalcs(UserStrategyBase usb, BarHistory, bh, int idx) { //do calculations, other things //plot a line ... usb.PlotTimeSeriesLine(...); }
Then, in your WL7 code, pass "this" as the "usb" parameter instance.
Thanks a bunch!
I just looked at the docs again for UserStrategyBase, and they state it's namespace is WealthLab.Backtest (not WealthLab.Core). I overlooked that, so I needed to add that reference to my VS Local.Components project before I could pass an instance of UserStrategyBase as shown in Reply# 1.
I just looked at the docs again for UserStrategyBase, and they state it's namespace is WealthLab.Backtest (not WealthLab.Core). I overlooked that, so I needed to add that reference to my VS Local.Components project before I could pass an instance of UserStrategyBase as shown in Reply# 1.
CODE:
using WealthLab.Backtest;
For those converting their development from WL6, Dion's example corresponds to passing an instance of WealthScript e.g.:
CODE:
public void PerformFancyCalcs(this WealthScript obj, Bars bh, int bar)
Your Response
Post
Edit Post
Login is required