Beispiel #1
0
        public static void AddIndicatorResult(PlotLine2D line_plot_2d, PriceSet price_set, IIndicator indicator, IList <Color> color_list, IList <int> selected_subindicators)
        {
            MarketModelSimulation market = new MarketModelSimulation(10000, price_set);

            double[] time = new double[price_set.Prices.Count];
            for (int price_index = 0; price_index < price_set.Prices.Count; price_index++)
            {
                time[price_index] = price_set.Prices[price_index].Time.Ticks;
            }
            Tuple <double[, ], bool[]> tuple      = indicator.ComputeAll(market, price_set.Second1.Count);
            List <IList <int> >        selections = CreateSections(tuple.Item2);

            for (int index = 0; index < selected_subindicators.Count; index++)
            {
                double[] signal = tuple.Item1.Select1DIndex1(selected_subindicators[index]);
                AddSignal(line_plot_2d, time, signal, selections, color_list[index]);
            }
        }