42 private readonly decimal _penetration;
44 private readonly
int _bodyShortAveragePeriod;
45 private readonly
int _bodyLongAveragePeriod;
47 private decimal[] _bodyPeriodTotal =
new decimal[5];
54 public MatHold(
string name, decimal penetration = 0.5m)
57 _penetration = penetration;
68 : this(
"MATHOLD", penetration)
85 get {
return Samples >
Period; }
98 if (Samples >
Period - _bodyShortAveragePeriod)
105 if (Samples >
Period - _bodyLongAveragePeriod)
127 Math.Min(window[2].Open, window[2].Close) < window[4].Close &&
128 Math.Min(window[1].Open, window[1].Close) < window[4].Close &&
130 Math.Min(window[2].Open, window[2].Close) > window[4].Close -
GetRealBody(window[4]) * _penetration &&
131 Math.Min(window[1].Open, window[1].Close) > window[4].Close -
GetRealBody(window[4]) * _penetration &&
133 Math.Max(window[2].Close, window[2].Open) < window[3].Open &&
134 Math.Max(window[1].Close, window[1].Open) < Math.Max(window[2].Close, window[2].Open) &&
136 input.
Open > window[1].Close &&
138 input.
Close > Math.Max(Math.Max(window[3].High, window[2].High), window[1].High)
150 for (var i = 3; i >= 1; i--)
164 _bodyPeriodTotal =
new decimal[5];