public static StochRSI Series(DataSeries source, int period) public StochRSI(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() { DataSeries ema = EMA.Series( Close, 30, EMACalculation.Modern ); DataSeries stoRSI = StochRSI.Series( Close, 14 ); ChartPane StochRSIPane = CreatePane( 35, true, true ); PlotSeries( StochRSIPane, stoRSI, Color.IndianRed, WealthLab.LineStyle.Solid, 1 ); // StochRSI is an "unstable" indicator so the loop should start at least 3 times its period for(int bar = 45; bar < Bars.Count; bar++) { if (IsLastPositionActive) { Position p = LastPosition; if( stoRSI[bar] == 100 ) SellAtMarket( bar+1, p ); else if( p.MFEAsOfBarPercent( bar ) > 10 ) ExitAtStop( bar+1, p, p.EntryPrice, "Breakeven @ 10%" ); } else { if( ( ema[bar] > ema[bar-1] ) && ( stoRSI[bar] == 0 ) ) BuyAtMarket( bar+1 ); } } } } }