Beispiel #1
0
        public static void PlotPriceBid(string path, PriceSet price_set)
        {
            PlotLine2D line_plot_2d = new PlotLine2D();

            AddBid(line_plot_2d, price_set);
            ToolsPlotting.WriteToFile(path, line_plot_2d, SIZE_X, SIZE_Y);
        }
Beispiel #2
0
        public static void PlotMarketResult(string path, MarketResult market_result)
        {
            PlotLine2D line_plot_2d = new PlotLine2D();

            AddBidAskTrades(line_plot_2d, market_result);
            ToolsPlotting.WriteToFile(path, line_plot_2d, SIZE_X, SIZE_Y);
        }
Beispiel #3
0
        public static void PlotIndicatorResult(string path, PriceSet price_set, IIndicator indicator, IList <Color> color_list, IList <int> selected_subindicators, bool plot_bid = true)
        {
            PlotLine2D line_plot_2d = new PlotLine2D();

            AddIndicatorResult(line_plot_2d, price_set, indicator, color_list, selected_subindicators);
            if (plot_bid)
            {
                AddBid(line_plot_2d, price_set);
            }
            ToolsPlotting.WriteToFile(path, line_plot_2d, SIZE_X, SIZE_Y);
        }
Beispiel #4
0
 static void Old0(string[] args)
 {
     // sample are 30 per second.
     string [,] table = ToolsIOCSV.ReadCSVFile(@"D:\Dropbox\TestData\ML6\data_0.csv", Delimiter.Comma, Delimiter.None);
     string [] row    = table.Select1DIndex0(1);
     double[]  signal = new double[row.Length];
     for (int element_index = 0; element_index < row.Length; element_index++)
     {
         signal[element_index] = double.Parse(row[element_index].Replace('.', ','), NumberStyles.Any);
     }
     double[] speed = RunRoy1(signal, 128);
     ToolsPlotting.PlotLinesXY(@"D:\Dropbox\TestData\ML6\data_0.png", speed);
     Console.ReadLine();
 }
        public void DoExperiment()
        {
            List <PriceCandle> all_data = ToolsPrice.GetPriceCandles();

            // new DateTime(2016, 9, 3)
            PlotLine2D line_plot_2d = new PlotLine2D();


            for (int month_index = 1; month_index < 9; month_index++)
            {
                DateTimeUTC nfp_date = null;// ToolsTradingCalendarEvent.GetNFPDatetime(2016, month_index);

                DateTimeUTC   nfp_date_begin = nfp_date.AddMinutes(-100);
                DateTimeUTC   nfp_date_end   = nfp_date.AddMinutes(100);
                List <double> nfp_time       = new List <double>();
                List <double> nfp_bid        = new List <double>();

                double candle_time = 0;
                double subtract    = 0;
                foreach (PriceCandle candle in all_data)
                {
                    if ((nfp_date_begin <= candle.OpenTime) && (candle.OpenTime < nfp_date_end))
                    {
                        if (candle_time == 0)
                        {
                            subtract = candle.OpenBid;
                        }
                        nfp_time.Add(candle_time);
                        nfp_time.Add(candle_time);
                        nfp_time.Add(candle_time);
                        nfp_time.Add(candle_time);
                        nfp_bid.Add(candle.OpenBid);
                        nfp_bid.Add(candle.LowBid);
                        nfp_bid.Add(candle.HighBid);
                        nfp_bid.Add(candle.CloseBid);
                        candle_time++;
                    }
                }
                line_plot_2d.AddSeries(nfp_time, nfp_bid, Color.Black);
            }
            ToolsPlotting.WriteToFile(ToolsTradingDataSet.GetPath() + "nfp.png", line_plot_2d, 800, 800);
        }
Beispiel #6
0
 public static void WriteToFile(string path, PlotLine2D line_plot_2d)
 {
     ToolsPlotting.WriteToFile(path, line_plot_2d, SIZE_X, SIZE_Y);
 }