public RVI(Bars bars, int period, string description) public static RVI Series(Bars bars, int period)
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 rvi = RVI.Series( Bars, 10 ); ChartPane RVIPane = CreatePane( 50, true, true ); PlotSeries( RVIPane, rvi, Color.DarkBlue, LineStyle.Solid, 1 ); for(int bar = rvi.FirstValidValue; bar < Bars.Count; bar++) { for(int p = ActivePositions.Count - 1; p >= 0; p--) { Position pos = ActivePositions[p]; if( CrossOver( bar, rvi, 0.35 ) ) SellAtMarket( bar+1, pos ); } if( ( TurnUp( bar, rvi ) ) & ( rvi[bar-1] < -0.35 ) ) BuyAtMarket( bar+1 ); } } } }