- ago
To recreate:
Create strategy given below.
Open Strategy Screener
Select strategy that you just created.
Select Russell 3000 (just about any seems to do though)
Set other params.
Run strategy screener and get some results
In strategy screener click Create DataSet and pick All.
Name the dataset and OK the dialog. Newly created dataset appears in the dataset tree.
Go to the dataset tree, right-click on the newly created dataset and pick configure. Kaboom. You can also get the exception in the Data Manager if you right-click the newly created dataset and pick configure.

Here's the strategy:
CODE:
using System; using System.Collections.Generic; using WealthLab.Backtest; using WealthLab.Core; using WealthLab.Data; using WealthLab.Indicators; namespace WealthScript1 {    public class MyStrategy : UserStrategyBase    {       public override void Initialize(BarHistory bars)       {          _ts = SMA.Series((bars.High - bars.Low) / bars.Open * 100, 10);          _vol = SMA.Series(bars.Volume, 10);       }       public override void Execute(BarHistory bars, int idx)       {          if (_ts[idx] >= 5 && _vol[idx] >= 12_000_000 && bars.Close[idx] >= 5 && bars.Close[idx] <= 100)          {             PlaceTrade(bars, TransactionType.Buy, OrderType.Market, 0, $"{_ts[idx].ToString("0.00")}");          }       }       private SMA _ts;       private SMA _vol;    } }


Here is the exception:
CODE:
11/3/2024 10:42:41:379 WL8 Object reference not set to an instance of an object. NullReferenceException Object reference not set to an instance of an object. at WealthLab.WPF.wizDateRanges.AssignDataSet(DataSet ds) at WealthLab8.ConfigureDataSetWindow.AssignDataSet(DataSet ds) at WealthLab8.pnlNavDataSets.LoginContext(Object info, RoutedEventArgs attr) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg) 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)


WL8 Build is 102.
In case it matters, in the Data Manager, my first historical provider is Schwab. The token is up-to-date as I'm able to bring up charts, run strategies, etc.
0
59
Solved
1 Replies

Reply

Bookmark

Sort
Cone8
 ( 5.88% )
- ago
#1
Thanks. It's a side-effect after adding the dynamic DataSets feature.
Fixed for Build 103.
0
Best Answer

Reply

Bookmark

Sort