Example #1
0
        public static TrendHit FromDto(TrendHitDto dto)
        {
            var trendHit = new TrendHit
            {
                TrendHitId        = dto.TrendHitId,
                TrendlineId       = dto.TrendlineId,
                ExtremumGroupId   = dto.ExtremumGroupId,
                Value             = dto.Value,
                PointsForDistance = dto.PointsForDistance,
                PointsForValue    = dto.PointsForValue,
                Gap         = dto.Gap,
                RelativeGap = dto.RelativeGap
            };

            return(trendHit);
        }
Example #2
0
 private void Reset()
 {
     this.trendBreak = null;
     this.trendHit = null;
 }
Example #3
0
 public TrendBounce(Trendline trendline, TrendHit startHit)
 {
     this.Trendline = trendline;
     this.StartHit = startHit;
     this.breaks = new List<TrendBreak>();
 }
Example #4
0
        public void setNewHit(DataItem item, double level, TrendlineType type)
        {
            TrendHit hit = new TrendHit(this, item, level, type, currentHit, currentBounce);
            TrendBounce bounce = new TrendBounce(this, hit);
            hit.BounceToNextHit = bounce;

            //Close current hit and bounce.
            if (currentHit != null)
            {
                currentHit.NextHit = hit;
                this.Hits.Add(currentHit);
            }
            if (currentBounce != null)
            {
                currentBounce.EndHit = hit;
                this.Bounces.Add(currentBounce);
            }

            currentHit = hit;
            currentBounce = bounce;

            //Calculate points.
            //hit.Calculate();
            //bounce.Calculate();
        }
Example #5
0
 public void AddHit(TrendHit hit)
 {
     this.Hits.Add(hit);
     this.RecalculateScore();
 }
Example #6
0
 public TrendHit(Trendline trendline, DataItem item, double crossPoint, TrendlineType type, TrendHit prevHit, TrendBounce prevBounce)
     : this(trendline, item, crossPoint, type)
 {
     this.PreviousHit = prevHit;
     this.BounceFromPreviousHit = prevBounce;
 }