using System.Collections.Generic; using System.ComponentModel; using TSLab.Script; using TSLab.Script.Handlers; using TSLab.Script.Handlers.Options; namespace GanovCubes { #region CubeDescription [HandlerCategory("Ganov Cubes. MarketData")] [HelperName("LotSize", Language = "ru-RU")] [Description("Кубик выдает сведения о размере лота инструмента")] [HelperLink("http://forum.tslab.ru/ubb/ubbthreads.php?ubb=showflat&Number=87030&page=1", "Страница на форуме TSLab", "ru-ru")] [InputsCount(1)] [Input(0, TemplateTypes.SECURITY, Name = "Инструмент")] [OutputsCount(1)] [OutputType(TemplateTypes.DOUBLE)] #endregion public class LotSize : IStreamHandler, ISecurityInput0, IDoubleReturns, IContextUses { public IContext Context { get; set; } public IList Execute(ISecurity sec) { var lotSize = sec.LotSize; var barsCount = Context.BarsCount; if (barsCount < 0) return Context.GetArray(0); if (lotSize < 0) return Context.GetArray(barsCount); return Context.GetValueTypeCollection(lotSize, barsCount); } } }