using System; using System.Collections; using System.Collections.Generic; using System.Linq; using TSLab.Script.Handlers; namespace SomeIndicators { //[HandlerCategory("Indicators")] [HandlerName("Результат для оптимизации")] public class ScriptResult : IOneSourceHandler, IDoubleInputs, IDoubleReturns, IStreamHandler, IValuesHandler, IContextUses { public IContext Context { set; get; } public IList Execute(IList values) { var count = values.Count; if (count < 1) return new double[0]; Context.ScriptResult = values.Last(); return values; } public double Execute(double value, int i) { return Context.ScriptResult = value; } } }