Skip to content

Commit 5fdf2e1

Browse files
committed
Various minor fixes
1 parent 6453c56 commit 5fdf2e1

155 files changed

Lines changed: 1000 additions & 1394 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/TALib.NETCore/DecimalMath.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ public static decimal Acos(decimal x)
429429
{
430430
Decimal.Zero => PIdiv2,
431431
Decimal.One => Decimal.Zero,
432-
_ => (x < Decimal.Zero ? PI - Acos(-x) : PIdiv2 - Asin(x))
432+
_ => x < Decimal.Zero ? PI - Acos(-x) : PIdiv2 - Asin(x)
433433
};
434434
}
435435

src/TALib.NETCore/TACdl/TA_Cdl2Crows.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public static RetCode Cdl2Crows(double[] inOpen, double[] inHigh, double[] inLow
6464
bodyLongPeriodTotal++;
6565
} while (i <= endIdx);
6666

67-
outNbElement = outIdx;
6867
outBegIdx = startIdx;
68+
outNbElement = outIdx;
6969

7070
return RetCode.Success;
7171
}
@@ -132,8 +132,8 @@ public static RetCode Cdl2Crows(decimal[] inOpen, decimal[] inHigh, decimal[] in
132132
bodyLongPeriodTotal++;
133133
} while (i <= endIdx);
134134

135-
outNbElement = outIdx;
136135
outBegIdx = startIdx;
136+
outNbElement = outIdx;
137137

138138
return RetCode.Success;
139139
}

src/TALib.NETCore/TACdl/TA_Cdl3BlackCrows.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ public static RetCode Cdl3BlackCrows(double[] inOpen, double[] inHigh, double[]
7979
shadowVeryShortTrailingIdx++;
8080
} while (i <= endIdx);
8181

82-
outNbElement = outIdx;
8382
outBegIdx = startIdx;
83+
outNbElement = outIdx;
8484

8585
return RetCode.Success;
8686
}
8787

88-
public static RetCode Cdl3BlackCrows(int startIdx, int endIdx, decimal[] inOpen, decimal[] inHigh, decimal[] inLow,
89-
decimal[] inClose, int[] outInteger, out int outBegIdx, out int outNbElement)
88+
public static RetCode Cdl3BlackCrows(decimal[] inOpen, decimal[] inHigh, decimal[] inLow, decimal[] inClose, int startIdx,
89+
int endIdx, int[] outInteger, out int outBegIdx, out int outNbElement)
9090
{
9191
outBegIdx = outNbElement = 0;
9292

@@ -162,8 +162,8 @@ public static RetCode Cdl3BlackCrows(int startIdx, int endIdx, decimal[] inOpen,
162162
shadowVeryShortTrailingIdx++;
163163
} while (i <= endIdx);
164164

165-
outNbElement = outIdx;
166165
outBegIdx = startIdx;
166+
outNbElement = outIdx;
167167

168168
return RetCode.Success;
169169
}

src/TALib.NETCore/TACdl/TA_Cdl3Inside.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ public static RetCode Cdl3Inside(double[] inOpen, double[] inHigh, double[] inLo
8181
bodyShortTrailingIdx++;
8282
} while (i <= endIdx);
8383

84-
outNbElement = outIdx;
8584
outBegIdx = startIdx;
85+
outNbElement = outIdx;
8686

8787
return RetCode.Success;
8888
}
@@ -164,8 +164,8 @@ public static RetCode Cdl3Inside(decimal[] inOpen, decimal[] inHigh, decimal[] i
164164
bodyShortTrailingIdx++;
165165
} while (i <= endIdx);
166166

167-
outNbElement = outIdx;
168167
outBegIdx = startIdx;
168+
outNbElement = outIdx;
169169

170170
return RetCode.Success;
171171
}

src/TALib.NETCore/TACdl/TA_Cdl3LineStrike.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ public static RetCode Cdl3LineStrike(double[] inOpen, double[] inHigh, double[]
8787
nearTrailingIdx++;
8888
} while (i <= endIdx);
8989

90-
outNbElement = outIdx;
9190
outBegIdx = startIdx;
91+
outNbElement = outIdx;
9292

9393
return RetCode.Success;
9494
}
9595

96-
public static RetCode Cdl3LineStrike(int startIdx, int endIdx, decimal[] inOpen, decimal[] inHigh, decimal[] inLow,
97-
decimal[] inClose, int[] outInteger, out int outBegIdx, out int outNbElement)
96+
public static RetCode Cdl3LineStrike(decimal[] inOpen, decimal[] inHigh, decimal[] inLow, decimal[] inClose, int startIdx,
97+
int endIdx, int[] outInteger, out int outBegIdx, out int outNbElement)
9898
{
9999
outBegIdx = outNbElement = 0;
100100

@@ -176,8 +176,8 @@ public static RetCode Cdl3LineStrike(int startIdx, int endIdx, decimal[] inOpen,
176176
nearTrailingIdx++;
177177
} while (i <= endIdx);
178178

179-
outNbElement = outIdx;
180179
outBegIdx = startIdx;
180+
outNbElement = outIdx;
181181

182182
return RetCode.Success;
183183
}

