1 /* TA-LIB Copyright (c) 1999-2007, Mario Fortier
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or
5  * without modification, are permitted provided that the following
6  * conditions are met:
7  *
8  * - Redistributions of source code must retain the above copyright
9  *   notice, this list of conditions and the following disclaimer.
10  *
11  * - Redistributions in binary form must reproduce the above copyright
12  *   notice, this list of conditions and the following disclaimer in
13  *   the documentation and/or other materials provided with the
14  *   distribution.
15  *
16  * - Neither name of author nor the names of its contributors
17  *   may be used to endorse or promote products derived from this
18  *   software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24  * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
30  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 /* List of contributors:
35  *
36  *  Initial  Name/description
37  *  -------------------------------------------------------------------
38  *  AC       Angelo Ciceri
39  *
40  *
41  * Change history:
42  *
43  *  MMDDYY BY   Description
44  *  -------------------------------------------------------------------
45  *  020605 AC   Creation
46  *
47  */
48 
49 /**** START GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/
50 /* All code within this section is automatically
51  * generated by gen_code. Any modification will be lost
52  * next time gen_code is run.
53  */
54 /* Generated */
55 /* Generated */ #if defined( _MANAGED )
56 /* Generated */    #include "TA-Lib-Core.h"
57 /* Generated */    #define TA_INTERNAL_ERROR(Id) (RetCode::InternalError)
58 /* Generated */    namespace TicTacTec { namespace TA { namespace Library {
59 /* Generated */ #elif defined( _JAVA )
60 /* Generated */    #include "ta_defs.h"
61 /* Generated */    #include "ta_java_defs.h"
62 /* Generated */    #define TA_INTERNAL_ERROR(Id) (RetCode.InternalError)
63 /* Generated */ #else
64 /* Generated */    #include <string.h>
65 /* Generated */    #include <math.h>
66 /* Generated */    #include "ta_func.h"
67 /* Generated */ #endif
68 /* Generated */
69 /* Generated */ #ifndef TA_UTILITY_H
70 /* Generated */    #include "ta_utility.h"
71 /* Generated */ #endif
72 /* Generated */
73 /* Generated */ #ifndef TA_MEMORY_H
74 /* Generated */    #include "ta_memory.h"
75 /* Generated */ #endif
76 /* Generated */
77 /* Generated */ #define TA_PREFIX(x) TA_##x
78 /* Generated */ #define INPUT_TYPE   double
79 /* Generated */
80 /* Generated */ #if defined( _MANAGED )
CdlRiseFall3MethodsLookback(void)81 /* Generated */ int Core::CdlRiseFall3MethodsLookback( void )
82 /* Generated */
83 /* Generated */ #elif defined( _JAVA )
84 /* Generated */ public int cdlRiseFall3MethodsLookback(  )
85 /* Generated */
86 /* Generated */ #else
87 /* Generated */ int TA_CDLRISEFALL3METHODS_Lookback( void )
88 /* Generated */
89 /* Generated */ #endif
90 /**** END GENCODE SECTION 1 - DO NOT DELETE THIS LINE ****/
91 {
92    /* insert local variable here */
93 
94 /**** START GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/
95 /* Generated */ /* No parameters to validate. */
96 /**** END GENCODE SECTION 2 - DO NOT DELETE THIS LINE ****/
97 
98    /* insert lookback code here. */
99     return max( TA_CANDLEAVGPERIOD(BodyShort), TA_CANDLEAVGPERIOD(BodyLong) ) + 4;
100 }
101 
102 /**** START GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/
103 /*
104  * TA_CDLRISEFALL3METHODS - Rising/Falling Three Methods
105  *
106  * Input  = Open, High, Low, Close
107  * Output = int
108  *
109  */
110 /* Generated */
111 /* Generated */ #if defined( _MANAGED ) && defined( USE_SUBARRAY )
112 /* Generated */ enum class Core::RetCode Core::CdlRiseFall3Methods( int    startIdx,
113 /* Generated */                                                     int    endIdx,
114 /* Generated */                                                     SubArray^    inOpen,
115 /* Generated */                                                     SubArray^    inHigh,
116 /* Generated */                                                     SubArray^    inLow,
117 /* Generated */                                                     SubArray^    inClose,
118 /* Generated */                                                     [Out]int%    outBegIdx,
119 /* Generated */                                                     [Out]int%    outNBElement,
120 /* Generated */                                                     cli::array<int>^  outInteger )
121 /* Generated */ #elif defined( _MANAGED )
122 /* Generated */ enum class Core::RetCode Core::CdlRiseFall3Methods( int    startIdx,
123 /* Generated */                                                     int    endIdx,
124 /* Generated */                                                     cli::array<double>^ inOpen,
125 /* Generated */                                                     cli::array<double>^ inHigh,
126 /* Generated */                                                     cli::array<double>^ inLow,
127 /* Generated */                                                     cli::array<double>^ inClose,
128 /* Generated */                                                     [Out]int%    outBegIdx,
129 /* Generated */                                                     [Out]int%    outNBElement,
130 /* Generated */                                                     cli::array<int>^  outInteger )
131 /* Generated */ #elif defined( _JAVA )
132 /* Generated */ public RetCode cdlRiseFall3Methods( int    startIdx,
133 /* Generated */                                     int    endIdx,
134 /* Generated */                                     double       inOpen[],
135 /* Generated */                                     double       inHigh[],
136 /* Generated */                                     double       inLow[],
137 /* Generated */                                     double       inClose[],
138 /* Generated */                                     MInteger     outBegIdx,
139 /* Generated */                                     MInteger     outNBElement,
140 /* Generated */                                     int           outInteger[] )
141 /* Generated */ #else
142 /* Generated */ TA_RetCode TA_CDLRISEFALL3METHODS( int    startIdx,
143 /* Generated */                                    int    endIdx,
144 /* Generated */                                    const double inOpen[],
145 /* Generated */                                    const double inHigh[],
146 /* Generated */                                    const double inLow[],
147 /* Generated */                                    const double inClose[],
148 /* Generated */                                    int          *outBegIdx,
149 /* Generated */                                    int          *outNBElement,
150 /* Generated */                                    int           outInteger[] )
151 /* Generated */ #endif
152 /**** END GENCODE SECTION 3 - DO NOT DELETE THIS LINE ****/
153 {
154    /* Insert local variables here. */
155     ARRAY_LOCAL(BodyPeriodTotal,5);
156     int i, outIdx, totIdx, BodyShortTrailingIdx, BodyLongTrailingIdx, lookbackTotal;
157 
158 /**** START GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/
159 /* Generated */
160 /* Generated */ #ifndef TA_FUNC_NO_RANGE_CHECK
161 /* Generated */
162 /* Generated */    /* Validate the requested output range. */
163 /* Generated */    if( startIdx < 0 )
164 /* Generated */       return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_START_INDEX,OutOfRangeStartIndex);
165 /* Generated */    if( (endIdx < 0) || (endIdx < startIdx))
166 /* Generated */       return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_END_INDEX,OutOfRangeEndIndex);
167 /* Generated */
168 /* Generated */    #if !defined(_JAVA)
169 /* Generated */    /* Verify required price component. */
170 /* Generated */    if(!inOpen||!inHigh||!inLow||!inClose)
171 /* Generated */       return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);
172 /* Generated */
173 /* Generated */    #endif /* !defined(_JAVA)*/
174 /* Generated */    #if !defined(_JAVA)
175 /* Generated */    if( !outInteger )
176 /* Generated */       return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);
177 /* Generated */
178 /* Generated */    #endif /* !defined(_JAVA) */
179 /* Generated */ #endif /* TA_FUNC_NO_RANGE_CHECK */
180 /* Generated */
181 /**** END GENCODE SECTION 4 - DO NOT DELETE THIS LINE ****/
182 
183    /* Identify the minimum number of price bar needed
184     * to calculate at least one output.
185     */
186 
187    lookbackTotal = LOOKBACK_CALL(CDLRISEFALL3METHODS)();
188 
189    /* Move up the start index if there is not
190     * enough initial data.
191     */
192    if( startIdx < lookbackTotal )
193       startIdx = lookbackTotal;
194 
195    /* Make sure there is still something to evaluate. */
196    if( startIdx > endIdx )
197    {
198       VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx);
199       VALUE_HANDLE_DEREF_TO_ZERO(outNBElement);
200       return ENUM_VALUE(RetCode,TA_SUCCESS,Success);
201    }
202 
203    /* Do the calculation using tight loops. */
204    /* Add-up the initial period, except for the last value. */
205    BodyPeriodTotal[4] = 0;
206    BodyPeriodTotal[3] = 0;
207    BodyPeriodTotal[2] = 0;
208    BodyPeriodTotal[1] = 0;
209    BodyPeriodTotal[0] = 0;
210    BodyShortTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(BodyShort);
211    BodyLongTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(BodyLong);
212 
213    i = BodyShortTrailingIdx;
214    while( i < startIdx ) {
215         BodyPeriodTotal[3] += TA_CANDLERANGE( BodyShort, i-3 );
216         BodyPeriodTotal[2] += TA_CANDLERANGE( BodyShort, i-2 );
217         BodyPeriodTotal[1] += TA_CANDLERANGE( BodyShort, i-1 );
218         i++;
219    }
220    i = BodyLongTrailingIdx;
221    while( i < startIdx ) {
222         BodyPeriodTotal[4] += TA_CANDLERANGE( BodyLong, i-4 );
223         BodyPeriodTotal[0] += TA_CANDLERANGE( BodyLong, i );
224         i++;
225    }
226    i = startIdx;
227 
228    /* Proceed with the calculation for the requested range.
229     * Must have:
230     * - first candle: long white (black) candlestick
231     * - then: group of falling (rising) small real body candlesticks (commonly black (white)) that hold within
232     *   the prior long candle's range: ideally they should be three but two or more than three are ok too
233     * - final candle: long white (black) candle that opens above (below) the previous small candle's close
234     *   and closes above (below) the first long candle's close
235     * The meaning of "short" and "long" is specified with TA_SetCandleSettings; here only patterns with 3 small candles
236     * are considered;
237     * outInteger is positive (1 to 100) or negative (-1 to -100)
238     */
239    outIdx = 0;
240    do
241    {
242         if( // 1st long, then 3 small, 5th long
243             TA_REALBODY(i-4) > TA_CANDLEAVERAGE( BodyLong, BodyPeriodTotal[4], i-4 ) &&
244             TA_REALBODY(i-3) < TA_CANDLEAVERAGE( BodyShort, BodyPeriodTotal[3], i-3 ) &&
245             TA_REALBODY(i-2) < TA_CANDLEAVERAGE( BodyShort, BodyPeriodTotal[2], i-2 ) &&
246             TA_REALBODY(i-1) < TA_CANDLEAVERAGE( BodyShort, BodyPeriodTotal[1], i-1 ) &&
247             TA_REALBODY(i)   > TA_CANDLEAVERAGE( BodyLong, BodyPeriodTotal[0], i ) &&
248             // white, 3 black, white  ||  black, 3 white, black
249             TA_CANDLECOLOR(i-4) == -TA_CANDLECOLOR(i-3) &&
250             TA_CANDLECOLOR(i-3) ==  TA_CANDLECOLOR(i-2) &&
251             TA_CANDLECOLOR(i-2) ==  TA_CANDLECOLOR(i-1) &&
252             TA_CANDLECOLOR(i-1) == -TA_CANDLECOLOR(i) &&
253             // 2nd to 4th hold within 1st: a part of the real body must be within 1st range
254             min(inOpen[i-3], inClose[i-3]) < inHigh[i-4] && max(inOpen[i-3], inClose[i-3]) > inLow[i-4] &&
255             min(inOpen[i-2], inClose[i-2]) < inHigh[i-4] && max(inOpen[i-2], inClose[i-2]) > inLow[i-4] &&
256             min(inOpen[i-1], inClose[i-1]) < inHigh[i-4] && max(inOpen[i-1], inClose[i-1]) > inLow[i-4] &&
257             // 2nd to 4th are falling (rising)
258             inClose[i-2] * TA_CANDLECOLOR(i-4) < inClose[i-3] * TA_CANDLECOLOR(i-4) &&
259             inClose[i-1] * TA_CANDLECOLOR(i-4) < inClose[i-2] * TA_CANDLECOLOR(i-4) &&
260             // 5th opens above (below) the prior close
261             inOpen[i] * TA_CANDLECOLOR(i-4) > inClose[i-1] * TA_CANDLECOLOR(i-4) &&
262             // 5th closes above (below) the 1st close
263             inClose[i] * TA_CANDLECOLOR(i-4) > inClose[i-4] * TA_CANDLECOLOR(i-4)
264           )
265             outInteger[outIdx++] = 100 * TA_CANDLECOLOR(i-4);
266         else
267             outInteger[outIdx++] = 0;
268         /* add the current range and subtract the first range: this is done after the pattern recognition
269          * when avgPeriod is not 0, that means "compare with the previous candles" (it excludes the current candle)
270          */
271         BodyPeriodTotal[4] += TA_CANDLERANGE( BodyLong, i-4 ) - TA_CANDLERANGE( BodyLong, BodyLongTrailingIdx-4 );
272         for (totIdx = 3; totIdx >= 1; --totIdx)
273             BodyPeriodTotal[totIdx] += TA_CANDLERANGE( BodyShort, i-totIdx )
274                                      - TA_CANDLERANGE( BodyShort, BodyShortTrailingIdx-totIdx );
275         BodyPeriodTotal[0] += TA_CANDLERANGE( BodyLong, i ) - TA_CANDLERANGE( BodyLong, BodyLongTrailingIdx );
276         i++;
277         BodyShortTrailingIdx++;
278         BodyLongTrailingIdx++;
279    } while( i <= endIdx );
280 
281    /* All done. Indicate the output limits and return. */
282    VALUE_HANDLE_DEREF(outNBElement) = outIdx;
283    VALUE_HANDLE_DEREF(outBegIdx)    = startIdx;
284 
285    return ENUM_VALUE(RetCode,TA_SUCCESS,Success);
286 }
287 
288 /**** START GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/
289 /* Generated */
290 /* Generated */ #define  USE_SINGLE_PRECISION_INPUT
291 /* Generated */ #if !defined( _MANAGED ) && !defined( _JAVA )
292 /* Generated */    #undef   TA_PREFIX
293 /* Generated */    #define  TA_PREFIX(x) TA_S_##x
294 /* Generated */ #endif
295 /* Generated */ #undef   INPUT_TYPE
296 /* Generated */ #define  INPUT_TYPE float
297 /* Generated */ #if defined( _MANAGED )
298 /* Generated */ enum class Core::RetCode Core::CdlRiseFall3Methods( int    startIdx,
299 /* Generated */                                                     int    endIdx,
300 /* Generated */                                                     cli::array<float>^ inOpen,
301 /* Generated */                                                     cli::array<float>^ inHigh,
302 /* Generated */                                                     cli::array<float>^ inLow,
303 /* Generated */                                                     cli::array<float>^ inClose,
304 /* Generated */                                                     [Out]int%    outBegIdx,
305 /* Generated */                                                     [Out]int%    outNBElement,
306 /* Generated */                                                     cli::array<int>^  outInteger )
307 /* Generated */ #elif defined( _JAVA )
308 /* Generated */ public RetCode cdlRiseFall3Methods( int    startIdx,
309 /* Generated */                                     int    endIdx,
310 /* Generated */                                     float        inOpen[],
311 /* Generated */                                     float        inHigh[],
312 /* Generated */                                     float        inLow[],
313 /* Generated */                                     float        inClose[],
314 /* Generated */                                     MInteger     outBegIdx,
315 /* Generated */                                     MInteger     outNBElement,
316 /* Generated */                                     int           outInteger[] )
317 /* Generated */ #else
318 /* Generated */ TA_RetCode TA_S_CDLRISEFALL3METHODS( int    startIdx,
319 /* Generated */                                      int    endIdx,
320 /* Generated */                                      const float  inOpen[],
321 /* Generated */                                      const float  inHigh[],
322 /* Generated */                                      const float  inLow[],
323 /* Generated */                                      const float  inClose[],
324 /* Generated */                                      int          *outBegIdx,
325 /* Generated */                                      int          *outNBElement,
326 /* Generated */                                      int           outInteger[] )
327 /* Generated */ #endif
328 /* Generated */ {
329 /* Generated */     ARRAY_LOCAL(BodyPeriodTotal,5);
330 /* Generated */     int i, outIdx, totIdx, BodyShortTrailingIdx, BodyLongTrailingIdx, lookbackTotal;
331 /* Generated */  #ifndef TA_FUNC_NO_RANGE_CHECK
332 /* Generated */     if( startIdx < 0 )
333 /* Generated */        return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_START_INDEX,OutOfRangeStartIndex);
334 /* Generated */     if( (endIdx < 0) || (endIdx < startIdx))
335 /* Generated */        return ENUM_VALUE(RetCode,TA_OUT_OF_RANGE_END_INDEX,OutOfRangeEndIndex);
336 /* Generated */     #if !defined(_JAVA)
337 /* Generated */     if(!inOpen||!inHigh||!inLow||!inClose)
338 /* Generated */        return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);
339 /* Generated */     #endif
340 /* Generated */     #if !defined(_JAVA)
341 /* Generated */     if( !outInteger )
342 /* Generated */        return ENUM_VALUE(RetCode,TA_BAD_PARAM,BadParam);
343 /* Generated */     #endif
344 /* Generated */  #endif
345 /* Generated */    lookbackTotal = LOOKBACK_CALL(CDLRISEFALL3METHODS)();
346 /* Generated */    if( startIdx < lookbackTotal )
347 /* Generated */       startIdx = lookbackTotal;
348 /* Generated */    if( startIdx > endIdx )
349 /* Generated */    {
350 /* Generated */       VALUE_HANDLE_DEREF_TO_ZERO(outBegIdx);
351 /* Generated */       VALUE_HANDLE_DEREF_TO_ZERO(outNBElement);
352 /* Generated */       return ENUM_VALUE(RetCode,TA_SUCCESS,Success);
353 /* Generated */    }
354 /* Generated */    BodyPeriodTotal[4] = 0;
355 /* Generated */    BodyPeriodTotal[3] = 0;
356 /* Generated */    BodyPeriodTotal[2] = 0;
357 /* Generated */    BodyPeriodTotal[1] = 0;
358 /* Generated */    BodyPeriodTotal[0] = 0;
359 /* Generated */    BodyShortTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(BodyShort);
360 /* Generated */    BodyLongTrailingIdx = startIdx - TA_CANDLEAVGPERIOD(BodyLong);
361 /* Generated */    i = BodyShortTrailingIdx;
362 /* Generated */    while( i < startIdx ) {
363 /* Generated */         BodyPeriodTotal[3] += TA_CANDLERANGE( BodyShort, i-3 );
364 /* Generated */         BodyPeriodTotal[2] += TA_CANDLERANGE( BodyShort, i-2 );
365 /* Generated */         BodyPeriodTotal[1] += TA_CANDLERANGE( BodyShort, i-1 );
366 /* Generated */         i++;
367 /* Generated */    }
368 /* Generated */    i = BodyLongTrailingIdx;
369 /* Generated */    while( i < startIdx ) {
370 /* Generated */         BodyPeriodTotal[4] += TA_CANDLERANGE( BodyLong, i-4 );
371 /* Generated */         BodyPeriodTotal[0] += TA_CANDLERANGE( BodyLong, i );
372 /* Generated */         i++;
373 /* Generated */    }
374 /* Generated */    i = startIdx;
375 /* Generated */    outIdx = 0;
376 /* Generated */    do
377 /* Generated */    {
378 /* Generated */         if( // 1st long, then 3 small, 5th long
379 /* Generated */             TA_REALBODY(i-4) > TA_CANDLEAVERAGE( BodyLong, BodyPeriodTotal[4], i-4 ) &&
380 /* Generated */             TA_REALBODY(i-3) < TA_CANDLEAVERAGE( BodyShort, BodyPeriodTotal[3], i-3 ) &&
381 /* Generated */             TA_REALBODY(i-2) < TA_CANDLEAVERAGE( BodyShort, BodyPeriodTotal[2], i-2 ) &&
382 /* Generated */             TA_REALBODY(i-1) < TA_CANDLEAVERAGE( BodyShort, BodyPeriodTotal[1], i-1 ) &&
383 /* Generated */             TA_REALBODY(i)   > TA_CANDLEAVERAGE( BodyLong, BodyPeriodTotal[0], i ) &&
384 /* Generated */             // white, 3 black, white  ||  black, 3 white, black
385 /* Generated */             TA_CANDLECOLOR(i-4) == -TA_CANDLECOLOR(i-3) &&
386 /* Generated */             TA_CANDLECOLOR(i-3) ==  TA_CANDLECOLOR(i-2) &&
387 /* Generated */             TA_CANDLECOLOR(i-2) ==  TA_CANDLECOLOR(i-1) &&
388 /* Generated */             TA_CANDLECOLOR(i-1) == -TA_CANDLECOLOR(i) &&
389 /* Generated */             // 2nd to 4th hold within 1st: a part of the real body must be within 1st range
390 /* Generated */             min(inOpen[i-3], inClose[i-3]) < inHigh[i-4] && max(inOpen[i-3], inClose[i-3]) > inLow[i-4] &&
391 /* Generated */             min(inOpen[i-2], inClose[i-2]) < inHigh[i-4] && max(inOpen[i-2], inClose[i-2]) > inLow[i-4] &&
392 /* Generated */             min(inOpen[i-1], inClose[i-1]) < inHigh[i-4] && max(inOpen[i-1], inClose[i-1]) > inLow[i-4] &&
393 /* Generated */             // 2nd to 4th are falling (rising)
394 /* Generated */             inClose[i-2] * TA_CANDLECOLOR(i-4) < inClose[i-3] * TA_CANDLECOLOR(i-4) &&
395 /* Generated */             inClose[i-1] * TA_CANDLECOLOR(i-4) < inClose[i-2] * TA_CANDLECOLOR(i-4) &&
396 /* Generated */             // 5th opens above (below) the prior close
397 /* Generated */             inOpen[i] * TA_CANDLECOLOR(i-4) > inClose[i-1] * TA_CANDLECOLOR(i-4) &&
398 /* Generated */             // 5th closes above (below) the 1st close
399 /* Generated */             inClose[i] * TA_CANDLECOLOR(i-4) > inClose[i-4] * TA_CANDLECOLOR(i-4)
400 /* Generated */           )
401 /* Generated */             outInteger[outIdx++] = 100 * TA_CANDLECOLOR(i-4);
402 /* Generated */         else
403 /* Generated */             outInteger[outIdx++] = 0;
404 /* Generated */         BodyPeriodTotal[4] += TA_CANDLERANGE( BodyLong, i-4 ) - TA_CANDLERANGE( BodyLong, BodyLongTrailingIdx-4 );
405 /* Generated */         for (totIdx = 3; totIdx >= 1; --totIdx)
406 /* Generated */             BodyPeriodTotal[totIdx] += TA_CANDLERANGE( BodyShort, i-totIdx )
407 /* Generated */                                      - TA_CANDLERANGE( BodyShort, BodyShortTrailingIdx-totIdx );
408 /* Generated */         BodyPeriodTotal[0] += TA_CANDLERANGE( BodyLong, i ) - TA_CANDLERANGE( BodyLong, BodyLongTrailingIdx );
409 /* Generated */         i++;
410 /* Generated */         BodyShortTrailingIdx++;
411 /* Generated */         BodyLongTrailingIdx++;
412 /* Generated */    } while( i <= endIdx );
413 /* Generated */    VALUE_HANDLE_DEREF(outNBElement) = outIdx;
414 /* Generated */    VALUE_HANDLE_DEREF(outBegIdx)    = startIdx;
415 /* Generated */    return ENUM_VALUE(RetCode,TA_SUCCESS,Success);
416 /* Generated */ }
417 /* Generated */
418 /* Generated */ #if defined( _MANAGED )
419 /* Generated */ }}} // Close namespace TicTacTec.TA.Lib
420 /* Generated */ #endif
421 /**** END GENCODE SECTION 5 - DO NOT DELETE THIS LINE ****/
422 
423