public static TRIX Series(DataSeries source, int period) public TRIX(DataSeries source, int period, string description)
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() { /* Buy when TRIX turns up from below zero. Sell when TRIX crosses above zero. */ int Per = 24; DataSeries trix = TRIX.Series( Close, Per ); ChartPane TRIXPane = CreatePane( 25, true, true ); PlotSeries( TRIXPane, trix, Color.Brown, WealthLab.LineStyle.Solid, 2 ); for(int bar = 60; bar < Bars.Count; bar++) { if (!IsLastPositionActive) { if( TurnUp( bar, trix ) && ( trixbar < 0 ) ) BuyAtMarket( bar+1 ); } else { if( CrossOver( bar, trix, 0 ) ) SellAtMarket( bar+1, LastPosition ); } } } } }