Frequency
public enum FrequencyRepresents the frequency of historical data. Possible values are:
- Daily
- Weekly
- Monthly
- Quarterly
- Yearly
- Tick
- Second
- Minute
- Volume
- Hour
- NDays
- WeeklyStartDay
- SemiAnnually
- BiWeekly
API documentation, members, signatures, and C# examples.
Find classes, members, and documentation.
This page documents enumerated types used throughout the WealthLab .NET Framework.
public enum FrequencyRepresents the frequency of historical data. Possible values are:
public enum LineStyleSpecifies how lines are rendered by WealthLab charting and drawing methods. Possible values are:
public enum OptimizationRunTypeSpecifies the type of optimization run. Possible values are:
public enum OptionSymbolFormatIdentifies supported option symbol formats. Possible values are:
Remarks
TTD230712C75. Used by providers such as Interactive Brokers.TTD230721C00075000. Used by providers such as Tradier and TradeStation.TTD2321G75, where G represents July. Used by platforms such as TradingView, IQFeed, and Collective2.mmyydd date. Example: TTD_072123C75.TTD 230721C00075000. Used by Schwab.public enum OrderTypeSpecifies the type of order submitted to the Backtester or a Broker. Possible values are:
Remarks
using WealthLab.Backtest;
using WealthLab.Core;
using WealthLab.Indicators;
using System.Drawing;
namespace WealthScript1
{
public class MarketClosePeekingExitStrategy : UserStrategyBase
{
public override void Initialize(BarHistory bars)
{
smaShort = SMA.Series(bars.Close, 20);
smaLong = SMA.Series(bars.Close, 50);
PlotIndicator(smaShort, WLColor.Gold);
PlotIndicator(smaLong, WLColor.Red);
PlotStopsAndLimits(3);
}
public override void Execute(BarHistory bars, int idx)
{
if (!HasOpenPosition(bars, PositionType.Long))
{
if (bars.Close[idx] < smaShort[idx] && bars.Close[idx] < smaLong[idx])
{
Transaction t = PlaceTrade(bars, TransactionType.Buy, OrderType.StopLimit, smaShort[idx], "StpLmt");
t.StopLimitLimitPrice = smaShort[idx] * 1.005;
}
}
else
{
if (idx == bars.Count - 1)
return;
if (smaShort.CrossesOver(smaLong, idx + 1))
PlaceTrade(bars, TransactionType.Sell, OrderType.MarketClose);
}
}
private SMA smaShort;
private SMA smaLong;
}
}
public enum ParameterTypeRepresents the type of a Parameter used by WealthLab components such as Strategies and Indicators. Parameters are instances of the Parameter class. Possible values are:
Remarks
public enum PeakTroughReversalTypeSpecifies the method a PeakTroughCalculator uses to determine peak and trough reversals. Possible values are:
public enum PeakTroughTypeSpecifies whether a PeakTrough instance represents a peak or a trough. PeakTrough instances are generated by the PeakTroughCalculator utility class. Possible values are:
public enum PlotStyleSpecifies the plotting style used to render an Indicator or TimeSeries on a chart. Possible values are:
Remarks
Double.NaN. WealthLab draws lines between the non-NaN values.using WealthLab.Backtest;
using System;
using WealthLab.Core;
using WealthLab.Indicators;
using System.Collections.Generic;
namespace WealthScript123
{
public class FilledBBands : UserStrategyBase
{
public override void Initialize(BarHistory bars)
{
bbl = BBLower.Series(bars.Close, 20, 2);
bbu = BBUpper.Series(bars.Close, 20, 2);
bbl.Bars = bars;
bbu.Bars = bars;
PlotIndicator(bbl, WLColor.Pink, PlotStyle.Bands);
PlotIndicator(bbu, WLColor.Pink);
}
public override void Execute(BarHistory bars, int idx)
{
}
private BBLower bbl;
private BBUpper bbu;
}
}
public enum PositionTypeSpecifies whether a Position is Long or Short. Possible values are:
public enum PriceComponentRepresents the components of historical market data and several price components derived by averaging the standard OHLC values. Possible values are:
public enum SignalStatusRepresents the possible states of an order during its lifetime while interacting with a Broker. Possible values are:
public enum StrategyExecutionModeSpecifies the context in which the Backtester is executing a Strategy. The current value is available through the Backtester's ExecutionMode property. Possible values are:
using WealthLab.Backtest;
using System;
using WealthLab.Core;
using WealthLab.Indicators;
using System.Drawing;
using System.Collections.Generic;
namespace WealthScript1
{
public class MyStrategy : UserStrategyBase
{
public override void Initialize(BarHistory bars)
{
DrawHeaderText(ExecutionMode.ToString(), WLColor.Blue, 16);
switch (ExecutionMode)
{
case StrategyExecutionMode.Optimization:
_isOptimization = true;
break;
case StrategyExecutionMode.Strategy:
_isStrategyWindow = true;
break;
case StrategyExecutionMode.StrategyMonitor:
_isStrategyMonitor = true;
break;
case StrategyExecutionMode.StreamingChart:
_isStreaming = true;
break;
default:
break;
}
}
public override void Execute(BarHistory bars, int idx)
{
}
bool _isStreaming;
bool _isOptimization;
bool _isStrategyWindow;
bool _isStrategyMonitor;
}
}
public enum TextShapeProvides special symbols that can be rendered with methods such as DrawBarAnnotation, including triangles, circles, squares, and stars. Possible values are:
using WealthLab.Backtest;
using System;
using WealthLab.Core;
using WealthLab.Indicators;
using System.Collections.Generic;
namespace WealthScript1
{
public class MyStrategy : UserStrategyBase
{
public override void Initialize(BarHistory bars)
{
ptc = new PeakTroughCalculator(bars.Close, 5.0, PeakTroughReversalType.Percent);
foreach (PeakTrough pt in ptc.PeakTroughs)
{
if (pt.Type == PeakTroughType.Trough)
DrawBarAnnotation(TextShape.TriangleHollowUp, pt.XIndex, false, WLColor.Lime, 16);
else
DrawBarAnnotation(TextShape.TriangleHollowDown, pt.XIndex, true, WLColor.Red, 16);
}
}
public override void Execute(BarHistory bars, int idx)
{
}
PeakTroughCalculator ptc;
}
}
public enum TradingDayChoiceIdentifies a calendar period used by trading-day utility methods that calculate elapsed or remaining trading days. Possible values are:
public enum TrailingStopTypeSpecifies how a trailing stop is calculated when using the CloseAtTrailingStop method of UserStrategyBase. Possible values are:
Remarks
public enum TransactionTypeSpecifies the type and direction of a Transaction or order. Possible values are:
public enum VerticalAlignmentSpecifies the vertical alignment used by methods such as DrawTextVAlign. Possible values are:
Ask the community or explore custom development services.