示例#1
0
        private int Test01_b(int nextDate, int date, CSChart csc)
        {
            for (int c = 0; c <
                 4
                 //10
                 //20
                 ; c++)
            {
                {
                    long dt     = date * 1000000L + 90000;
                    long nextDt = nextDate * 1000000L + 90000;

                    if (csc.GetPrice(dt).Mid < csc.GetPrice(nextDt).Mid)
                    {
                        break;
                    }
                }

                do
                {
                    nextDate = DateToDay.ToDate(DateToDay.ToDay(nextDate) + 1);
                }while ("土日".Contains(DateTimeUnit.FromDate(nextDate).GetWeekday()));
            }
            return(nextDate);
        }
示例#2
0
        private void Test01_a(int dateStart, int dateEnd)
        {
            for (int maDay = 5; maDay <= 30; maDay += 5)
            {
                List <Info> infos = new List <Info>();

                CSChartManager cscm = new CSChartManager();
                CSChart        csc  = cscm.GetCSChart("USDJPY");
                TTChart        ttc  = new TTChart(csc);
                MAChart        mac  = new MAChart(ttSec => ttc.GetPrice(ttSec).Mid, 60 * 24 * maDay, 60);

                for (int date = dateStart; date <= dateEnd;)
                {
                    int nextDate = date;

                    do
                    {
                        nextDate = DateToDay.ToDate(DateToDay.ToDay(nextDate) + 1);
                    }while ("土日".Contains(DateTimeUnit.FromDate(nextDate).GetWeekday()));

                    int bNextDate = Test01_b(nextDate, date, csc);

                    long dt      = date * 1000000L + 90000;
                    long bNextDt = bNextDate * 1000000L + 90000;

                    // ----

                    infos.Add(new Info()
                    {
                        MvAvgPrice   = mac.GetPrice(TTCommon.DateTimeToTTSec(dt)),
                        Price        = csc.GetPrice(dt).Mid,
                        NextDayPrice = csc.GetPrice(bNextDt).Mid,
                    });

                    // ----

                    date = nextDate;
                }

                using (CsvFileWriter writer = new CsvFileWriter(string.Format(@"C:\temp\maDay={0}.csv", maDay)))
                {
                    foreach (Info info in infos)
                    {
                        writer.WriteCell(info.Price.ToString("F9"));
                        writer.WriteCell(info.MvAvgPrice.ToString("F9"));
                        writer.WriteCell(info.NextDayPrice.ToString("F9"));
                        writer.WriteCell((info.MvAvgPrice / info.Price).ToString("F9"));
                        writer.WriteCell((info.NextDayPrice / info.Price).ToString("F9"));
                        writer.EndRow();
                    }
                }
            }
        }
示例#3
0
        public void Test01()
        {
            CSChartManager cscm  = new CSChartManager();
            CSChart        csc   = cscm.GetCSChart("USDJPY");
            CSPrice        price = csc.GetPrice(20191101060531);

            Console.WriteLine(price.Hig);
        }