Пример #1
0
        /// <summary>
        ///      Initializes a new instance of the <see cref="DarkCloudCover"/> class using the specified name.
        /// </summary>
        /// <param name="name">The name of this indicator</param>
        /// <param name="penetration">Percentage of penetration of a candle within another candle</param>
        public DarkCloudCover(string name, double penetration = 0.5d)
            : base(name, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod + 1 + 1)
        {
            _penetration = penetration;

            _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;
        }
Пример #2
0
        /// <summary>
        ///      Initializes a new instance of the <see cref="MatHold"/> class using the specified name.
        /// </summary>
        /// <param name="name">The name of this indicator</param>
        /// <param name="penetration">Percentage of penetration of a candle within another candle</param>
        public MatHold(string name, double penetration = 0.5d)
            : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod) + 4 + 1)
        {
            _penetration = penetration;

            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;
            _bodyLongAveragePeriod  = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;
        }
Пример #3
0
        /// <summary>
        /// Returns the average range of the previous candles
        /// </summary>
        /// <param name="type">The type of setting to use</param>
        /// <param name="sum">The sum of the previous candles ranges</param>
        /// <param name="tradeBar">The input candle</param>
        protected static double GetCandleAverage(CandleSettingType type, double sum, DoubleArray tradeBar)
        {
            var defaultSetting = CandleSettings.Get(type);

            return(defaultSetting.Factor *
                   (defaultSetting.AveragePeriod != 0 ? sum / defaultSetting.AveragePeriod : GetCandleRange(type, tradeBar)) /
                   (defaultSetting.RangeType == CandleRangeType.Shadows ? 2.0d : 1.0d));
        }
Пример #4
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="InvertedHammer"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public InvertedHammer(string name)
     : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod),
                           CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod) + 1 + 1)
 {
     _bodyShortAveragePeriod       = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;
     _shadowLongAveragePeriod      = CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod;
     _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;
 }
Пример #5
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="SeparatingLines"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public SeparatingLines(string name)
     : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod),
                           CandleSettings.Get(CandleSettingType.Equal).AveragePeriod) + 1 + 1)
 {
     _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;
     _bodyLongAveragePeriod        = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;
     _equalAveragePeriod           = CandleSettings.Get(CandleSettingType.Equal).AveragePeriod;
 }
Пример #6
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="RickshawMan"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public RickshawMan(string name)
     : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod),
                           CandleSettings.Get(CandleSettingType.Near).AveragePeriod) + 1)
 {
     _bodyDojiAveragePeriod   = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;
     _shadowLongAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod;
     _nearAveragePeriod       = CandleSettings.Get(CandleSettingType.Near).AveragePeriod;
 }
Пример #7
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="Takuri"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public Takuri(string name)
     : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod),
                           CandleSettings.Get(CandleSettingType.ShadowVeryLong).AveragePeriod) + 1)
 {
     _bodyDojiAveragePeriod        = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;
     _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;
     _shadowVeryLongAveragePeriod  = CandleSettings.Get(CandleSettingType.ShadowVeryLong).AveragePeriod;
 }
Пример #8
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="StalledPattern"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public StalledPattern(string name)
     : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod),
                           Math.Max(CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod, CandleSettings.Get(CandleSettingType.Near).AveragePeriod)) + 2 + 1)
 {
     _bodyLongAveragePeriod        = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;
     _bodyShortAveragePeriod       = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;
     _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;
     _nearAveragePeriod            = CandleSettings.Get(CandleSettingType.Near).AveragePeriod;
 }
Пример #9
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="ThreeStarsInSouth"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public ThreeStarsInSouth(string name)
     : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod),
                           Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod)) + 2 + 1)
 {
     _bodyLongAveragePeriod        = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;
     _shadowLongAveragePeriod      = CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod;
     _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;
     _bodyShortAveragePeriod       = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;
 }
Пример #10
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="ThreeWhiteSoldiers"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public ThreeWhiteSoldiers(string name)
     : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod),
                           Math.Max(CandleSettings.Get(CandleSettingType.Far).AveragePeriod, CandleSettings.Get(CandleSettingType.Near).AveragePeriod)) + 2 + 1)
 {
     _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;
     _nearAveragePeriod            = CandleSettings.Get(CandleSettingType.Near).AveragePeriod;
     _farAveragePeriod             = CandleSettings.Get(CandleSettingType.Far).AveragePeriod;
     _bodyShortAveragePeriod       = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;
 }
Пример #11
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="HangingMan"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public HangingMan(string name)
     : base(name, Math.Max(Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod),
                                    CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod), CandleSettings.Get(CandleSettingType.Near).AveragePeriod) + 1 + 1)
 {
     _bodyShortAveragePeriod       = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;
     _shadowLongAveragePeriod      = CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod;
     _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;
     _nearAveragePeriod            = CandleSettings.Get(CandleSettingType.Near).AveragePeriod;
 }
Пример #12
0
        /// <summary>
        ///      Initializes a new instance of the <see cref="EveningDojiStar"/> class using the specified name.
        /// </summary>
        /// <param name="name">The name of this indicator</param>
        /// <param name="penetration">Percentage of penetration of a candle within another candle</param>
        public EveningDojiStar(string name, double penetration = 0.3d)
            : base(name, Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod),
                                  CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod) + 2 + 1)
        {
            _penetration = penetration;

            _bodyDojiAveragePeriod  = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;
            _bodyLongAveragePeriod  = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;
            _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;
        }
