using System; using System.Collections.Generic; using System.Linq; using System.Text; using TSLab.Script.Handlers; using TSLab.Script.Optimization; using TSLab.Script; namespace test { public class Macd_volume : IExternalScript { public OptimProperty StochPer = new OptimProperty(40, 10, 1000, 10); private readonly TSLab.Script.Handlers.StochK _stochk = new TSLab.Script.Handlers.StochK(); public void Execute(IContext ctx, ISecurity sec) { _stochk.Period = StochPer; var pane1 = ctx.CreatePane("MacdWide", 15, false); var stochk1 = ctx.GetData("StochK", new string[] { StochPer.ToString() }, () => _stochk.Execute(sec)); var color = System.Drawing.Color.Red; pane1.AddList("Macd", stochk1.ToList(), ListStyles.LINE, new Color(color.ToArgb()), LineStyles.SOLID, PaneSides.RIGHT); } } }