Пример #1
0
 public override int GetHashCode()
 {
     return(PersonId.GetHashCode() ^
            ConceptId.GetHashCode() ^
            (StartDate.GetHashCode()) ^
            (EndDate.GetHashCode()) ^
            TypeConceptId.GetHashCode() ^
            VisitOccurrenceId.GetHashCode() ^
            ValueAsNumber.GetHashCode() ^
            RangeLow.GetHashCode() ^
            RangeHigh.GetHashCode() ^
            VisitOccurrenceId.GetHashCode() ^
            ValueAsConceptId.GetHashCode() ^
            Time.GetHashCode() ^
            ProviderId.GetHashCode() ^
            RelevantConditionConceptId.GetHashCode() ^
            UnitsConceptId.GetHashCode() ^
            (ValueAsString != null ? ValueAsString.GetHashCode() : 0) ^
            (UnitsSourceValue != null ? UnitsSourceValue.GetHashCode() : 0) ^
            (SourceValue != null ? SourceValue.GetHashCode() : 0));
 }
Пример #2
0
 public override int GetHashCode()
 {
     return(PersonId.GetHashCode() ^
            ConceptId.GetHashCode() ^
            (StartDate.GetHashCode()) ^
            (EndDate.GetHashCode()) ^
            TypeConceptId.GetHashCode() ^
            VisitOccurrenceId.GetHashCode() ^
            ValueAsNumber.GetHashCode() ^
            RangeLow.GetHashCode() ^
            RangeHigh.GetHashCode() ^
            OperatorConceptId.GetHashCode() ^
            VisitOccurrenceId.GetHashCode() ^
            ValueAsConceptId.GetHashCode() ^
            (Time != null ? Time.GetHashCode() : 0) ^
            ProviderId.GetHashCode() ^
            (ValueSourceValue != null ? ValueSourceValue.GetHashCode() : 0) ^
            SourceConceptId.GetHashCode() ^
            UnitConceptId.GetHashCode() ^
            (UnitSourceValue != null ? UnitSourceValue.GetHashCode() : 0) ^
            (SourceValue != null ? SourceValue.GetHashCode() : 0));
 }
Пример #3
0
        internal string InternalToString(object value)
        {
            var include = Inclusive ? "" : Sql.NOT;

            return($"{value.ToString()} {include} {Sql.BETWEEN} {RangeLow.ToString()} {Sql.AND} {RangeHigh.ToString()}");
        }
Пример #4
0
        protected override void OnBarUpdate()
        {
            if (BarsInProgress == 1)
            {
                return;
            }
            if (Bars.IsFirstBarOfSession)
            {
                sessionOpen = Open[0];
                openTime    = Time[0];
                if (CurrentBars[(int)BarsUpdating.Daily] < RangePeriod)
                {
                    return;
                }

                normalAtr  = this.ToTickSize(raphael[0]);
                rangeSplit = this.ToTickSize(normalAtr / 2);
                renet.RecalculateSession(Time[0]);
                foreach (BrushSeries brush in PlotBrushes)
                {
                    brush[0] = Brushes.Transparent;
                }
            }

            if (renet.IsRegularTradingHours(Time[0]))
            {
                DayOpen[0] = sessionOpen;
                // draw rectangle for first 5 minutes maybe? Help try and catch lots of volume on tick chart
                // e.g., -> the wider the rectangle, the more activity in the first 5 minutes.


                if (normalAtr > 0 && rangeSplit > 0)
                {
                    RangeMax[0]  = DayOpen[0] + normalAtr;
                    RangeHigh[0] = RangeMax[0] - rangeSplit;

                    RangeMin[0] = DayOpen[0] - normalAtr;
                    RangeLow[0] = RangeMin[0] + rangeSplit;
                }

                if (!Bars.IsFirstBarOfSession)
                {
                    return;
                }

                double weakAtr     = this.ToTickSize(raphael.atrFromOpen[0]);
                double strongAtr   = this.ToTickSize(raphael.atrFromPriorOpen[0]);
                double weakSplit   = this.ToTickSize(weakAtr / 2);
                double strongSplit = this.ToTickSize(strongAtr / 2);

                priceZoneArray[0] = new PriceZone
                {
                    Name     = "Max Zone",
                    Index    = 0,
                    ZoneHigh = RangeMax[0],
                    ZoneLow  = RangeHigh[0],

                    StartTime = Time[0],
                    EndTime   = renet.CurrentSessionEnd(Time[0]),

                    ZoneStrong = DayOpen[0] + strongAtr,
                    ZoneWeak   = DayOpen[0] + weakAtr,
                };
                priceZoneArray[1] = new PriceZone
                {
                    Name       = "Bull Zone",
                    Index      = 1,
                    ZoneHigh   = RangeHigh[0],
                    ZoneLow    = DayOpen[0],
                    StartTime  = Time[0],
                    EndTime    = renet.CurrentSessionEnd(Time[0]),
                    ZoneStrong = priceZoneArray[0].ZoneStrong - strongSplit,
                    ZoneWeak   = priceZoneArray[0].ZoneWeak - weakSplit,
                };
                // there is *probably* an open zone burried in here somewhere
                // look at Fri Jun 17 2016... tests open - 4 ticks twice
                // ... could there be a weak/strong open?
                priceZoneArray[2] = new PriceZone
                {
                    Name       = "Open Zone",
                    Index      = 2,
                    ZoneHigh   = DayOpen[0],
                    ZoneLow    = DayOpen[0],
                    StartTime  = Time[0],
                    EndTime    = renet.CurrentSessionEnd(Time[0]),
                    ZoneStrong = DayOpen[0] + (4 * TickSize),
                    ZoneWeak   = DayOpen[0] - (4 * TickSize)
                };



                priceZoneArray[3] = new PriceZone
                {
                    Name       = "Bear Zone",
                    Index      = 3,
                    ZoneHigh   = DayOpen[0],
                    ZoneLow    = RangeLow[0],
                    StartTime  = Time[0],
                    EndTime    = renet.CurrentSessionEnd(Time[0]),
                    ZoneWeak   = (DayOpen[0] - weakAtr) + weakSplit,
                    ZoneStrong = (DayOpen[0] - strongAtr) + strongSplit
                };

                priceZoneArray[4] = new PriceZone
                {
                    Name       = "Min Zone",
                    Index      = 4,
                    ZoneHigh   = RangeLow[0],
                    ZoneLow    = RangeMin[0],
                    StartTime  = Time[0],
                    EndTime    = renet.CurrentSessionEnd(Time[0]),
                    ZoneWeak   = DayOpen[0] - weakAtr,
                    ZoneStrong = DayOpen[0] - strongAtr
                };
            }
            else
            {
                DayOpen.Reset();
                RangeMin.Reset();
                RangeMax.Reset();
                RangeLow.Reset();
                RangeHigh.Reset();
            }
            priceZoneSeries[0] = priceZoneArray;
        }