private void ShowResult(IIndicator indicator) { Console.WriteLine(indicator.ToString()); Console.WriteLine("Slot type: {0}", indicator.IndParam.SlotType); Console.WriteLine("Logic rule: {0}", indicator.IndParam.ListParam[0].Text); foreach (IndicatorComp component in indicator.Component) { if(component == null) continue; IndComponentType type = component.DataType; int bars = component.Value.Length; string name = component.CompName; double value = component.Value[bars - 1]; double val = Math.Abs(value); string format = val < 10 ? "F5" : val < 100 ? "F4" : val < 1000 ? "F3" : val < 10000 ? "F2" : val < 100000 ? "F1" : "F0"; if (!component.ShowInDynInfo) continue; if (type == IndComponentType.AllowOpenLong || type == IndComponentType.AllowOpenShort || type == IndComponentType.ForceClose || type == IndComponentType.ForceCloseLong || type == IndComponentType.ForceCloseShort) Console.WriteLine("{0}: {1} ", name, (value < 1 ? "No" : "Yes")); else Console.WriteLine("{0}: {1}", name, value.ToString(format)); } Console.WriteLine(); }
private void FormPlugins_Load(object sender, EventArgs e) { plugin.FindPlugins(Properties.Settings.Default.GlobalDirectoryRoot + Properties.Settings.Default.GlobalDirectoryPlugins); foreach (AvailablePlugin <IIndicator> plug in plugin.AvailablePlugins) { Assembly pluginAssembly = Assembly.LoadFrom(plug.AssemblyPath); plug.Instance = (IIndicator)Activator.CreateInstance(pluginAssembly.GetType(plug.PlugType.ToString())); IIndicator rne = plug.Instance; TreeNode node = new TreeNode(rne.ToString()); node.Tag = plug; treePlugins.Nodes.Add(node); } if (treePlugins.Nodes.Count > 0) { selected = (AvailablePlugin <IIndicator>)treePlugins.Nodes[0].Tag; lblName.Text = selected.Instance.Name; txtAuthor.Text = selected.Instance.Author; txtDescription.Text = selected.Instance.Description; txtVersion.Text = selected.Instance.Version; } }
private void ShowResult(IIndicator indicator) { Console.WriteLine(indicator.ToString()); Console.WriteLine("Slot type: {0}", indicator.IndParam.SlotType); Console.WriteLine("Logic rule: {0}", indicator.IndParam.ListParam[0].Text); foreach (IndicatorComp component in indicator.Component) { if (component == null) { continue; } IndComponentType type = component.DataType; int bars = component.Value.Length; string name = component.CompName; double value = component.Value[bars - 1]; double val = Math.Abs(value); string format = val < 10 ? "F5" : val < 100 ? "F4" : val < 1000 ? "F3" : val < 10000 ? "F2" : val < 100000 ? "F1" : "F0"; if (!component.ShowInDynInfo) { continue; } if (type == IndComponentType.AllowOpenLong || type == IndComponentType.AllowOpenShort || type == IndComponentType.ForceClose || type == IndComponentType.ForceCloseLong || type == IndComponentType.ForceCloseShort) { Console.WriteLine("{0}: {1} ", name, (value < 1 ? "No" : "Yes")); } else { Console.WriteLine("{0}: {1}", name, value.ToString(format)); } } Console.WriteLine(); }