Exemplo n.º 1
0
        private void menuPredict_Click(object sender, EventArgs e)
        {
            try
            {
                int i = lbStocks.SelectedIndex;
                if (i < 0)
                {
                    return;
                }

                StockState state = stockDictionary[Stocks[i]];
                state.predict();
            }
            catch (Exception ex)
            {
                invoke_AppendLogText(ex.Message);
            }
        }
Exemplo n.º 2
0
        protected void initial()
        {
            Stocks = (List <String>)lbStocks.Tag;
            Task task = Job.getInstance().addTask(Stocks.Count);

            for (int i = 0; i < Stocks.Count; i++)
            {
                StockState stockState = new StockState(Stocks[i]);
                stockState.loadHistoryData(System.Windows.Forms.Application.StartupPath + Path.DirectorySeparatorChar + Stocks[i] + ".csv");
                //BP bpNetwork = new BP(Constants.Input_Days * 4, Constants.Hidden_Layor_Count, Constants.Output_Days * 4);
                //stockState.neuralMatrix = bpNetwork;
                String filename = System.Windows.Forms.Application.StartupPath + Path.DirectorySeparatorChar + Stocks[i] + ".data";
                stockState.loadNeuralMatrixData(filename);
                stockDictionary.Add(Stocks[i], stockState);
                task.process();
            }
            isInitializing = false;
        }
Exemplo n.º 3
0
        private void lbStocks_MouseUp(object sender, MouseEventArgs e)
        {
            if (isInitializing)
            {
                return;
            }
            int i = lbStocks.SelectedIndex;

            if (i < 0)
            {
                return;
            }
            StockState state = stockDictionary[Stocks[i]];

            if (state.predictData != null)
            {
                drawDailyK(state.predictData);
            }
        }
Exemplo n.º 4
0
        private void menuTrain_Click(object sender, EventArgs e)
        {
            try
            {
                int i = lbStocks.SelectedIndex;
                if (i < 0)
                {
                    return;
                }

                StockState state = stockDictionary[Stocks[i]];
                state.initial();
                Thread thrd = new Thread(state.training);
                thrd.Start();
            }
            catch (Exception ex)
            {
                invoke_AppendLogText(ex.Message);
            }
        }