- ago
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.
0
902
Solved
3 Replies

Reply

Bookmark

Sort
Glitch8
 ( 10.41% )
- ago
#1
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:

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.
0
Best Answer
- ago
#2
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.
CODE:
using WealthLab.Backtest;
2
- ago
#3
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)
0

Reply

Bookmark

Sort