Beispiel #1
0
        /// <summary>
        /// ツールストリップボタンの日足、週足、月足の表示設定
        /// </summary>
        /// <param name="chartScale"></param>
        private void ChangeChartScaleDisplay(ChartScales chartScale)
        {
            HiashiButton.BackColor      = SystemColors.Control;
            HiashiButton.ForeColor      = SystemColors.ControlText;
            SyuashiButton.BackColor     = SystemColors.Control;
            SyuashiButton.ForeColor     = SystemColors.ControlText;
            TukiashiButton.BackColor    = SystemColors.Control;
            TukiashiButton.ForeColor    = SystemColors.ControlText;
            日足ToolStripMenuItem.Checked = false;
            週足ToolStripMenuItem.Checked = false;
            月足ToolStripMenuItem.Checked = false;

            MyConfig.ChartScale = chartScale;

            switch (chartScale)
            {
            case ChartScales.Daily:
                HiashiButton.BackColor      = SystemColors.Highlight;
                HiashiButton.ForeColor      = SystemColors.ControlLightLight;
                日足ToolStripMenuItem.Checked = true;
                break;

            case ChartScales.Weekly:
                SyuashiButton.BackColor     = SystemColors.Highlight;
                SyuashiButton.ForeColor     = SystemColors.ControlLightLight;
                週足ToolStripMenuItem.Checked = true;
                break;

            case ChartScales.Monthly:
                TukiashiButton.BackColor    = SystemColors.Highlight;
                TukiashiButton.ForeColor    = SystemColors.ControlLightLight;
                月足ToolStripMenuItem.Checked = true;
                break;
            }
        }
 public void ClearSeriesAndYscales()
 {
     SeriesList.Clear();
     Yscale1 = ChartScales.None;
     Yscale2 = ChartScales.None;
     Yscale3 = ChartScales.None;
     Yscale4 = ChartScales.None;
 }
Beispiel #3
0
        public int GetIdouheikinPoint(AveSteps _aveStep, ChartScales _chartScale, int n)
        {
            List <List <int> > Idouheikins;

            Idouheikins = IdouheikinScales[(int)_aveStep];

            return(Idouheikins[(int)_chartScale][n]);
        }
 public SeeSeriesOptions(string tableName, string columnName, string seriesName,
                         Gallery galleryType, ChartScales chartScale, bool stacked, int yaxisNum)
 {
     TableName   = tableName;
     ColumnName  = columnName;
     GalleryType = galleryType;
     Stacked     = stacked;
     ChartScale  = chartScale;//Bytes, Counts, Percentage
     YaxisLabel  = chartScale.ToString();
     YaxisNumber = yaxisNum;
     SeriesName  = seriesName;//Must do this last
 }
        public void AddSeries(string tableName, string columnName, string seriesName,
                              Gallery galleryType, ChartScales chartScale, bool stacked, int yaxisNum)
        {
            SeeSeriesOptions sOptions = new SeeSeriesOptions();

            sOptions.TableName   = tableName;
            sOptions.ColumnName  = columnName;
            sOptions.GalleryType = galleryType;
            sOptions.Stacked     = stacked;
            sOptions.ChartScale  = chartScale;           //Bytes, Counts, Percentage
            sOptions.YaxisLabel  = chartScale.ToString();
            sOptions.YaxisNumber = yaxisNum;
            sOptions.SeriesName  = seriesName;           //Must do this last
            sOptions.SeriesIndex = SeriesList.Count;     //Must do this before adding the series to the collection
            SeriesList.Add(sOptions);
        }
 public static void AssignDefaultYaxisScales(out ChartScales y1, out ChartScales y2, out ChartScales y3,
                                             bool IncBytes, bool IncCount, bool IncPercent)
 {
     y1 = ChartScales.None;            //Make sure initial values are None
     y2 = ChartScales.None;
     y3 = ChartScales.None;
     #region Assign Default Yaxis Scales
     if (IncBytes && !IncCount && !IncPercent)           //Bytes Only
     {
         y1 = ChartScales.Bytes;
     }
     else if (IncCount && !IncBytes && !IncPercent)           //Counts Only
     {
         y1 = ChartScales.Count;
     }
     else if (IncPercent && !IncBytes && !IncCount)            //Percentage Only
     {
         y1 = ChartScales.Percent;
     }
     else if (IncBytes && IncCount && !IncPercent)           //Bytes and Counts
     {
         y1 = ChartScales.Count;
         y2 = ChartScales.Bytes;
     }
     else if (IncBytes && IncPercent && !IncCount)            //Bytes and Percentage
     {
         y1 = ChartScales.Percent;
         y2 = ChartScales.Bytes;
     }
     else if (IncCount && IncPercent && !IncBytes)           //Counts and Percentage
     {
         y1 = ChartScales.Percent;
         y2 = ChartScales.Count;
     }
     else if (IncBytes && IncCount && IncPercent)           //Bytes, Counts and Percentage
     {
         y1 = ChartScales.Percent;
         y2 = ChartScales.Count;
         y3 = ChartScales.Bytes;
     }
     #endregion
 }
