public UDIDSRI(DataSeries ds, int period, int power, int percentRankPeriod, int iteration, string description) public static UDIDSRI(DataSeries ds, int period, int power, int percentRankPeriod, int iteration)
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators; using Community.Indicators;namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { UDIDSRI u = UDIDSRI.Series(Close,20,1,50,1); ChartPane up = CreatePane(30,true,true); PlotSeries(up,u,Color.FromArgb(255,255,0,0),LineStyle.Solid,2); for(int bar = GetTradingLoopStartBar(1); bar < Bars.Count; bar++) { if (IsLastPositionActive) { Position p = LastPosition; double high = p.MFEAsOfBar(bar) / p.Shares + p.EntryPrice; double amount = high - high * (10 / 100.0d); SellAtTrailingStop(bar + 1, p, amount); } else { if( ubar == 0 ) BuyAtMarket(bar+1); } } } } }