- ago
-Create a strategy with one int32 parameter with values ranging from 0 to 2000.
- Make init value to be 1000 or more.
- Change default value and save parameters.
- Open strategy again.
- Compile error as a result of formating the init value with ','.

Fix: Don't format numbers.

Sample Strategy:

CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Indicators; using System.Drawing; using System.Collections.Generic; namespace WealthScript7 { public class MyStrategy : UserStrategyBase {       Parameter gainStop;                 public MyStrategy()       {          AddParameter("GainStop", ParameterTypes.Int32, 9100, 0, 10000, 100);          gainStop = 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 } }
0
369
Solved
1 Replies

Closed

Bookmark

Sort
- ago
#1
Thanks for your bug report. Let's close this since it's known and already resolved for Build 8.

https://www.wealth-lab.com/Discussion/Save-Parameter-issue-when-it-exceeds-1-000-value-6006
0
Best Answer

Closed

Bookmark

Sort