Beispiel #7
0
        /// <summary>
        /// 株価テーブル作成
        /// </summary>
        /// <param name="plotEnd"></param>
        /// <param name="plotWide"></param>
        public void MakeTable(int plotEnd, int plotWide, ChartScales chartScale, AveSteps aveStep)
        {
            // 株価テーブル作成
            var calendar   = new ActiveMarket.Calendar();
            var _kabukaRow = new KabukaRow();
            int?_datePos   = plotEnd;

            this.PlotWide   = plotWide;
            this.ChartScale = chartScale;
            this.AveStep    = aveStep;
            OwarineList     = new List <Owarine>();

            PriceTable.Clear();

            var cnt = 0;

            while (cnt < this.PlotWide)
            {
                if (_datePos.Value < Price.Begin())
                {
                    break;
                }
                _kabukaRow = GetOneRow(_datePos.Value);
                if (_kabukaRow != null)
                {
                    DataRow row = PriceTable.NewRow();
                    row["StartPos"]  = _kabukaRow.StartPos;
                    row["EndPos"]    = _kabukaRow.EndPos;
                    row["StartDate"] = _kabukaRow.StartDate;
                    row["EndDate"]   = _kabukaRow.EndDate;
                    row["High"]      = _kabukaRow.High;
                    row["Low"]       = _kabukaRow.Low;
                    row["Open"]      = _kabukaRow.Open;
                    row["Close"]     = _kabukaRow.Close;
                    row["Heikin1"]   = 0;
                    row["Heikin2"]   = 0;
                    row["Heikin3"]   = 0;
                    row["Heikin4"]   = 0;
                    row["Heikin5"]   = 0;
                    PriceTable.Rows.Add(row);

                    OwarineList.Add(new Owarine(_kabukaRow.EndPos, _kabukaRow.Close));

                    cnt++;
                }
                _datePos = NextDatePosition(_datePos.Value, Directions.Befor);
                if (!_datePos.HasValue)
                {
                    break;
                }
            }

            // 終値リストの作成(PlotStart以前300件)
            var MaxCount = 300;

            _datePos = OwarineList.Select(n => n.DatePos).Min();
            cnt      = 0;
            for (var i = 0; i < MaxCount; i++)
            {
                _datePos = NextDatePosition(_datePos.Value, Directions.Befor);
                if (!_datePos.HasValue)
                {
                    break;
                }
                OwarineList.Add(new Owarine(_datePos.Value, Price.Close(_datePos.Value)));
            }
            for (var i = 0; i < PtCount; i++)
            {
                for (var j = 0; j < 5; j++)
                {
                    SetHeikin(i, j);
                }
            }
        }