Beispiel #1
0
        private void plotPivots(Dictionary <int, string> pivots, string prefix)
        {
            int        objnum         = 0;
            List <int> orderedMarkers = pivots.Keys.ToList();

            orderedMarkers.Sort();
            //orderedMarkers = markers.Sort();
            foreach (int marker in orderedMarkers)
            {
                if (pivots[marker].Equals(MIN_MAX))
                {
                    DateTime timeValue = Bars.GetSessionEndTime(marker);
                    Draw.Dot(this, objnum.ToString() + prefix + "L", false, timeValue, Bars.GetHigh(marker), Brushes.Red);
                    objnum++;
                    Draw.Dot(this, objnum.ToString() + prefix + "L", false, timeValue, Bars.GetLow(marker), Brushes.Red);
                    objnum++;
                }
                else if (pivots[marker].Equals(MAX))
                {
                    DateTime timeValue = Bars.GetSessionEndTime(marker);
                    Draw.Dot(this, objnum.ToString() + prefix + "L", false, timeValue, Bars.GetHigh(marker), Brushes.Red);
                    objnum++;
                }
                else
                {
                    DateTime timeValue = Bars.GetSessionEndTime(marker);
                    Draw.Dot(this, objnum.ToString() + prefix + "L", false, timeValue, Bars.GetLow(marker), Brushes.Red);
                    objnum++;
                }
            }
        }
Beispiel #2
0
        private void plotSwingPivots(Dictionary <int, string> reducedPivots, string prefix)
        {
            List <int> orderedMarkers = reducedPivots.Keys.ToList();

            orderedMarkers.Sort();

            int    objnum   = 0;
            string previous = "";

            foreach (int marker in orderedMarkers)
            {
                if (reducedPivots[marker].Equals(MIN_MAX) && previous.Equals(MAX))
                {
                    DateTime timeValue = Bars.GetSessionEndTime(marker);
                    Draw.Diamond(this, objnum.ToString() + prefix + "M", false, timeValue, Bars.GetLow(marker), Brushes.Blue);
                    objnum++;
                    timeValue = Bars.GetSessionEndTime(marker);
                    Draw.Diamond(this, objnum.ToString() + prefix + "M", false, timeValue, Bars.GetHigh(marker), Brushes.White);
                    objnum++;
                }
                else if (reducedPivots[marker].Equals(MIN_MAX) && previous.Equals(MIN))
                {
                    DateTime timeValue = Bars.GetSessionEndTime(marker);
                    Draw.Diamond(this, objnum.ToString() + prefix + "M", false, timeValue, Bars.GetHigh(marker), Brushes.White);
                    objnum++;
                    timeValue = Bars.GetSessionEndTime(marker);
                    Draw.Diamond(this, objnum.ToString() + prefix + "M", false, timeValue, Bars.GetLow(marker), Brushes.Blue);
                    objnum++;
                }
                else if (reducedPivots[marker].Equals(MAX))
                {
                    DateTime timeValue = Bars.GetSessionEndTime(marker);
                    Draw.Diamond(this, objnum.ToString() + prefix + "M", false, timeValue, Bars.GetHigh(marker), Brushes.White);
                    objnum++;
                }
                else
                {
                    DateTime timeValue = Bars.GetSessionEndTime(marker);
                    Draw.Diamond(this, objnum.ToString() + prefix + "M", false, timeValue, Bars.GetLow(marker), Brushes.Blue);
                    objnum++;
                }
                previous = reducedPivots[marker];
            }
        }