I installed the new build and ran optomization on compiled strategy. I Got many instances of the Error below.
To try it. just create an empty strategy with a parameter and run Optimization on it.
System.FormatException: Input string was not in a correct format.
at System.Globalization.TimeSpanFormat.FormatCustomized(TimeSpan value,
ReadOnlySpan`1 format, DateTimeFormatInfo dtfi, StringBuilder result)
at System.Globalization.TimeSpanFormat.Format(TimeSpan value, String format, IFormatProvider formatProvider)
at System.TimeSpan.ToString(String format)
at WealthLab8.ucOptimization.ReadWriter(Int32 versionlast)
at WealthLab8.ucOptimization.NewWriter(Object info, ProgressChangedEventArgs caller)
at System.ComponentModel.BackgroundWorker.OnProgressChanged(ProgressChangedEventArgs e)
at System.ComponentModel.BackgroundWorker.ProgressReporter(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)
To try it. just create an empty strategy with a parameter and run Optimization on it.
System.FormatException: Input string was not in a correct format.
at System.Globalization.TimeSpanFormat.FormatCustomized(TimeSpan value,
ReadOnlySpan`1 format, DateTimeFormatInfo dtfi, StringBuilder result)
at System.Globalization.TimeSpanFormat.Format(TimeSpan value, String format, IFormatProvider formatProvider)
at System.TimeSpan.ToString(String format)
at WealthLab8.ucOptimization.ReadWriter(Int32 versionlast)
at WealthLab8.ucOptimization.NewWriter(Object info, ProgressChangedEventArgs caller)
at System.ComponentModel.BackgroundWorker.OnProgressChanged(ProgressChangedEventArgs e)
at System.ComponentModel.BackgroundWorker.ProgressReporter(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)
Rename
here is a sample coder to try:
CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Data; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript1 { public class MyStrategy : UserStrategyBase { readonly Parameter interval; public MyStrategy() { AddParameter("Interval", ParameterType.Double, 60, 10, 250, 1); interval = Parameters[0]; } //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) { } //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 } }
Yup, there was an attempt to fix another innocuous bug .. and it backfired. We'll do another build ASAP.
Thanks
Build 41 is ready. Apologies for the hiccup and thanks for spotting it so quickly!
Your Response
Post
Edit Post
Login is required