src/TALib.NETCore/TACdl/TA_Cdl3Outside.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public static RetCode Cdl3Outside(double[] inOpen, double[] inHigh, double[] inL
5252
i++;
5353
} while (i <= endIdx);
5454

55-
outNbElement = outIdx;
5655
outBegIdx = startIdx;
56+
outNbElement = outIdx;
5757

5858
return RetCode.Success;
5959
}
@@ -106,8 +106,8 @@ public static RetCode Cdl3Outside(decimal[] inOpen, decimal[] inHigh, decimal[]
106106
i++;
107107
} while (i <= endIdx);
108108

109-
outNbElement = outIdx;
110109
outBegIdx = startIdx;
110+
outNbElement = outIdx;
111111

112112
return RetCode.Success;
113113
}

src/TALib.NETCore/TACdl/TA_Cdl3StarsInSouth.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ public static RetCode Cdl3StarsInSouth(double[] inOpen, double[] inHigh, double[
124124
bodyShortTrailingIdx++;
125125
} while (i <= endIdx);
126126

127-
outNbElement = outIdx;
128127
outBegIdx = startIdx;
128+
outNbElement = outIdx;
129129

130130
return RetCode.Success;
131131
}
132132

133-
public static RetCode Cdl3StarsInSouth(int startIdx, int endIdx, decimal[] inOpen, decimal[] inHigh, decimal[] inLow,
134-
decimal[] inClose, int[] outInteger, out int outBegIdx, out int outNbElement)
133+
public static RetCode Cdl3StarsInSouth(decimal[] inOpen, decimal[] inHigh, decimal[] inLow, decimal[] inClose, int startIdx,
134+
int endIdx, int[] outInteger, out int outBegIdx, out int outNbElement)
135135
{
136136
outBegIdx = outNbElement = 0;
137137

@@ -250,8 +250,8 @@ public static RetCode Cdl3StarsInSouth(int startIdx, int endIdx, decimal[] inOpe
250250
bodyShortTrailingIdx++;
251251
} while (i <= endIdx);
252252

253-
outNbElement = outIdx;
254253
outBegIdx = startIdx;
254+
outNbElement = outIdx;
255255

256256
return RetCode.Success;
257257
}

