private void CreateChartEngine() { int iEngineIndex = GlobalSettings.ChartProfile.ChartEngineIndex; __cChart = new ZChart(this.chart, PaintManager.Manager.GetChartEngineInformations()[iEngineIndex]); __cChart.SetChartProperty(__cProfile.ChartProperty); }
private void CreateChart() { ChartSetting cSetting1 = new ChartSetting() { Axis = new AxisSetting() { AxisScope = EAxisScope.PriceScaleScope, ScaleMode = EAxisScaleMode.None, ScaleValue = 0, MarginTop = 0, MarginBottom = 0 }, IsSubChart = true, IsShowNewPrice = true, LayerIndex = 0, LegendColor = Color.Yellow, ChartType = EChartType.Candlestick, PenStyles = new PowerLanguage.PenStyle[] { new PowerLanguage.PenStyle(Color.Red, 1), new PowerLanguage.PenStyle(Color.Green, 1), new PowerLanguage.PenStyle(Color.Gray, 1), } }; ChartSetting cSetting2 = new ChartSetting() { Axis = new AxisSetting() { AxisScope = EAxisScope.PriceScaleScope, ScaleMode = EAxisScaleMode.None, ScaleValue = 0, MarginTop = 0, MarginBottom = 0 }, IsSubChart = true, IsShowNewPrice = true, LayerIndex = 0, LegendColor = Color.Red, ChartType = EChartType.OHLC, PenStyles = new PowerLanguage.PenStyle[] { new PowerLanguage.PenStyle(Color.Red, 1), new PowerLanguage.PenStyle(Color.Green, 1), new PowerLanguage.PenStyle(Color.Gray, 1), } }; Font cFont = new System.Drawing.Font("新細明體", 8); ChartProperty cProperty = new ChartProperty() { AxisFont = cFont, AxisColor = Color.Yellow, BackgroundColor = Color.Black, DrawingSource = EDrawingSource.CurrentTech, DrawAideLineColor = Color.LightSkyBlue, ForeColor = Color.White, GridColor = Color.FromArgb(0x30, 0x30, 0x30), LegendFont = cFont, TitleFont = cFont, TextFont = cFont, IsShowGrid = true, TradeLineColor = Color.GreenYellow, TradeSymbolColor = Color.DodgerBlue, ChartSettings = new List <ChartSetting>() { cSetting1, cSetting2 } }; __cChart.SetChartProperty(cProperty); SignalObject cObject = new TestScript(); cObject.onReady += SignalObject_onReady; cObject.ApplyProperty(new SignalProperty() { DefaultContracts = 1, InitialCapital = 100000, MaximumBarsReference = 0, OrderSource = "Netwings.OrderService;Netwings.SimulateOrderService" }); cObject.AddDataStreams(new List <InstrumentDataRequest>() { new InstrumentDataRequest() { Exchange = "TWSE", DataFeed = "Mitake", Range = new DataRequest(DateTime.Today, 1000, DataRequestType.BarsBack, DateTime.Today), Symbol = "TXF0.tw", Resolution = new Resolution(EResolution.Minute, 1) }, new InstrumentDataRequest() { Exchange = "TWSE", DataFeed = "Mitake", Range = new DataRequest(DateTime.Today, 1000, DataRequestType.BarsBack, DateTime.Today), Symbol = "TXF0.tw", Resolution = new Resolution(EResolution.Minute, 5) } }); }