Пример #13
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="AdvanceBlock"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public AdvanceBlock(string name)
     : base(name, Math.Max(Math.Max(Math.Max(CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowShort).AveragePeriod),
                                    Math.Max(CandleSettings.Get(CandleSettingType.Far).AveragePeriod, CandleSettings.Get(CandleSettingType.Near).AveragePeriod)),
                           CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod) + 2 + 1)
 {
     _shadowShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowShort).AveragePeriod;
     _shadowLongAveragePeriod  = CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod;
     _nearAveragePeriod        = CandleSettings.Get(CandleSettingType.Near).AveragePeriod;
     _farAveragePeriod         = CandleSettings.Get(CandleSettingType.Far).AveragePeriod;
     _bodyLongAveragePeriod    = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;
 }
Пример #14
0
        /// <summary>
        /// Returns the range of a candle
        /// </summary>
        /// <param name="type">The type of setting to use</param>
        /// <param name="tradeBar">The input candle</param>
        protected static double GetCandleRange(CandleSettingType type, DoubleArray tradeBar)
        {
            switch (CandleSettings.Get(type).RangeType)
            {
            case CandleRangeType.RealBody:
                return(GetRealBody(tradeBar));

            case CandleRangeType.HighLow:
                return(GetHighLowRange(tradeBar));

            case CandleRangeType.Shadows:
                return(GetUpperShadow(tradeBar) + GetLowerShadow(tradeBar));

            default:
                return(0d);
            }
        }
Пример #15
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="DojiStar"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public DojiStar(string name)
     : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod) + 1 + 1)
 {
     _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;
     _bodyDojiAveragePeriod = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;
 }
Пример #16
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="ShortLineCandle"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public ShortLineCandle(string name)
     : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowShort).AveragePeriod) + 1)
 {
     _bodyShortAveragePeriod   = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;
     _shadowShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowShort).AveragePeriod;
 }
Пример #17
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="ThreeBlackCrows"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public ThreeBlackCrows(string name)
     : base(name, CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod + 3 + 1)
 {
     _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;
 }
Пример #18
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="LongLeggedDoji"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public LongLeggedDoji(string name)
     : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod) + 1)
 {
     _bodyDojiAveragePeriod   = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;
     _shadowLongAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowLong).AveragePeriod;
 }
Пример #19
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="BeltHold"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public BeltHold(string name)
     : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod) + 1)
 {
     _bodyLongAveragePeriod        = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;
     _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;
 }
Пример #20
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="ConcealedBabySwallow"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public ConcealedBabySwallow(string name)
     : base(name, CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod + 3 + 1)
 {
     _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;
 }
Пример #21
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="GravestoneDoji"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public GravestoneDoji(string name)
     : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod, CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod) + 1)
 {
     _bodyDojiAveragePeriod        = CandleSettings.Get(CandleSettingType.BodyDoji).AveragePeriod;
     _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;
 }
Пример #22
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="Counterattack"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public Counterattack(string name)
     : base(name, Math.Max(CandleSettings.Get(CandleSettingType.Equal).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod) + 1 + 1)
 {
     _equalAveragePeriod    = CandleSettings.Get(CandleSettingType.Equal).AveragePeriod;
     _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;
 }
Пример #23
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="Piercing"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public Piercing(string name)
     : base(name, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod + 1 + 1)
 {
     _bodyLongAveragePeriod = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;
 }
Пример #24
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="UpsideGapTwoCrows"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public UpsideGapTwoCrows(string name)
     : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod) + 2 + 1)
 {
     _bodyLongAveragePeriod  = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;
     _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;
 }
Пример #25
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="HikkakeModified"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public HikkakeModified(string name)
     : base(name, Math.Max(1, CandleSettings.Get(CandleSettingType.Near).AveragePeriod) + 5 + 1)
 {
     _nearAveragePeriod = CandleSettings.Get(CandleSettingType.Near).AveragePeriod;
 }
Пример #26
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="ThreeLineStrike"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public ThreeLineStrike(string name)
     : base(name, CandleSettings.Get(CandleSettingType.Near).AveragePeriod + 3 + 1)
 {
     _nearAveragePeriod = CandleSettings.Get(CandleSettingType.Near).AveragePeriod;
 }
Пример #27
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="LadderBottom"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public LadderBottom(string name)
     : base(name, CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod + 4 + 1)
 {
     _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;
 }
Пример #28
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="IdenticalThreeCrows"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public IdenticalThreeCrows(string name)
     : base(name, Math.Max(CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod, CandleSettings.Get(CandleSettingType.Equal).AveragePeriod) + 2 + 1)
 {
     _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;
     _equalAveragePeriod           = CandleSettings.Get(CandleSettingType.Equal).AveragePeriod;
 }
Пример #29
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="HomingPigeon"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public HomingPigeon(string name)
     : base(name, Math.Max(CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod) + 1 + 1)
 {
     _bodyLongAveragePeriod  = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;
     _bodyShortAveragePeriod = CandleSettings.Get(CandleSettingType.BodyShort).AveragePeriod;
 }
Пример #30
0
 /// <summary>
 ///      Initializes a new instance of the <see cref="KickingByLength"/> class using the specified name.
 /// </summary>
 /// <param name="name">The name of this indicator</param>
 public KickingByLength(string name)
     : base(name, Math.Max(CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod, CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod) + 1 + 1)
 {
     _shadowVeryShortAveragePeriod = CandleSettings.Get(CandleSettingType.ShadowVeryShort).AveragePeriod;
     _bodyLongAveragePeriod        = CandleSettings.Get(CandleSettingType.BodyLong).AveragePeriod;
 }