src/TALib.NETCore/TACdl/TA_Cdl3WhiteSoldiers.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ namespace TALib
44
{
55
public static partial class Core
66
{
7-
public static RetCode Cdl3WhiteSoldiers(int startIdx, int endIdx, double[] inOpen, double[] inHigh, double[] inLow,
8-
double[] inClose, int[] outInteger, out int outBegIdx, out int outNbElement)
7+
public static RetCode Cdl3WhiteSoldiers(double[] inOpen, double[] inHigh, double[] inLow, double[] inClose, int startIdx,
8+
int endIdx, int[] outInteger, out int outBegIdx, out int outNbElement)
99
{
1010
outBegIdx = outNbElement = 0;
1111

@@ -133,14 +133,14 @@ public static RetCode Cdl3WhiteSoldiers(int startIdx, int endIdx, double[] inOpe
133133
bodyShortTrailingIdx++;
134134
} while (i <= endIdx);
135135

136-
outNbElement = outIdx;
137136
outBegIdx = startIdx;
137+
outNbElement = outIdx;
138138

139139
return RetCode.Success;
140140
}
141141

142-
public static RetCode Cdl3WhiteSoldiers(int startIdx, int endIdx, decimal[] inOpen, decimal[] inHigh, decimal[] inLow,
143-
decimal[] inClose, int[] outInteger, out int outBegIdx, out int outNbElement)
142+
public static RetCode Cdl3WhiteSoldiers(decimal[] inOpen, decimal[] inHigh, decimal[] inLow, decimal[] inClose, int startIdx,
143+
int endIdx, int[] outInteger, out int outBegIdx, out int outNbElement)
144144
{
145145
outBegIdx = outNbElement = 0;
146146

@@ -268,8 +268,8 @@ public static RetCode Cdl3WhiteSoldiers(int startIdx, int endIdx, decimal[] inOp
268268
bodyShortTrailingIdx++;
269269
} while (i <= endIdx);
270270

271-
outNbElement = outIdx;
272271
outBegIdx = startIdx;
272+
outNbElement = outIdx;
273273

274274
return RetCode.Success;
275275
}

src/TALib.NETCore/TACdl/TA_CdlAbandonedBaby.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ public static RetCode CdlAbandonedBaby(double[] inOpen, double[] inHigh, double[
7777
!TA_CandleColor(inClose, inOpen, i - 2) &&
7878
TA_CandleColor(inClose, inOpen, i) &&
7979
inClose[i] > inClose[i - 2] +
80-
TA_RealBody(inClose, inOpen, i - 2) * optInPenetration && // 3rd closes well within 1st rb
81-
TA_CandleGapDown(inLow, inHigh, i - 1, i - 2) && // downside gap between 1st and 2nd
82-
TA_CandleGapUp(inLow, inHigh, i, i - 1) // upside gap between 2nd and 3rd
80+
TA_RealBody(inClose, inOpen, i - 2) * optInPenetration &&
81+
TA_CandleGapDown(inLow, inHigh, i - 1, i - 2) &&
82+
TA_CandleGapUp(inLow, inHigh, i, i - 1)
8383
)
8484
)
8585
{
@@ -102,14 +102,14 @@ public static RetCode CdlAbandonedBaby(double[] inOpen, double[] inHigh, double[
102102
bodyShortTrailingIdx++;
103103
} while (i <= endIdx);
104104

105-
outNbElement = outIdx;
106105
outBegIdx = startIdx;
106+
outNbElement = outIdx;
107107

108108
return RetCode.Success;
109109
}
110110

111-
public static RetCode CdlAbandonedBaby(int startIdx, int endIdx, decimal[] inOpen, decimal[] inHigh, decimal[] inLow,
112-
decimal[] inClose, int[] outInteger, out int outBegIdx, out int outNbElement, decimal optInPenetration = 0.3m)
111+
public static RetCode CdlAbandonedBaby(decimal[] inOpen, decimal[] inHigh, decimal[] inLow, decimal[] inClose, int startIdx,
112+
int endIdx, int[] outInteger, out int outBegIdx, out int outNbElement, decimal optInPenetration = 0.3m)
113113
{
114114
outBegIdx = outNbElement = 0;
115115

@@ -184,7 +184,8 @@ public static RetCode CdlAbandonedBaby(int startIdx, int endIdx, decimal[] inOpe
184184
inClose[i] > inClose[i - 2] +
185185
TA_RealBody(inClose, inOpen, i - 2) * optInPenetration &&
186186
TA_CandleGapDown(inLow, inHigh, i - 1, i - 2) &&
187-
TA_CandleGapUp(inLow, inHigh, i, i - 1)))
187+
TA_CandleGapUp(inLow, inHigh, i, i - 1))
188+
)
188189
{
189190
outInteger[outIdx++] = Convert.ToInt32(TA_CandleColor(inClose, inOpen, i)) * 100;
190191
}
@@ -205,13 +206,13 @@ public static RetCode CdlAbandonedBaby(int startIdx, int endIdx, decimal[] inOpe
205206
bodyShortTrailingIdx++;
206207
} while (i <= endIdx);
207208

208-
outNbElement = outIdx;
209209
outBegIdx = startIdx;
210+
outNbElement = outIdx;
210211

211212
return RetCode.Success;
212213
}
213214

214-
private static int CdlAbandonedBabyLookback() =>
215+
public static int CdlAbandonedBabyLookback() =>
215216
Math.Max(
216217
Math.Max(TA_CandleAvgPeriod(CandleSettingType.BodyDoji), TA_CandleAvgPeriod(CandleSettingType.BodyLong)),
217218
TA_CandleAvgPeriod(CandleSettingType.BodyShort)

src/TALib.NETCore/TACdl/TA_CdlAdvanceBlock.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,14 @@ public static RetCode CdlAdvanceBlock(double[] inOpen, double[] inHigh, double[]
172172
bodyLongTrailingIdx++;
173173
} while (i <= endIdx);
174174

175-
outNbElement = outIdx;
176175
outBegIdx = startIdx;
176+
outNbElement = outIdx;
177177

178178
return RetCode.Success;
179179
}
180180

181-
public static RetCode CdlAdvanceBlock(int startIdx, int endIdx, decimal[] inOpen, decimal[] inHigh, decimal[] inLow,
182-
decimal[] inClose, int[] outInteger, out int outBegIdx, out int outNbElement)
181+
public static RetCode CdlAdvanceBlock(decimal[] inOpen, decimal[] inHigh, decimal[] inLow, decimal[] inClose, int startIdx,
182+
int endIdx, int[] outInteger, out int outBegIdx, out int outNbElement)
183183
{
184184
outBegIdx = outNbElement = 0;
185185

@@ -346,13 +346,13 @@ public static RetCode CdlAdvanceBlock(int startIdx, int endIdx, decimal[] inOpen
346346
bodyLongTrailingIdx++;
347347
} while (i <= endIdx);
348348

349-
outNbElement = outIdx;
350349
outBegIdx = startIdx;
350+
outNbElement = outIdx;
351351

352352
return RetCode.Success;
353353
}
354354

355-
private static int CdlAdvanceBlockLookback() =>
355+
public static int CdlAdvanceBlockLookback() =>
356356
Math.Max(
357357
Math.Max(
358358
Math.Max(TA_CandleAvgPeriod(CandleSettingType.ShadowLong), TA_CandleAvgPeriod(CandleSettingType.ShadowShort)),

0 commit comments

Comments
 (0)