public static Position EnterLOO(this WealthScript ws, int tradeBar, PositionType pt, double limitPrice, string signalName = "") public static bool ExitLOO(this WealthScript ws, int tradeBar, Position p, double limitPrice, string signalName = "")
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { for(int bar = GetTradingLoopStartBar(20); bar < Bars.Count; bar++) { if( bar < Bars.Count-1 ) // for backtesting only { if (IsLastPositionActive) { this.ExitLOO(bar+1, LastPosition, High[bar]); } else { this.EnterLOO(bar+1, PositionType.Long, SMA.Value(bar, Close, 20) * 0.98); } } } } } }