Ejemplo n.º 1
0
        private void btn_support_resistant_predictor_1_Click(object sender, EventArgs e)
        {
            string item = getSelectedStockName();

            if (item == null)
            {
                UI.TimeoutMessage("Failed");
                return;
            }

            UI.TimeoutMessage();

            string report = Trend_Analyser_Connector.Trend_Analyser_Module_3_Support_Resistance_Predictor_1(item);

            MessageBox.Show(report);
        }
Ejemplo n.º 2
0
        public DataTable calc(List <string> symbols)
        {
            var map = new Dictionary <string, string>();

            DataTable table = initHeader();

            foreach (string sym in symbols)
            {
                string   result = Trend_Analyser_Connector.Trend_Analyser_Module_3_Support_Resistance_Predictor_1(sym);
                char[]   sep = { '\n' };
                string[] pairs = result.Split(sep);
                int      comma_index = -1;
                string   key, val;

                foreach (string keyval in pairs)
                {
                    if (keyval.Trim() != "")
                    {
                        comma_index = keyval.IndexOf(',');
                        //MessageBox.Show("Comma" + comma_index.ToString());
                        key      = keyval.Substring(1, comma_index - 1);
                        val      = keyval.Substring(comma_index + 1, keyval.Length - comma_index - 1);
                        map[key] = val;
                    }
                }

                //MessageBox.Show("Working till Here " + double.Parse(map["Predicted_Price"]).ToString());

                string not_possible_value = null;
                map.TryGetValue("Not_possible", out not_possible_value);

                if (not_possible_value == null)
                {
                    table.Rows.Add(map["Symbol"], map["Scanned"], double.Parse(map["Closing_Price"]), double.Parse(map["Predicted_Price"]), map["Predicted_Date"], map["Expected_Days"], double.Parse(map["Profit"]), double.Parse(map["Profit_Percentage"]), double.Parse(map["Trend"]));
                }
                //table.Rows.Add("TESTING", "30 days", 333.33, 444.44, "2018-01-01", 11.11, 6.66, 1.088888);
            }

            return(table);
        }