protected override void CollectMetaData(Indicators.Meta meta) { double val = 0; double[] paras = new double[paramGrid.Rows.Count]; for (int idx = 0; idx < paramGrid.Rows.Count; idx++) { paras[idx] = (double.TryParse(paramGrid[1, idx].Value.ToString(), out val) ? val : 0); } meta.Parameters = paras; Indicators.Meta.OutputInfo[] outPut = new Indicators.Meta.OutputInfo[outputGrid.Rows.Count]; for (int idx = 0; idx < outputGrid.Rows.Count; idx++) { outPut[idx] = new Indicators.Meta.OutputInfo((Color)outputGrid[outColorColumn.Name, idx].Value, int.Parse(outputGrid[outWeightColumn.Name, idx].Value.ToString()), (AppTypes.ChartTypes)outputGrid[outChartTypeColumn.Name, idx].Value); } meta.Output = outPut; meta.DrawInNewWindow = inNewPaneChk.Checked; if (cbbWindow.SelectedItem.ToString().Equals(Languages.Libs.GetString("newPanel"))) { meta.SelectedWindowName = meta.ListWindowNames[constPaneNameNew].ToString(); } else if (cbbWindow.SelectedItem.ToString().Equals(Languages.Libs.GetString("pricePanel"))) { meta.SelectedWindowName = meta.ListWindowNames[constPaneNamePrice].ToString(); } else { meta.SelectedWindowName = meta.ListWindowNames[cbbWindow.SelectedItem.ToString()].ToString(); } }
public commonIndicatorForm(Indicators.Meta meta) : base(meta) { InitializeComponent(); tabControl.SendToBack(); SetPara(meta); }
/// <summary> /// Create parametter grid from meta.ParameterDefaultValues /// </summary> /// <param name="meta"></param> protected void SetPara(Indicators.Meta meta) { this.Text = meta.Name; paramGrid.Rows.Clear(); string[] keys = meta.ParameterList.Keys; object[] values = meta.ParameterList.Values; for (int idx = 0; idx < keys.Length; idx++) { paramGrid.Rows.Add(keys[idx], values[idx]); } valueColumn.DefaultCellStyle.Format = "N" + meta.ParameterPrecision.ToString(); inNewPaneChk.Checked = meta.DrawInNewWindow; keys = meta.OutputInfoList.Keys; values = meta.OutputInfoList.Values; for (int idx = 0; idx < keys.Length; idx++) { Color color = (meta.Output.Length > idx ? meta.Output[idx].Color : Color.Red); int weight = (meta.Output.Length > idx ? meta.Output[idx].Weight : 1); AppTypes.ChartTypes chartType = (meta.Output.Length > idx ? meta.Output[idx].ChartType : AppTypes.ChartTypes.Line); outputGrid.Rows.Add(keys[idx], color, weight, chartType); } paraDescEd.Text = common.system.ToString(meta.ParameterDescriptions); hintTextEd.Text = meta.Description + common.Consts.constCRLF + meta.URL; }
public sampleMACD(Indicators.Meta meta) : base(meta) { InitializeComponent(); macdColorEd.LoadColors(); signalColorEd.LoadColors(); histColorCb.LoadColors(); this.macdColorEd.Color = (meta.Output.Length > 0?meta.Output[0].Color:Color.Green); this.signalColorEd.Color = (meta.Output.Length > 1 ? meta.Output[1].Color : Color.Red); this.histColorCb.Color = (meta.Output.Length > 2 ? meta.Output[2].Color : Color.Navy); this.macdWeightEd.Value = (meta.Output.Length > 0 ? meta.Output[0].Weight : 1); this.sigWeightEd.Value = (meta.Output.Length > 1 ? meta.Output[1].Weight : 1); this.histWeightEd.Value = (meta.Output.Length > 2 ? meta.Output[2].Weight : 1); }
//TUAN 9/3/2012 public void updateFormFromMeta(Indicators.Meta _meta) { if (_meta.ListWindowNames != null) { foreach (DictionaryEntry item in _meta.ListWindowNames) { if (item.Key.Equals(constPaneNamePrice) || item.Key.Equals(constPaneNameNew)) { } else { cbbWindow.Items.Add(item.Key.ToString()); } } cbbWindow.SelectedIndex = 0; } }
protected override void CollectMetaData(Indicators.Meta meta) { meta.Parameters = new double[] { (int)fastParaEd.Value, (int)slowParaEd.Value, (int)signalParaEd.Value }; meta.DrawInNewWindow = inNewPaneChk.Checked; meta.Output = new Indicators.Meta.OutputInfo[3]; meta.Output[0].ChartType = AppTypes.ChartTypes.Line; meta.Output[0].Color = macdColorEd.Color; meta.Output[0].Weight = (byte)macdWeightEd.Value; meta.Output[1].ChartType = AppTypes.ChartTypes.Line; meta.Output[1].Color = signalColorEd.Color; meta.Output[1].Weight = (byte)sigWeightEd.Value; meta.Output[2].ChartType = AppTypes.ChartTypes.Bar; meta.Output[2].Color = histColorCb.Color; meta.Output[2].Weight = (byte)histWeightEd.Value; }
protected override void CollectMetaData(Indicators.Meta meta) { double val = 0; double[] paras = new double[paramGrid.Rows.Count]; for (int idx = 0; idx < paramGrid.Rows.Count; idx++) { paras[idx] = (double.TryParse(paramGrid[1, idx].Value.ToString(), out val) ? val : 0); } meta.Parameters = paras; Indicators.Meta.OutputInfo[] outPut = new Indicators.Meta.OutputInfo[outputGrid.Rows.Count]; for (int idx = 0; idx < outputGrid.Rows.Count; idx++) { outPut[idx] = new Indicators.Meta.OutputInfo((Color)outputGrid[outColorColumn.Name, idx].Value, int.Parse(outputGrid[outWeightColumn.Name, idx].Value.ToString()), (AppTypes.ChartTypes)outputGrid[outChartTypeColumn.Name, idx].Value); } meta.Output = outPut; meta.DrawInNewWindow = inNewPaneChk.Checked; }
public commonIndicatorForm(Indicators.Meta meta) : base(meta) { InitializeComponent(); tabControl.SendToBack(); SetPara(meta); //TUAN 7/24/2012 - Add Windows selection for drawing - BEGIN if (meta.ListWindowNames != null) { lblWindow.Visible = true; cbbWindow.Visible = true; inNewPaneChk.Visible = false; if (meta.DrawInNewWindow) { cbbWindow.Items.Add(Languages.Libs.GetString("newPanel")); cbbWindow.Items.Add(Languages.Libs.GetString("pricePanel")); } else { cbbWindow.Items.Add(Languages.Libs.GetString("pricePanel")); cbbWindow.Items.Add(Languages.Libs.GetString("newPanel")); } foreach (DictionaryEntry item in meta.ListWindowNames) { if (item.Key.Equals(constPaneNamePrice) || item.Key.Equals(constPaneNameNew)) { } else { cbbWindow.Items.Add(item.Key.ToString()); } } cbbWindow.SelectedIndex = 0; } //TUAN 7/24/2012 - Add Windows selection for drawing - END }
public baseIndicatorForm(Indicators.Meta meta) { InitializeComponent(); Indicators.Libs.GetLocalConfig(meta); this.FormMeta = meta; }
protected virtual void CollectMetaData(Indicators.Meta meta) { }
public baseIndicatorForm(Indicators.Meta meta) { InitializeComponent(); Indicators.Libs.GetUserSettings(meta); this.FormMeta = meta; }