tulirb 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rubocop.yml +22 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +14 -0
- data/LICENSE.txt +21 -0
- data/README.md +53 -0
- data/Rakefile +24 -0
- data/ext/tulirb/extconf.rb +9 -0
- data/ext/tulirb/tiamalgamation.c +5565 -0
- data/ext/tulirb/tulirb.c +751 -0
- data/ext/tulirb/tulirb.h +1435 -0
- data/lib/tulirb/version.rb +5 -0
- data/lib/tulirb.rb +17 -0
- data/sig/tulirb.rbs +4 -0
- data/tulirb.gemspec +41 -0
- metadata +63 -0
data/ext/tulirb/tulirb.h
ADDED
@@ -0,0 +1,1435 @@
|
|
1
|
+
#ifndef TULIRB_H
|
2
|
+
#define TULIRB_H 1
|
3
|
+
|
4
|
+
#include "ruby.h"
|
5
|
+
|
6
|
+
#endif /* TULIRB_H */
|
7
|
+
|
8
|
+
#define TI_REAL double
|
9
|
+
|
10
|
+
#define TI_INDICATOR_COUNT 104 /* Total number of indicators. */
|
11
|
+
|
12
|
+
#define TI_OKAY 0
|
13
|
+
#define TI_INVALID_OPTION 1
|
14
|
+
|
15
|
+
#define TI_TYPE_OVERLAY 1 /* These have roughly the same range as the input data. */
|
16
|
+
#define TI_TYPE_INDICATOR 2 /* Everything else (e.g. oscillators). */
|
17
|
+
#define TI_TYPE_MATH 3 /* These aren't so good for plotting, but are useful with formulas. */
|
18
|
+
#define TI_TYPE_SIMPLE 4 /* These apply a simple operator (e.g. addition, sin, sqrt). */
|
19
|
+
#define TI_TYPE_COMPARATIVE 5 /* These are designed to take inputs from different securities. i.e. compare stock A to stock B.*/
|
20
|
+
|
21
|
+
#define TI_MAXINDPARAMS 10 /* No indicator will use more than this many inputs, options, or outputs. */
|
22
|
+
|
23
|
+
typedef int (*ti_indicator_start_function)(TI_REAL const *options);
|
24
|
+
typedef int (*ti_indicator_function)(int size,
|
25
|
+
TI_REAL const *const *inputs,
|
26
|
+
TI_REAL const *options,
|
27
|
+
TI_REAL *const *outputs);
|
28
|
+
|
29
|
+
typedef struct ti_indicator_info
|
30
|
+
{
|
31
|
+
char *name;
|
32
|
+
char *full_name;
|
33
|
+
ti_indicator_start_function start;
|
34
|
+
ti_indicator_function indicator;
|
35
|
+
int type, inputs, options, outputs;
|
36
|
+
char *input_names[TI_MAXINDPARAMS];
|
37
|
+
char *option_names[TI_MAXINDPARAMS];
|
38
|
+
char *output_names[TI_MAXINDPARAMS];
|
39
|
+
} ti_indicator_info;
|
40
|
+
|
41
|
+
/*Complete array of all indicators. Last element is 0,0,0,0...*/
|
42
|
+
extern ti_indicator_info ti_indicators[];
|
43
|
+
|
44
|
+
/*
|
45
|
+
*
|
46
|
+
*
|
47
|
+
*
|
48
|
+
*
|
49
|
+
*
|
50
|
+
* All indicators below, sorted alphabetically.
|
51
|
+
*
|
52
|
+
*
|
53
|
+
*
|
54
|
+
*
|
55
|
+
*
|
56
|
+
*/
|
57
|
+
|
58
|
+
/* Vector Absolute Value */
|
59
|
+
/* Type: simple */
|
60
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
61
|
+
/* Inputs: real */
|
62
|
+
/* Options: none */
|
63
|
+
/* Outputs: abs */
|
64
|
+
int ti_abs_start(TI_REAL const *options);
|
65
|
+
int ti_abs(int size,
|
66
|
+
TI_REAL const *const *inputs,
|
67
|
+
TI_REAL const *options,
|
68
|
+
TI_REAL *const *outputs);
|
69
|
+
|
70
|
+
/* Vector Arccosine */
|
71
|
+
/* Type: simple */
|
72
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
73
|
+
/* Inputs: real */
|
74
|
+
/* Options: none */
|
75
|
+
/* Outputs: acos */
|
76
|
+
int ti_acos_start(TI_REAL const *options);
|
77
|
+
int ti_acos(int size,
|
78
|
+
TI_REAL const *const *inputs,
|
79
|
+
TI_REAL const *options,
|
80
|
+
TI_REAL *const *outputs);
|
81
|
+
|
82
|
+
/* Accumulation/Distribution Line */
|
83
|
+
/* Type: indicator */
|
84
|
+
/* Input arrays: 4 Options: 0 Output arrays: 1 */
|
85
|
+
/* Inputs: high, low, close, volume */
|
86
|
+
/* Options: none */
|
87
|
+
/* Outputs: ad */
|
88
|
+
int ti_ad_start(TI_REAL const *options);
|
89
|
+
int ti_ad(int size,
|
90
|
+
TI_REAL const *const *inputs,
|
91
|
+
TI_REAL const *options,
|
92
|
+
TI_REAL *const *outputs);
|
93
|
+
|
94
|
+
/* Vector Addition */
|
95
|
+
/* Type: simple */
|
96
|
+
/* Input arrays: 2 Options: 0 Output arrays: 1 */
|
97
|
+
/* Inputs: real, real */
|
98
|
+
/* Options: none */
|
99
|
+
/* Outputs: add */
|
100
|
+
int ti_add_start(TI_REAL const *options);
|
101
|
+
int ti_add(int size,
|
102
|
+
TI_REAL const *const *inputs,
|
103
|
+
TI_REAL const *options,
|
104
|
+
TI_REAL *const *outputs);
|
105
|
+
|
106
|
+
/* Accumulation/Distribution Oscillator */
|
107
|
+
/* Type: indicator */
|
108
|
+
/* Input arrays: 4 Options: 2 Output arrays: 1 */
|
109
|
+
/* Inputs: high, low, close, volume */
|
110
|
+
/* Options: short period, long period */
|
111
|
+
/* Outputs: adosc */
|
112
|
+
int ti_adosc_start(TI_REAL const *options);
|
113
|
+
int ti_adosc(int size,
|
114
|
+
TI_REAL const *const *inputs,
|
115
|
+
TI_REAL const *options,
|
116
|
+
TI_REAL *const *outputs);
|
117
|
+
|
118
|
+
/* Average Directional Movement Index */
|
119
|
+
/* Type: indicator */
|
120
|
+
/* Input arrays: 3 Options: 1 Output arrays: 1 */
|
121
|
+
/* Inputs: high, low, close */
|
122
|
+
/* Options: period */
|
123
|
+
/* Outputs: dx */
|
124
|
+
int ti_adx_start(TI_REAL const *options);
|
125
|
+
int ti_adx(int size,
|
126
|
+
TI_REAL const *const *inputs,
|
127
|
+
TI_REAL const *options,
|
128
|
+
TI_REAL *const *outputs);
|
129
|
+
|
130
|
+
/* Average Directional Movement Rating */
|
131
|
+
/* Type: indicator */
|
132
|
+
/* Input arrays: 3 Options: 1 Output arrays: 1 */
|
133
|
+
/* Inputs: high, low, close */
|
134
|
+
/* Options: period */
|
135
|
+
/* Outputs: dx */
|
136
|
+
int ti_adxr_start(TI_REAL const *options);
|
137
|
+
int ti_adxr(int size,
|
138
|
+
TI_REAL const *const *inputs,
|
139
|
+
TI_REAL const *options,
|
140
|
+
TI_REAL *const *outputs);
|
141
|
+
|
142
|
+
/* Awesome Oscillator */
|
143
|
+
/* Type: indicator */
|
144
|
+
/* Input arrays: 2 Options: 0 Output arrays: 1 */
|
145
|
+
/* Inputs: high, low */
|
146
|
+
/* Options: none */
|
147
|
+
/* Outputs: ao */
|
148
|
+
int ti_ao_start(TI_REAL const *options);
|
149
|
+
int ti_ao(int size,
|
150
|
+
TI_REAL const *const *inputs,
|
151
|
+
TI_REAL const *options,
|
152
|
+
TI_REAL *const *outputs);
|
153
|
+
|
154
|
+
/* Absolute Price Oscillator */
|
155
|
+
/* Type: indicator */
|
156
|
+
/* Input arrays: 1 Options: 2 Output arrays: 1 */
|
157
|
+
/* Inputs: real */
|
158
|
+
/* Options: short period, long period */
|
159
|
+
/* Outputs: apo */
|
160
|
+
int ti_apo_start(TI_REAL const *options);
|
161
|
+
int ti_apo(int size,
|
162
|
+
TI_REAL const *const *inputs,
|
163
|
+
TI_REAL const *options,
|
164
|
+
TI_REAL *const *outputs);
|
165
|
+
|
166
|
+
/* Aroon */
|
167
|
+
/* Type: indicator */
|
168
|
+
/* Input arrays: 2 Options: 1 Output arrays: 2 */
|
169
|
+
/* Inputs: high, low */
|
170
|
+
/* Options: period */
|
171
|
+
/* Outputs: aroon_down, aroon_up */
|
172
|
+
int ti_aroon_start(TI_REAL const *options);
|
173
|
+
int ti_aroon(int size,
|
174
|
+
TI_REAL const *const *inputs,
|
175
|
+
TI_REAL const *options,
|
176
|
+
TI_REAL *const *outputs);
|
177
|
+
|
178
|
+
/* Aroon Oscillator */
|
179
|
+
/* Type: indicator */
|
180
|
+
/* Input arrays: 2 Options: 1 Output arrays: 1 */
|
181
|
+
/* Inputs: high, low */
|
182
|
+
/* Options: period */
|
183
|
+
/* Outputs: aroonosc */
|
184
|
+
int ti_aroonosc_start(TI_REAL const *options);
|
185
|
+
int ti_aroonosc(int size,
|
186
|
+
TI_REAL const *const *inputs,
|
187
|
+
TI_REAL const *options,
|
188
|
+
TI_REAL *const *outputs);
|
189
|
+
|
190
|
+
/* Vector Arcsine */
|
191
|
+
/* Type: simple */
|
192
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
193
|
+
/* Inputs: real */
|
194
|
+
/* Options: none */
|
195
|
+
/* Outputs: asin */
|
196
|
+
int ti_asin_start(TI_REAL const *options);
|
197
|
+
int ti_asin(int size,
|
198
|
+
TI_REAL const *const *inputs,
|
199
|
+
TI_REAL const *options,
|
200
|
+
TI_REAL *const *outputs);
|
201
|
+
|
202
|
+
/* Vector Arctangent */
|
203
|
+
/* Type: simple */
|
204
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
205
|
+
/* Inputs: real */
|
206
|
+
/* Options: none */
|
207
|
+
/* Outputs: atan */
|
208
|
+
int ti_atan_start(TI_REAL const *options);
|
209
|
+
int ti_atan(int size,
|
210
|
+
TI_REAL const *const *inputs,
|
211
|
+
TI_REAL const *options,
|
212
|
+
TI_REAL *const *outputs);
|
213
|
+
|
214
|
+
/* Average True Range */
|
215
|
+
/* Type: indicator */
|
216
|
+
/* Input arrays: 3 Options: 1 Output arrays: 1 */
|
217
|
+
/* Inputs: high, low, close */
|
218
|
+
/* Options: period */
|
219
|
+
/* Outputs: atr */
|
220
|
+
int ti_atr_start(TI_REAL const *options);
|
221
|
+
int ti_atr(int size,
|
222
|
+
TI_REAL const *const *inputs,
|
223
|
+
TI_REAL const *options,
|
224
|
+
TI_REAL *const *outputs);
|
225
|
+
|
226
|
+
/* Average Price */
|
227
|
+
/* Type: overlay */
|
228
|
+
/* Input arrays: 4 Options: 0 Output arrays: 1 */
|
229
|
+
/* Inputs: open, high, low, close */
|
230
|
+
/* Options: none */
|
231
|
+
/* Outputs: avgprice */
|
232
|
+
int ti_avgprice_start(TI_REAL const *options);
|
233
|
+
int ti_avgprice(int size,
|
234
|
+
TI_REAL const *const *inputs,
|
235
|
+
TI_REAL const *options,
|
236
|
+
TI_REAL *const *outputs);
|
237
|
+
|
238
|
+
/* Bollinger Bands */
|
239
|
+
/* Type: overlay */
|
240
|
+
/* Input arrays: 1 Options: 2 Output arrays: 3 */
|
241
|
+
/* Inputs: real */
|
242
|
+
/* Options: period, stddev */
|
243
|
+
/* Outputs: bbands_lower, bbands_middle, bbands_upper */
|
244
|
+
int ti_bbands_start(TI_REAL const *options);
|
245
|
+
int ti_bbands(int size,
|
246
|
+
TI_REAL const *const *inputs,
|
247
|
+
TI_REAL const *options,
|
248
|
+
TI_REAL *const *outputs);
|
249
|
+
|
250
|
+
/* Balance of Power */
|
251
|
+
/* Type: indicator */
|
252
|
+
/* Input arrays: 4 Options: 0 Output arrays: 1 */
|
253
|
+
/* Inputs: open, high, low, close */
|
254
|
+
/* Options: none */
|
255
|
+
/* Outputs: bop */
|
256
|
+
int ti_bop_start(TI_REAL const *options);
|
257
|
+
int ti_bop(int size,
|
258
|
+
TI_REAL const *const *inputs,
|
259
|
+
TI_REAL const *options,
|
260
|
+
TI_REAL *const *outputs);
|
261
|
+
|
262
|
+
/* Commodity Channel Index */
|
263
|
+
/* Type: indicator */
|
264
|
+
/* Input arrays: 3 Options: 1 Output arrays: 1 */
|
265
|
+
/* Inputs: high, low, close */
|
266
|
+
/* Options: period */
|
267
|
+
/* Outputs: cci */
|
268
|
+
int ti_cci_start(TI_REAL const *options);
|
269
|
+
int ti_cci(int size,
|
270
|
+
TI_REAL const *const *inputs,
|
271
|
+
TI_REAL const *options,
|
272
|
+
TI_REAL *const *outputs);
|
273
|
+
|
274
|
+
/* Vector Ceiling */
|
275
|
+
/* Type: simple */
|
276
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
277
|
+
/* Inputs: real */
|
278
|
+
/* Options: none */
|
279
|
+
/* Outputs: ceil */
|
280
|
+
int ti_ceil_start(TI_REAL const *options);
|
281
|
+
int ti_ceil(int size,
|
282
|
+
TI_REAL const *const *inputs,
|
283
|
+
TI_REAL const *options,
|
284
|
+
TI_REAL *const *outputs);
|
285
|
+
|
286
|
+
/* Chande Momentum Oscillator */
|
287
|
+
/* Type: indicator */
|
288
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
289
|
+
/* Inputs: real */
|
290
|
+
/* Options: period */
|
291
|
+
/* Outputs: cmo */
|
292
|
+
int ti_cmo_start(TI_REAL const *options);
|
293
|
+
int ti_cmo(int size,
|
294
|
+
TI_REAL const *const *inputs,
|
295
|
+
TI_REAL const *options,
|
296
|
+
TI_REAL *const *outputs);
|
297
|
+
|
298
|
+
/* Vector Cosine */
|
299
|
+
/* Type: simple */
|
300
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
301
|
+
/* Inputs: real */
|
302
|
+
/* Options: none */
|
303
|
+
/* Outputs: cos */
|
304
|
+
int ti_cos_start(TI_REAL const *options);
|
305
|
+
int ti_cos(int size,
|
306
|
+
TI_REAL const *const *inputs,
|
307
|
+
TI_REAL const *options,
|
308
|
+
TI_REAL *const *outputs);
|
309
|
+
|
310
|
+
/* Vector Hyperbolic Cosine */
|
311
|
+
/* Type: simple */
|
312
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
313
|
+
/* Inputs: real */
|
314
|
+
/* Options: none */
|
315
|
+
/* Outputs: cosh */
|
316
|
+
int ti_cosh_start(TI_REAL const *options);
|
317
|
+
int ti_cosh(int size,
|
318
|
+
TI_REAL const *const *inputs,
|
319
|
+
TI_REAL const *options,
|
320
|
+
TI_REAL *const *outputs);
|
321
|
+
|
322
|
+
/* Crossany */
|
323
|
+
/* Type: math */
|
324
|
+
/* Input arrays: 2 Options: 0 Output arrays: 1 */
|
325
|
+
/* Inputs: real, real */
|
326
|
+
/* Options: none */
|
327
|
+
/* Outputs: crossany */
|
328
|
+
int ti_crossany_start(TI_REAL const *options);
|
329
|
+
int ti_crossany(int size,
|
330
|
+
TI_REAL const *const *inputs,
|
331
|
+
TI_REAL const *options,
|
332
|
+
TI_REAL *const *outputs);
|
333
|
+
|
334
|
+
/* Crossover */
|
335
|
+
/* Type: math */
|
336
|
+
/* Input arrays: 2 Options: 0 Output arrays: 1 */
|
337
|
+
/* Inputs: real, real */
|
338
|
+
/* Options: none */
|
339
|
+
/* Outputs: crossover */
|
340
|
+
int ti_crossover_start(TI_REAL const *options);
|
341
|
+
int ti_crossover(int size,
|
342
|
+
TI_REAL const *const *inputs,
|
343
|
+
TI_REAL const *options,
|
344
|
+
TI_REAL *const *outputs);
|
345
|
+
|
346
|
+
/* Chaikins Volatility */
|
347
|
+
/* Type: indicator */
|
348
|
+
/* Input arrays: 2 Options: 1 Output arrays: 1 */
|
349
|
+
/* Inputs: high, low */
|
350
|
+
/* Options: period */
|
351
|
+
/* Outputs: cvi */
|
352
|
+
int ti_cvi_start(TI_REAL const *options);
|
353
|
+
int ti_cvi(int size,
|
354
|
+
TI_REAL const *const *inputs,
|
355
|
+
TI_REAL const *options,
|
356
|
+
TI_REAL *const *outputs);
|
357
|
+
|
358
|
+
/* Linear Decay */
|
359
|
+
/* Type: math */
|
360
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
361
|
+
/* Inputs: real */
|
362
|
+
/* Options: period */
|
363
|
+
/* Outputs: decay */
|
364
|
+
int ti_decay_start(TI_REAL const *options);
|
365
|
+
int ti_decay(int size,
|
366
|
+
TI_REAL const *const *inputs,
|
367
|
+
TI_REAL const *options,
|
368
|
+
TI_REAL *const *outputs);
|
369
|
+
|
370
|
+
/* Double Exponential Moving Average */
|
371
|
+
/* Type: overlay */
|
372
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
373
|
+
/* Inputs: real */
|
374
|
+
/* Options: period */
|
375
|
+
/* Outputs: dema */
|
376
|
+
int ti_dema_start(TI_REAL const *options);
|
377
|
+
int ti_dema(int size,
|
378
|
+
TI_REAL const *const *inputs,
|
379
|
+
TI_REAL const *options,
|
380
|
+
TI_REAL *const *outputs);
|
381
|
+
|
382
|
+
/* Directional Indicator */
|
383
|
+
/* Type: indicator */
|
384
|
+
/* Input arrays: 3 Options: 1 Output arrays: 2 */
|
385
|
+
/* Inputs: high, low, close */
|
386
|
+
/* Options: period */
|
387
|
+
/* Outputs: plus_di, minus_di */
|
388
|
+
int ti_di_start(TI_REAL const *options);
|
389
|
+
int ti_di(int size,
|
390
|
+
TI_REAL const *const *inputs,
|
391
|
+
TI_REAL const *options,
|
392
|
+
TI_REAL *const *outputs);
|
393
|
+
|
394
|
+
/* Vector Division */
|
395
|
+
/* Type: simple */
|
396
|
+
/* Input arrays: 2 Options: 0 Output arrays: 1 */
|
397
|
+
/* Inputs: real, real */
|
398
|
+
/* Options: none */
|
399
|
+
/* Outputs: div */
|
400
|
+
int ti_div_start(TI_REAL const *options);
|
401
|
+
int ti_div(int size,
|
402
|
+
TI_REAL const *const *inputs,
|
403
|
+
TI_REAL const *options,
|
404
|
+
TI_REAL *const *outputs);
|
405
|
+
|
406
|
+
/* Directional Movement */
|
407
|
+
/* Type: indicator */
|
408
|
+
/* Input arrays: 2 Options: 1 Output arrays: 2 */
|
409
|
+
/* Inputs: high, low */
|
410
|
+
/* Options: period */
|
411
|
+
/* Outputs: plus_dm, minus_dm */
|
412
|
+
int ti_dm_start(TI_REAL const *options);
|
413
|
+
int ti_dm(int size,
|
414
|
+
TI_REAL const *const *inputs,
|
415
|
+
TI_REAL const *options,
|
416
|
+
TI_REAL *const *outputs);
|
417
|
+
|
418
|
+
/* Detrended Price Oscillator */
|
419
|
+
/* Type: indicator */
|
420
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
421
|
+
/* Inputs: real */
|
422
|
+
/* Options: period */
|
423
|
+
/* Outputs: dpo */
|
424
|
+
int ti_dpo_start(TI_REAL const *options);
|
425
|
+
int ti_dpo(int size,
|
426
|
+
TI_REAL const *const *inputs,
|
427
|
+
TI_REAL const *options,
|
428
|
+
TI_REAL *const *outputs);
|
429
|
+
|
430
|
+
/* Directional Movement Index */
|
431
|
+
/* Type: indicator */
|
432
|
+
/* Input arrays: 3 Options: 1 Output arrays: 1 */
|
433
|
+
/* Inputs: high, low, close */
|
434
|
+
/* Options: period */
|
435
|
+
/* Outputs: dx */
|
436
|
+
int ti_dx_start(TI_REAL const *options);
|
437
|
+
int ti_dx(int size,
|
438
|
+
TI_REAL const *const *inputs,
|
439
|
+
TI_REAL const *options,
|
440
|
+
TI_REAL *const *outputs);
|
441
|
+
|
442
|
+
/* Exponential Decay */
|
443
|
+
/* Type: math */
|
444
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
445
|
+
/* Inputs: real */
|
446
|
+
/* Options: period */
|
447
|
+
/* Outputs: edecay */
|
448
|
+
int ti_edecay_start(TI_REAL const *options);
|
449
|
+
int ti_edecay(int size,
|
450
|
+
TI_REAL const *const *inputs,
|
451
|
+
TI_REAL const *options,
|
452
|
+
TI_REAL *const *outputs);
|
453
|
+
|
454
|
+
/* Exponential Moving Average */
|
455
|
+
/* Type: overlay */
|
456
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
457
|
+
/* Inputs: real */
|
458
|
+
/* Options: period */
|
459
|
+
/* Outputs: ema */
|
460
|
+
int ti_ema_start(TI_REAL const *options);
|
461
|
+
int ti_ema(int size,
|
462
|
+
TI_REAL const *const *inputs,
|
463
|
+
TI_REAL const *options,
|
464
|
+
TI_REAL *const *outputs);
|
465
|
+
|
466
|
+
/* Ease of Movement */
|
467
|
+
/* Type: indicator */
|
468
|
+
/* Input arrays: 3 Options: 0 Output arrays: 1 */
|
469
|
+
/* Inputs: high, low, volume */
|
470
|
+
/* Options: none */
|
471
|
+
/* Outputs: emv */
|
472
|
+
int ti_emv_start(TI_REAL const *options);
|
473
|
+
int ti_emv(int size,
|
474
|
+
TI_REAL const *const *inputs,
|
475
|
+
TI_REAL const *options,
|
476
|
+
TI_REAL *const *outputs);
|
477
|
+
|
478
|
+
/* Vector Exponential */
|
479
|
+
/* Type: simple */
|
480
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
481
|
+
/* Inputs: real */
|
482
|
+
/* Options: none */
|
483
|
+
/* Outputs: exp */
|
484
|
+
int ti_exp_start(TI_REAL const *options);
|
485
|
+
int ti_exp(int size,
|
486
|
+
TI_REAL const *const *inputs,
|
487
|
+
TI_REAL const *options,
|
488
|
+
TI_REAL *const *outputs);
|
489
|
+
|
490
|
+
/* Fisher Transform */
|
491
|
+
/* Type: indicator */
|
492
|
+
/* Input arrays: 2 Options: 1 Output arrays: 2 */
|
493
|
+
/* Inputs: high, low */
|
494
|
+
/* Options: period */
|
495
|
+
/* Outputs: fisher, fisher_signal */
|
496
|
+
int ti_fisher_start(TI_REAL const *options);
|
497
|
+
int ti_fisher(int size,
|
498
|
+
TI_REAL const *const *inputs,
|
499
|
+
TI_REAL const *options,
|
500
|
+
TI_REAL *const *outputs);
|
501
|
+
|
502
|
+
/* Vector Floor */
|
503
|
+
/* Type: simple */
|
504
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
505
|
+
/* Inputs: real */
|
506
|
+
/* Options: none */
|
507
|
+
/* Outputs: floor */
|
508
|
+
int ti_floor_start(TI_REAL const *options);
|
509
|
+
int ti_floor(int size,
|
510
|
+
TI_REAL const *const *inputs,
|
511
|
+
TI_REAL const *options,
|
512
|
+
TI_REAL *const *outputs);
|
513
|
+
|
514
|
+
/* Forecast Oscillator */
|
515
|
+
/* Type: indicator */
|
516
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
517
|
+
/* Inputs: real */
|
518
|
+
/* Options: period */
|
519
|
+
/* Outputs: fosc */
|
520
|
+
int ti_fosc_start(TI_REAL const *options);
|
521
|
+
int ti_fosc(int size,
|
522
|
+
TI_REAL const *const *inputs,
|
523
|
+
TI_REAL const *options,
|
524
|
+
TI_REAL *const *outputs);
|
525
|
+
|
526
|
+
/* Hull Moving Average */
|
527
|
+
/* Type: overlay */
|
528
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
529
|
+
/* Inputs: real */
|
530
|
+
/* Options: period */
|
531
|
+
/* Outputs: hma */
|
532
|
+
int ti_hma_start(TI_REAL const *options);
|
533
|
+
int ti_hma(int size,
|
534
|
+
TI_REAL const *const *inputs,
|
535
|
+
TI_REAL const *options,
|
536
|
+
TI_REAL *const *outputs);
|
537
|
+
|
538
|
+
/* Kaufman Adaptive Moving Average */
|
539
|
+
/* Type: overlay */
|
540
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
541
|
+
/* Inputs: real */
|
542
|
+
/* Options: period */
|
543
|
+
/* Outputs: kama */
|
544
|
+
int ti_kama_start(TI_REAL const *options);
|
545
|
+
int ti_kama(int size,
|
546
|
+
TI_REAL const *const *inputs,
|
547
|
+
TI_REAL const *options,
|
548
|
+
TI_REAL *const *outputs);
|
549
|
+
|
550
|
+
/* Klinger Volume Oscillator */
|
551
|
+
/* Type: indicator */
|
552
|
+
/* Input arrays: 4 Options: 2 Output arrays: 1 */
|
553
|
+
/* Inputs: high, low, close, volume */
|
554
|
+
/* Options: short period, long period */
|
555
|
+
/* Outputs: kvo */
|
556
|
+
int ti_kvo_start(TI_REAL const *options);
|
557
|
+
int ti_kvo(int size,
|
558
|
+
TI_REAL const *const *inputs,
|
559
|
+
TI_REAL const *options,
|
560
|
+
TI_REAL *const *outputs);
|
561
|
+
|
562
|
+
/* Lag */
|
563
|
+
/* Type: math */
|
564
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
565
|
+
/* Inputs: real */
|
566
|
+
/* Options: period */
|
567
|
+
/* Outputs: lag */
|
568
|
+
int ti_lag_start(TI_REAL const *options);
|
569
|
+
int ti_lag(int size,
|
570
|
+
TI_REAL const *const *inputs,
|
571
|
+
TI_REAL const *options,
|
572
|
+
TI_REAL *const *outputs);
|
573
|
+
|
574
|
+
/* Linear Regression */
|
575
|
+
/* Type: overlay */
|
576
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
577
|
+
/* Inputs: real */
|
578
|
+
/* Options: period */
|
579
|
+
/* Outputs: linreg */
|
580
|
+
int ti_linreg_start(TI_REAL const *options);
|
581
|
+
int ti_linreg(int size,
|
582
|
+
TI_REAL const *const *inputs,
|
583
|
+
TI_REAL const *options,
|
584
|
+
TI_REAL *const *outputs);
|
585
|
+
|
586
|
+
/* Linear Regression Intercept */
|
587
|
+
/* Type: indicator */
|
588
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
589
|
+
/* Inputs: real */
|
590
|
+
/* Options: period */
|
591
|
+
/* Outputs: linregintercept */
|
592
|
+
int ti_linregintercept_start(TI_REAL const *options);
|
593
|
+
int ti_linregintercept(int size,
|
594
|
+
TI_REAL const *const *inputs,
|
595
|
+
TI_REAL const *options,
|
596
|
+
TI_REAL *const *outputs);
|
597
|
+
|
598
|
+
/* Linear Regression Slope */
|
599
|
+
/* Type: indicator */
|
600
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
601
|
+
/* Inputs: real */
|
602
|
+
/* Options: period */
|
603
|
+
/* Outputs: linregslope */
|
604
|
+
int ti_linregslope_start(TI_REAL const *options);
|
605
|
+
int ti_linregslope(int size,
|
606
|
+
TI_REAL const *const *inputs,
|
607
|
+
TI_REAL const *options,
|
608
|
+
TI_REAL *const *outputs);
|
609
|
+
|
610
|
+
/* Vector Natural Log */
|
611
|
+
/* Type: simple */
|
612
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
613
|
+
/* Inputs: real */
|
614
|
+
/* Options: none */
|
615
|
+
/* Outputs: ln */
|
616
|
+
int ti_ln_start(TI_REAL const *options);
|
617
|
+
int ti_ln(int size,
|
618
|
+
TI_REAL const *const *inputs,
|
619
|
+
TI_REAL const *options,
|
620
|
+
TI_REAL *const *outputs);
|
621
|
+
|
622
|
+
/* Vector Base-10 Log */
|
623
|
+
/* Type: simple */
|
624
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
625
|
+
/* Inputs: real */
|
626
|
+
/* Options: none */
|
627
|
+
/* Outputs: log10 */
|
628
|
+
int ti_log10_start(TI_REAL const *options);
|
629
|
+
int ti_log10(int size,
|
630
|
+
TI_REAL const *const *inputs,
|
631
|
+
TI_REAL const *options,
|
632
|
+
TI_REAL *const *outputs);
|
633
|
+
|
634
|
+
/* Moving Average Convergence/Divergence */
|
635
|
+
/* Type: indicator */
|
636
|
+
/* Input arrays: 1 Options: 3 Output arrays: 3 */
|
637
|
+
/* Inputs: real */
|
638
|
+
/* Options: short period, long period, signal period */
|
639
|
+
/* Outputs: macd, macd_signal, macd_histogram */
|
640
|
+
int ti_macd_start(TI_REAL const *options);
|
641
|
+
int ti_macd(int size,
|
642
|
+
TI_REAL const *const *inputs,
|
643
|
+
TI_REAL const *options,
|
644
|
+
TI_REAL *const *outputs);
|
645
|
+
|
646
|
+
/* Market Facilitation Index */
|
647
|
+
/* Type: indicator */
|
648
|
+
/* Input arrays: 3 Options: 0 Output arrays: 1 */
|
649
|
+
/* Inputs: high, low, volume */
|
650
|
+
/* Options: none */
|
651
|
+
/* Outputs: marketfi */
|
652
|
+
int ti_marketfi_start(TI_REAL const *options);
|
653
|
+
int ti_marketfi(int size,
|
654
|
+
TI_REAL const *const *inputs,
|
655
|
+
TI_REAL const *options,
|
656
|
+
TI_REAL *const *outputs);
|
657
|
+
|
658
|
+
/* Mass Index */
|
659
|
+
/* Type: indicator */
|
660
|
+
/* Input arrays: 2 Options: 1 Output arrays: 1 */
|
661
|
+
/* Inputs: high, low */
|
662
|
+
/* Options: period */
|
663
|
+
/* Outputs: mass */
|
664
|
+
int ti_mass_start(TI_REAL const *options);
|
665
|
+
int ti_mass(int size,
|
666
|
+
TI_REAL const *const *inputs,
|
667
|
+
TI_REAL const *options,
|
668
|
+
TI_REAL *const *outputs);
|
669
|
+
|
670
|
+
/* Maximum In Period */
|
671
|
+
/* Type: math */
|
672
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
673
|
+
/* Inputs: real */
|
674
|
+
/* Options: period */
|
675
|
+
/* Outputs: max */
|
676
|
+
int ti_max_start(TI_REAL const *options);
|
677
|
+
int ti_max(int size,
|
678
|
+
TI_REAL const *const *inputs,
|
679
|
+
TI_REAL const *options,
|
680
|
+
TI_REAL *const *outputs);
|
681
|
+
|
682
|
+
/* Mean Deviation Over Period */
|
683
|
+
/* Type: math */
|
684
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
685
|
+
/* Inputs: real */
|
686
|
+
/* Options: period */
|
687
|
+
/* Outputs: md */
|
688
|
+
int ti_md_start(TI_REAL const *options);
|
689
|
+
int ti_md(int size,
|
690
|
+
TI_REAL const *const *inputs,
|
691
|
+
TI_REAL const *options,
|
692
|
+
TI_REAL *const *outputs);
|
693
|
+
|
694
|
+
/* Median Price */
|
695
|
+
/* Type: overlay */
|
696
|
+
/* Input arrays: 2 Options: 0 Output arrays: 1 */
|
697
|
+
/* Inputs: high, low */
|
698
|
+
/* Options: none */
|
699
|
+
/* Outputs: medprice */
|
700
|
+
int ti_medprice_start(TI_REAL const *options);
|
701
|
+
int ti_medprice(int size,
|
702
|
+
TI_REAL const *const *inputs,
|
703
|
+
TI_REAL const *options,
|
704
|
+
TI_REAL *const *outputs);
|
705
|
+
|
706
|
+
/* Money Flow Index */
|
707
|
+
/* Type: indicator */
|
708
|
+
/* Input arrays: 4 Options: 1 Output arrays: 1 */
|
709
|
+
/* Inputs: high, low, close, volume */
|
710
|
+
/* Options: period */
|
711
|
+
/* Outputs: mfi */
|
712
|
+
int ti_mfi_start(TI_REAL const *options);
|
713
|
+
int ti_mfi(int size,
|
714
|
+
TI_REAL const *const *inputs,
|
715
|
+
TI_REAL const *options,
|
716
|
+
TI_REAL *const *outputs);
|
717
|
+
|
718
|
+
/* Minimum In Period */
|
719
|
+
/* Type: math */
|
720
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
721
|
+
/* Inputs: real */
|
722
|
+
/* Options: period */
|
723
|
+
/* Outputs: min */
|
724
|
+
int ti_min_start(TI_REAL const *options);
|
725
|
+
int ti_min(int size,
|
726
|
+
TI_REAL const *const *inputs,
|
727
|
+
TI_REAL const *options,
|
728
|
+
TI_REAL *const *outputs);
|
729
|
+
|
730
|
+
/* Momentum */
|
731
|
+
/* Type: indicator */
|
732
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
733
|
+
/* Inputs: real */
|
734
|
+
/* Options: period */
|
735
|
+
/* Outputs: mom */
|
736
|
+
int ti_mom_start(TI_REAL const *options);
|
737
|
+
int ti_mom(int size,
|
738
|
+
TI_REAL const *const *inputs,
|
739
|
+
TI_REAL const *options,
|
740
|
+
TI_REAL *const *outputs);
|
741
|
+
|
742
|
+
/* Mesa Sine Wave */
|
743
|
+
/* Type: indicator */
|
744
|
+
/* Input arrays: 1 Options: 1 Output arrays: 2 */
|
745
|
+
/* Inputs: real */
|
746
|
+
/* Options: period */
|
747
|
+
/* Outputs: msw_sine, msw_lead */
|
748
|
+
int ti_msw_start(TI_REAL const *options);
|
749
|
+
int ti_msw(int size,
|
750
|
+
TI_REAL const *const *inputs,
|
751
|
+
TI_REAL const *options,
|
752
|
+
TI_REAL *const *outputs);
|
753
|
+
|
754
|
+
/* Vector Multiplication */
|
755
|
+
/* Type: simple */
|
756
|
+
/* Input arrays: 2 Options: 0 Output arrays: 1 */
|
757
|
+
/* Inputs: real, real */
|
758
|
+
/* Options: none */
|
759
|
+
/* Outputs: mul */
|
760
|
+
int ti_mul_start(TI_REAL const *options);
|
761
|
+
int ti_mul(int size,
|
762
|
+
TI_REAL const *const *inputs,
|
763
|
+
TI_REAL const *options,
|
764
|
+
TI_REAL *const *outputs);
|
765
|
+
|
766
|
+
/* Normalized Average True Range */
|
767
|
+
/* Type: indicator */
|
768
|
+
/* Input arrays: 3 Options: 1 Output arrays: 1 */
|
769
|
+
/* Inputs: high, low, close */
|
770
|
+
/* Options: period */
|
771
|
+
/* Outputs: natr */
|
772
|
+
int ti_natr_start(TI_REAL const *options);
|
773
|
+
int ti_natr(int size,
|
774
|
+
TI_REAL const *const *inputs,
|
775
|
+
TI_REAL const *options,
|
776
|
+
TI_REAL *const *outputs);
|
777
|
+
|
778
|
+
/* Negative Volume Index */
|
779
|
+
/* Type: indicator */
|
780
|
+
/* Input arrays: 2 Options: 0 Output arrays: 1 */
|
781
|
+
/* Inputs: close, volume */
|
782
|
+
/* Options: none */
|
783
|
+
/* Outputs: nvi */
|
784
|
+
int ti_nvi_start(TI_REAL const *options);
|
785
|
+
int ti_nvi(int size,
|
786
|
+
TI_REAL const *const *inputs,
|
787
|
+
TI_REAL const *options,
|
788
|
+
TI_REAL *const *outputs);
|
789
|
+
|
790
|
+
/* On Balance Volume */
|
791
|
+
/* Type: indicator */
|
792
|
+
/* Input arrays: 2 Options: 0 Output arrays: 1 */
|
793
|
+
/* Inputs: close, volume */
|
794
|
+
/* Options: none */
|
795
|
+
/* Outputs: obv */
|
796
|
+
int ti_obv_start(TI_REAL const *options);
|
797
|
+
int ti_obv(int size,
|
798
|
+
TI_REAL const *const *inputs,
|
799
|
+
TI_REAL const *options,
|
800
|
+
TI_REAL *const *outputs);
|
801
|
+
|
802
|
+
/* Percentage Price Oscillator */
|
803
|
+
/* Type: indicator */
|
804
|
+
/* Input arrays: 1 Options: 2 Output arrays: 1 */
|
805
|
+
/* Inputs: real */
|
806
|
+
/* Options: short period, long period */
|
807
|
+
/* Outputs: ppo */
|
808
|
+
int ti_ppo_start(TI_REAL const *options);
|
809
|
+
int ti_ppo(int size,
|
810
|
+
TI_REAL const *const *inputs,
|
811
|
+
TI_REAL const *options,
|
812
|
+
TI_REAL *const *outputs);
|
813
|
+
|
814
|
+
/* Parabolic SAR */
|
815
|
+
/* Type: overlay */
|
816
|
+
/* Input arrays: 2 Options: 2 Output arrays: 1 */
|
817
|
+
/* Inputs: high, low */
|
818
|
+
/* Options: acceleration factor step, acceleration factor maximum */
|
819
|
+
/* Outputs: psar */
|
820
|
+
int ti_psar_start(TI_REAL const *options);
|
821
|
+
int ti_psar(int size,
|
822
|
+
TI_REAL const *const *inputs,
|
823
|
+
TI_REAL const *options,
|
824
|
+
TI_REAL *const *outputs);
|
825
|
+
|
826
|
+
/* Positive Volume Index */
|
827
|
+
/* Type: indicator */
|
828
|
+
/* Input arrays: 2 Options: 0 Output arrays: 1 */
|
829
|
+
/* Inputs: close, volume */
|
830
|
+
/* Options: none */
|
831
|
+
/* Outputs: pvi */
|
832
|
+
int ti_pvi_start(TI_REAL const *options);
|
833
|
+
int ti_pvi(int size,
|
834
|
+
TI_REAL const *const *inputs,
|
835
|
+
TI_REAL const *options,
|
836
|
+
TI_REAL *const *outputs);
|
837
|
+
|
838
|
+
/* Qstick */
|
839
|
+
/* Type: indicator */
|
840
|
+
/* Input arrays: 2 Options: 1 Output arrays: 1 */
|
841
|
+
/* Inputs: open, close */
|
842
|
+
/* Options: period */
|
843
|
+
/* Outputs: qstick */
|
844
|
+
int ti_qstick_start(TI_REAL const *options);
|
845
|
+
int ti_qstick(int size,
|
846
|
+
TI_REAL const *const *inputs,
|
847
|
+
TI_REAL const *options,
|
848
|
+
TI_REAL *const *outputs);
|
849
|
+
|
850
|
+
/* Rate of Change */
|
851
|
+
/* Type: indicator */
|
852
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
853
|
+
/* Inputs: real */
|
854
|
+
/* Options: period */
|
855
|
+
/* Outputs: roc */
|
856
|
+
int ti_roc_start(TI_REAL const *options);
|
857
|
+
int ti_roc(int size,
|
858
|
+
TI_REAL const *const *inputs,
|
859
|
+
TI_REAL const *options,
|
860
|
+
TI_REAL *const *outputs);
|
861
|
+
|
862
|
+
/* Rate of Change Ratio */
|
863
|
+
/* Type: indicator */
|
864
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
865
|
+
/* Inputs: real */
|
866
|
+
/* Options: period */
|
867
|
+
/* Outputs: rocr */
|
868
|
+
int ti_rocr_start(TI_REAL const *options);
|
869
|
+
int ti_rocr(int size,
|
870
|
+
TI_REAL const *const *inputs,
|
871
|
+
TI_REAL const *options,
|
872
|
+
TI_REAL *const *outputs);
|
873
|
+
|
874
|
+
/* Vector Round */
|
875
|
+
/* Type: simple */
|
876
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
877
|
+
/* Inputs: real */
|
878
|
+
/* Options: none */
|
879
|
+
/* Outputs: round */
|
880
|
+
int ti_round_start(TI_REAL const *options);
|
881
|
+
int ti_round(int size,
|
882
|
+
TI_REAL const *const *inputs,
|
883
|
+
TI_REAL const *options,
|
884
|
+
TI_REAL *const *outputs);
|
885
|
+
|
886
|
+
/* Relative Strength Index */
|
887
|
+
/* Type: indicator */
|
888
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
889
|
+
/* Inputs: real */
|
890
|
+
/* Options: period */
|
891
|
+
/* Outputs: rsi */
|
892
|
+
int ti_rsi_start(TI_REAL const *options);
|
893
|
+
int ti_rsi(int size,
|
894
|
+
TI_REAL const *const *inputs,
|
895
|
+
TI_REAL const *options,
|
896
|
+
TI_REAL *const *outputs);
|
897
|
+
|
898
|
+
/* Vector Sine */
|
899
|
+
/* Type: simple */
|
900
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
901
|
+
/* Inputs: real */
|
902
|
+
/* Options: none */
|
903
|
+
/* Outputs: sin */
|
904
|
+
int ti_sin_start(TI_REAL const *options);
|
905
|
+
int ti_sin(int size,
|
906
|
+
TI_REAL const *const *inputs,
|
907
|
+
TI_REAL const *options,
|
908
|
+
TI_REAL *const *outputs);
|
909
|
+
|
910
|
+
/* Vector Hyperbolic Sine */
|
911
|
+
/* Type: simple */
|
912
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
913
|
+
/* Inputs: real */
|
914
|
+
/* Options: none */
|
915
|
+
/* Outputs: sinh */
|
916
|
+
int ti_sinh_start(TI_REAL const *options);
|
917
|
+
int ti_sinh(int size,
|
918
|
+
TI_REAL const *const *inputs,
|
919
|
+
TI_REAL const *options,
|
920
|
+
TI_REAL *const *outputs);
|
921
|
+
|
922
|
+
/* Simple Moving Average */
|
923
|
+
/* Type: overlay */
|
924
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
925
|
+
/* Inputs: real */
|
926
|
+
/* Options: period */
|
927
|
+
/* Outputs: sma */
|
928
|
+
int ti_sma_start(TI_REAL const *options);
|
929
|
+
int ti_sma(int size,
|
930
|
+
TI_REAL const *const *inputs,
|
931
|
+
TI_REAL const *options,
|
932
|
+
TI_REAL *const *outputs);
|
933
|
+
|
934
|
+
/* Vector Square Root */
|
935
|
+
/* Type: simple */
|
936
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
937
|
+
/* Inputs: real */
|
938
|
+
/* Options: none */
|
939
|
+
/* Outputs: sqrt */
|
940
|
+
int ti_sqrt_start(TI_REAL const *options);
|
941
|
+
int ti_sqrt(int size,
|
942
|
+
TI_REAL const *const *inputs,
|
943
|
+
TI_REAL const *options,
|
944
|
+
TI_REAL *const *outputs);
|
945
|
+
|
946
|
+
/* Standard Deviation Over Period */
|
947
|
+
/* Type: math */
|
948
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
949
|
+
/* Inputs: real */
|
950
|
+
/* Options: period */
|
951
|
+
/* Outputs: stddev */
|
952
|
+
int ti_stddev_start(TI_REAL const *options);
|
953
|
+
int ti_stddev(int size,
|
954
|
+
TI_REAL const *const *inputs,
|
955
|
+
TI_REAL const *options,
|
956
|
+
TI_REAL *const *outputs);
|
957
|
+
|
958
|
+
/* Standard Error Over Period */
|
959
|
+
/* Type: math */
|
960
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
961
|
+
/* Inputs: real */
|
962
|
+
/* Options: period */
|
963
|
+
/* Outputs: stderr */
|
964
|
+
int ti_stderr_start(TI_REAL const *options);
|
965
|
+
int ti_stderr(int size,
|
966
|
+
TI_REAL const *const *inputs,
|
967
|
+
TI_REAL const *options,
|
968
|
+
TI_REAL *const *outputs);
|
969
|
+
|
970
|
+
/* Stochastic Oscillator */
|
971
|
+
/* Type: indicator */
|
972
|
+
/* Input arrays: 3 Options: 3 Output arrays: 2 */
|
973
|
+
/* Inputs: high, low, close */
|
974
|
+
/* Options: %k period, %k slowing period, %d period */
|
975
|
+
/* Outputs: stoch_k, stoch_d */
|
976
|
+
int ti_stoch_start(TI_REAL const *options);
|
977
|
+
int ti_stoch(int size,
|
978
|
+
TI_REAL const *const *inputs,
|
979
|
+
TI_REAL const *options,
|
980
|
+
TI_REAL *const *outputs);
|
981
|
+
|
982
|
+
/* Stochastic RSI */
|
983
|
+
/* Type: indicator */
|
984
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
985
|
+
/* Inputs: real */
|
986
|
+
/* Options: period */
|
987
|
+
/* Outputs: stochrsi */
|
988
|
+
int ti_stochrsi_start(TI_REAL const *options);
|
989
|
+
int ti_stochrsi(int size,
|
990
|
+
TI_REAL const *const *inputs,
|
991
|
+
TI_REAL const *options,
|
992
|
+
TI_REAL *const *outputs);
|
993
|
+
|
994
|
+
/* Vector Subtraction */
|
995
|
+
/* Type: simple */
|
996
|
+
/* Input arrays: 2 Options: 0 Output arrays: 1 */
|
997
|
+
/* Inputs: real, real */
|
998
|
+
/* Options: none */
|
999
|
+
/* Outputs: sub */
|
1000
|
+
int ti_sub_start(TI_REAL const *options);
|
1001
|
+
int ti_sub(int size,
|
1002
|
+
TI_REAL const *const *inputs,
|
1003
|
+
TI_REAL const *options,
|
1004
|
+
TI_REAL *const *outputs);
|
1005
|
+
|
1006
|
+
/* Sum Over Period */
|
1007
|
+
/* Type: math */
|
1008
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
1009
|
+
/* Inputs: real */
|
1010
|
+
/* Options: period */
|
1011
|
+
/* Outputs: sum */
|
1012
|
+
int ti_sum_start(TI_REAL const *options);
|
1013
|
+
int ti_sum(int size,
|
1014
|
+
TI_REAL const *const *inputs,
|
1015
|
+
TI_REAL const *options,
|
1016
|
+
TI_REAL *const *outputs);
|
1017
|
+
|
1018
|
+
/* Vector Tangent */
|
1019
|
+
/* Type: simple */
|
1020
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
1021
|
+
/* Inputs: real */
|
1022
|
+
/* Options: none */
|
1023
|
+
/* Outputs: tan */
|
1024
|
+
int ti_tan_start(TI_REAL const *options);
|
1025
|
+
int ti_tan(int size,
|
1026
|
+
TI_REAL const *const *inputs,
|
1027
|
+
TI_REAL const *options,
|
1028
|
+
TI_REAL *const *outputs);
|
1029
|
+
|
1030
|
+
/* Vector Hyperbolic Tangent */
|
1031
|
+
/* Type: simple */
|
1032
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
1033
|
+
/* Inputs: real */
|
1034
|
+
/* Options: none */
|
1035
|
+
/* Outputs: tanh */
|
1036
|
+
int ti_tanh_start(TI_REAL const *options);
|
1037
|
+
int ti_tanh(int size,
|
1038
|
+
TI_REAL const *const *inputs,
|
1039
|
+
TI_REAL const *options,
|
1040
|
+
TI_REAL *const *outputs);
|
1041
|
+
|
1042
|
+
/* Triple Exponential Moving Average */
|
1043
|
+
/* Type: overlay */
|
1044
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
1045
|
+
/* Inputs: real */
|
1046
|
+
/* Options: period */
|
1047
|
+
/* Outputs: tema */
|
1048
|
+
int ti_tema_start(TI_REAL const *options);
|
1049
|
+
int ti_tema(int size,
|
1050
|
+
TI_REAL const *const *inputs,
|
1051
|
+
TI_REAL const *options,
|
1052
|
+
TI_REAL *const *outputs);
|
1053
|
+
|
1054
|
+
/* Vector Degree Conversion */
|
1055
|
+
/* Type: simple */
|
1056
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
1057
|
+
/* Inputs: real */
|
1058
|
+
/* Options: none */
|
1059
|
+
/* Outputs: degrees */
|
1060
|
+
int ti_todeg_start(TI_REAL const *options);
|
1061
|
+
int ti_todeg(int size,
|
1062
|
+
TI_REAL const *const *inputs,
|
1063
|
+
TI_REAL const *options,
|
1064
|
+
TI_REAL *const *outputs);
|
1065
|
+
|
1066
|
+
/* Vector Radian Conversion */
|
1067
|
+
/* Type: simple */
|
1068
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
1069
|
+
/* Inputs: real */
|
1070
|
+
/* Options: none */
|
1071
|
+
/* Outputs: radians */
|
1072
|
+
int ti_torad_start(TI_REAL const *options);
|
1073
|
+
int ti_torad(int size,
|
1074
|
+
TI_REAL const *const *inputs,
|
1075
|
+
TI_REAL const *options,
|
1076
|
+
TI_REAL *const *outputs);
|
1077
|
+
|
1078
|
+
/* True Range */
|
1079
|
+
/* Type: indicator */
|
1080
|
+
/* Input arrays: 3 Options: 0 Output arrays: 1 */
|
1081
|
+
/* Inputs: high, low, close */
|
1082
|
+
/* Options: none */
|
1083
|
+
/* Outputs: tr */
|
1084
|
+
int ti_tr_start(TI_REAL const *options);
|
1085
|
+
int ti_tr(int size,
|
1086
|
+
TI_REAL const *const *inputs,
|
1087
|
+
TI_REAL const *options,
|
1088
|
+
TI_REAL *const *outputs);
|
1089
|
+
|
1090
|
+
/* Triangular Moving Average */
|
1091
|
+
/* Type: overlay */
|
1092
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
1093
|
+
/* Inputs: real */
|
1094
|
+
/* Options: period */
|
1095
|
+
/* Outputs: trima */
|
1096
|
+
int ti_trima_start(TI_REAL const *options);
|
1097
|
+
int ti_trima(int size,
|
1098
|
+
TI_REAL const *const *inputs,
|
1099
|
+
TI_REAL const *options,
|
1100
|
+
TI_REAL *const *outputs);
|
1101
|
+
|
1102
|
+
/* Trix */
|
1103
|
+
/* Type: indicator */
|
1104
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
1105
|
+
/* Inputs: real */
|
1106
|
+
/* Options: period */
|
1107
|
+
/* Outputs: trix */
|
1108
|
+
int ti_trix_start(TI_REAL const *options);
|
1109
|
+
int ti_trix(int size,
|
1110
|
+
TI_REAL const *const *inputs,
|
1111
|
+
TI_REAL const *options,
|
1112
|
+
TI_REAL *const *outputs);
|
1113
|
+
|
1114
|
+
/* Vector Truncate */
|
1115
|
+
/* Type: simple */
|
1116
|
+
/* Input arrays: 1 Options: 0 Output arrays: 1 */
|
1117
|
+
/* Inputs: real */
|
1118
|
+
/* Options: none */
|
1119
|
+
/* Outputs: trunc */
|
1120
|
+
int ti_trunc_start(TI_REAL const *options);
|
1121
|
+
int ti_trunc(int size,
|
1122
|
+
TI_REAL const *const *inputs,
|
1123
|
+
TI_REAL const *options,
|
1124
|
+
TI_REAL *const *outputs);
|
1125
|
+
|
1126
|
+
/* Time Series Forecast */
|
1127
|
+
/* Type: overlay */
|
1128
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
1129
|
+
/* Inputs: real */
|
1130
|
+
/* Options: period */
|
1131
|
+
/* Outputs: tsf */
|
1132
|
+
int ti_tsf_start(TI_REAL const *options);
|
1133
|
+
int ti_tsf(int size,
|
1134
|
+
TI_REAL const *const *inputs,
|
1135
|
+
TI_REAL const *options,
|
1136
|
+
TI_REAL *const *outputs);
|
1137
|
+
|
1138
|
+
/* Typical Price */
|
1139
|
+
/* Type: overlay */
|
1140
|
+
/* Input arrays: 3 Options: 0 Output arrays: 1 */
|
1141
|
+
/* Inputs: high, low, close */
|
1142
|
+
/* Options: none */
|
1143
|
+
/* Outputs: typprice */
|
1144
|
+
int ti_typprice_start(TI_REAL const *options);
|
1145
|
+
int ti_typprice(int size,
|
1146
|
+
TI_REAL const *const *inputs,
|
1147
|
+
TI_REAL const *options,
|
1148
|
+
TI_REAL *const *outputs);
|
1149
|
+
|
1150
|
+
/* Ultimate Oscillator */
|
1151
|
+
/* Type: indicator */
|
1152
|
+
/* Input arrays: 3 Options: 3 Output arrays: 1 */
|
1153
|
+
/* Inputs: high, low, close */
|
1154
|
+
/* Options: short period, medium period, long period */
|
1155
|
+
/* Outputs: ultosc */
|
1156
|
+
int ti_ultosc_start(TI_REAL const *options);
|
1157
|
+
int ti_ultosc(int size,
|
1158
|
+
TI_REAL const *const *inputs,
|
1159
|
+
TI_REAL const *options,
|
1160
|
+
TI_REAL *const *outputs);
|
1161
|
+
|
1162
|
+
/* Variance Over Period */
|
1163
|
+
/* Type: math */
|
1164
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
1165
|
+
/* Inputs: real */
|
1166
|
+
/* Options: period */
|
1167
|
+
/* Outputs: var */
|
1168
|
+
int ti_var_start(TI_REAL const *options);
|
1169
|
+
int ti_var(int size,
|
1170
|
+
TI_REAL const *const *inputs,
|
1171
|
+
TI_REAL const *options,
|
1172
|
+
TI_REAL *const *outputs);
|
1173
|
+
|
1174
|
+
/* Vertical Horizontal Filter */
|
1175
|
+
/* Type: indicator */
|
1176
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
1177
|
+
/* Inputs: real */
|
1178
|
+
/* Options: period */
|
1179
|
+
/* Outputs: vhf */
|
1180
|
+
int ti_vhf_start(TI_REAL const *options);
|
1181
|
+
int ti_vhf(int size,
|
1182
|
+
TI_REAL const *const *inputs,
|
1183
|
+
TI_REAL const *options,
|
1184
|
+
TI_REAL *const *outputs);
|
1185
|
+
|
1186
|
+
/* Variable Index Dynamic Average */
|
1187
|
+
/* Type: overlay */
|
1188
|
+
/* Input arrays: 1 Options: 3 Output arrays: 1 */
|
1189
|
+
/* Inputs: real */
|
1190
|
+
/* Options: short period, long period, alpha */
|
1191
|
+
/* Outputs: vidya */
|
1192
|
+
int ti_vidya_start(TI_REAL const *options);
|
1193
|
+
int ti_vidya(int size,
|
1194
|
+
TI_REAL const *const *inputs,
|
1195
|
+
TI_REAL const *options,
|
1196
|
+
TI_REAL *const *outputs);
|
1197
|
+
|
1198
|
+
/* Annualized Historical Volatility */
|
1199
|
+
/* Type: indicator */
|
1200
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
1201
|
+
/* Inputs: real */
|
1202
|
+
/* Options: period */
|
1203
|
+
/* Outputs: volatility */
|
1204
|
+
int ti_volatility_start(TI_REAL const *options);
|
1205
|
+
int ti_volatility(int size,
|
1206
|
+
TI_REAL const *const *inputs,
|
1207
|
+
TI_REAL const *options,
|
1208
|
+
TI_REAL *const *outputs);
|
1209
|
+
|
1210
|
+
/* Volume Oscillator */
|
1211
|
+
/* Type: indicator */
|
1212
|
+
/* Input arrays: 1 Options: 2 Output arrays: 1 */
|
1213
|
+
/* Inputs: volume */
|
1214
|
+
/* Options: short period, long period */
|
1215
|
+
/* Outputs: vosc */
|
1216
|
+
int ti_vosc_start(TI_REAL const *options);
|
1217
|
+
int ti_vosc(int size,
|
1218
|
+
TI_REAL const *const *inputs,
|
1219
|
+
TI_REAL const *options,
|
1220
|
+
TI_REAL *const *outputs);
|
1221
|
+
|
1222
|
+
/* Volume Weighted Moving Average */
|
1223
|
+
/* Type: overlay */
|
1224
|
+
/* Input arrays: 2 Options: 1 Output arrays: 1 */
|
1225
|
+
/* Inputs: close, volume */
|
1226
|
+
/* Options: period */
|
1227
|
+
/* Outputs: vwma */
|
1228
|
+
int ti_vwma_start(TI_REAL const *options);
|
1229
|
+
int ti_vwma(int size,
|
1230
|
+
TI_REAL const *const *inputs,
|
1231
|
+
TI_REAL const *options,
|
1232
|
+
TI_REAL *const *outputs);
|
1233
|
+
|
1234
|
+
/* Williams Accumulation/Distribution */
|
1235
|
+
/* Type: indicator */
|
1236
|
+
/* Input arrays: 3 Options: 0 Output arrays: 1 */
|
1237
|
+
/* Inputs: high, low, close */
|
1238
|
+
/* Options: none */
|
1239
|
+
/* Outputs: wad */
|
1240
|
+
int ti_wad_start(TI_REAL const *options);
|
1241
|
+
int ti_wad(int size,
|
1242
|
+
TI_REAL const *const *inputs,
|
1243
|
+
TI_REAL const *options,
|
1244
|
+
TI_REAL *const *outputs);
|
1245
|
+
|
1246
|
+
/* Weighted Close Price */
|
1247
|
+
/* Type: overlay */
|
1248
|
+
/* Input arrays: 3 Options: 0 Output arrays: 1 */
|
1249
|
+
/* Inputs: high, low, close */
|
1250
|
+
/* Options: none */
|
1251
|
+
/* Outputs: wcprice */
|
1252
|
+
int ti_wcprice_start(TI_REAL const *options);
|
1253
|
+
int ti_wcprice(int size,
|
1254
|
+
TI_REAL const *const *inputs,
|
1255
|
+
TI_REAL const *options,
|
1256
|
+
TI_REAL *const *outputs);
|
1257
|
+
|
1258
|
+
/* Wilders Smoothing */
|
1259
|
+
/* Type: overlay */
|
1260
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
1261
|
+
/* Inputs: real */
|
1262
|
+
/* Options: period */
|
1263
|
+
/* Outputs: wilders */
|
1264
|
+
int ti_wilders_start(TI_REAL const *options);
|
1265
|
+
int ti_wilders(int size,
|
1266
|
+
TI_REAL const *const *inputs,
|
1267
|
+
TI_REAL const *options,
|
1268
|
+
TI_REAL *const *outputs);
|
1269
|
+
|
1270
|
+
/* Williams %R */
|
1271
|
+
/* Type: indicator */
|
1272
|
+
/* Input arrays: 3 Options: 1 Output arrays: 1 */
|
1273
|
+
/* Inputs: high, low, close */
|
1274
|
+
/* Options: period */
|
1275
|
+
/* Outputs: willr */
|
1276
|
+
int ti_willr_start(TI_REAL const *options);
|
1277
|
+
int ti_willr(int size,
|
1278
|
+
TI_REAL const *const *inputs,
|
1279
|
+
TI_REAL const *options,
|
1280
|
+
TI_REAL *const *outputs);
|
1281
|
+
|
1282
|
+
/* Weighted Moving Average */
|
1283
|
+
/* Type: overlay */
|
1284
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
1285
|
+
/* Inputs: real */
|
1286
|
+
/* Options: period */
|
1287
|
+
/* Outputs: wma */
|
1288
|
+
int ti_wma_start(TI_REAL const *options);
|
1289
|
+
int ti_wma(int size,
|
1290
|
+
TI_REAL const *const *inputs,
|
1291
|
+
TI_REAL const *options,
|
1292
|
+
TI_REAL *const *outputs);
|
1293
|
+
|
1294
|
+
/* Zero-Lag Exponential Moving Average */
|
1295
|
+
/* Type: overlay */
|
1296
|
+
/* Input arrays: 1 Options: 1 Output arrays: 1 */
|
1297
|
+
/* Inputs: real */
|
1298
|
+
/* Options: period */
|
1299
|
+
/* Outputs: zlema */
|
1300
|
+
int ti_zlema_start(TI_REAL const *options);
|
1301
|
+
int ti_zlema(int size,
|
1302
|
+
TI_REAL const *const *inputs,
|
1303
|
+
TI_REAL const *options,
|
1304
|
+
TI_REAL *const *outputs);
|
1305
|
+
|
1306
|
+
struct ti_indicator_info ti_indicators[] = {
|
1307
|
+
{"abs", "Vector Absolute Value", ti_abs_start, ti_abs, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"abs", 0}},
|
1308
|
+
{"acos", "Vector Arccosine", ti_acos_start, ti_acos, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"acos", 0}},
|
1309
|
+
{"ad", "Accumulation/Distribution Line", ti_ad_start, ti_ad, TI_TYPE_INDICATOR, 4, 0, 1, {"high", "low", "close", "volume", 0}, {"", 0}, {"ad", 0}},
|
1310
|
+
{"add", "Vector Addition", ti_add_start, ti_add, TI_TYPE_SIMPLE, 2, 0, 1, {"real", "real", 0}, {"", 0}, {"add", 0}},
|
1311
|
+
{"adosc", "Accumulation/Distribution Oscillator", ti_adosc_start, ti_adosc, TI_TYPE_INDICATOR, 4, 2, 1, {"high", "low", "close", "volume", 0}, {"short period", "long period", 0}, {"adosc", 0}},
|
1312
|
+
{"adx", "Average Directional Movement Index", ti_adx_start, ti_adx, TI_TYPE_INDICATOR, 3, 1, 1, {"high", "low", "close", 0}, {"period", 0}, {"dx", 0}},
|
1313
|
+
{"adxr", "Average Directional Movement Rating", ti_adxr_start, ti_adxr, TI_TYPE_INDICATOR, 3, 1, 1, {"high", "low", "close", 0}, {"period", 0}, {"dx", 0}},
|
1314
|
+
{"ao", "Awesome Oscillator", ti_ao_start, ti_ao, TI_TYPE_INDICATOR, 2, 0, 1, {"high", "low", 0}, {"", 0}, {"ao", 0}},
|
1315
|
+
{"apo", "Absolute Price Oscillator", ti_apo_start, ti_apo, TI_TYPE_INDICATOR, 1, 2, 1, {"real", 0}, {"short period", "long period", 0}, {"apo", 0}},
|
1316
|
+
{"aroon", "Aroon", ti_aroon_start, ti_aroon, TI_TYPE_INDICATOR, 2, 1, 2, {"high", "low", 0}, {"period", 0}, {"aroon_down", "aroon_up", 0}},
|
1317
|
+
{"aroonosc", "Aroon Oscillator", ti_aroonosc_start, ti_aroonosc, TI_TYPE_INDICATOR, 2, 1, 1, {"high", "low", 0}, {"period", 0}, {"aroonosc", 0}},
|
1318
|
+
{"asin", "Vector Arcsine", ti_asin_start, ti_asin, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"asin", 0}},
|
1319
|
+
{"atan", "Vector Arctangent", ti_atan_start, ti_atan, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"atan", 0}},
|
1320
|
+
{"atr", "Average True Range", ti_atr_start, ti_atr, TI_TYPE_INDICATOR, 3, 1, 1, {"high", "low", "close", 0}, {"period", 0}, {"atr", 0}},
|
1321
|
+
{"avgprice", "Average Price", ti_avgprice_start, ti_avgprice, TI_TYPE_OVERLAY, 4, 0, 1, {"open", "high", "low", "close", 0}, {"", 0}, {"avgprice", 0}},
|
1322
|
+
{"bbands", "Bollinger Bands", ti_bbands_start, ti_bbands, TI_TYPE_OVERLAY, 1, 2, 3, {"real", 0}, {"period", "stddev", 0}, {"bbands_lower", "bbands_middle", "bbands_upper", 0}},
|
1323
|
+
{"bop", "Balance of Power", ti_bop_start, ti_bop, TI_TYPE_INDICATOR, 4, 0, 1, {"open", "high", "low", "close", 0}, {"", 0}, {"bop", 0}},
|
1324
|
+
{"cci", "Commodity Channel Index", ti_cci_start, ti_cci, TI_TYPE_INDICATOR, 3, 1, 1, {"high", "low", "close", 0}, {"period", 0}, {"cci", 0}},
|
1325
|
+
{"ceil", "Vector Ceiling", ti_ceil_start, ti_ceil, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"ceil", 0}},
|
1326
|
+
{"cmo", "Chande Momentum Oscillator", ti_cmo_start, ti_cmo, TI_TYPE_INDICATOR, 1, 1, 1, {"real", 0}, {"period", 0}, {"cmo", 0}},
|
1327
|
+
{"cos", "Vector Cosine", ti_cos_start, ti_cos, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"cos", 0}},
|
1328
|
+
{"cosh", "Vector Hyperbolic Cosine", ti_cosh_start, ti_cosh, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"cosh", 0}},
|
1329
|
+
{"crossany", "Crossany", ti_crossany_start, ti_crossany, TI_TYPE_MATH, 2, 0, 1, {"real", "real", 0}, {"", 0}, {"crossany", 0}},
|
1330
|
+
{"crossover", "Crossover", ti_crossover_start, ti_crossover, TI_TYPE_MATH, 2, 0, 1, {"real", "real", 0}, {"", 0}, {"crossover", 0}},
|
1331
|
+
{"cvi", "Chaikins Volatility", ti_cvi_start, ti_cvi, TI_TYPE_INDICATOR, 2, 1, 1, {"high", "low", 0}, {"period", 0}, {"cvi", 0}},
|
1332
|
+
{"decay", "Linear Decay", ti_decay_start, ti_decay, TI_TYPE_MATH, 1, 1, 1, {"real", 0}, {"period", 0}, {"decay", 0}},
|
1333
|
+
{"dema", "Double Exponential Moving Average", ti_dema_start, ti_dema, TI_TYPE_OVERLAY, 1, 1, 1, {"real", 0}, {"period", 0}, {"dema", 0}},
|
1334
|
+
{"di", "Directional Indicator", ti_di_start, ti_di, TI_TYPE_INDICATOR, 3, 1, 2, {"high", "low", "close", 0}, {"period", 0}, {"plus_di", "minus_di", 0}},
|
1335
|
+
{"div", "Vector Division", ti_div_start, ti_div, TI_TYPE_SIMPLE, 2, 0, 1, {"real", "real", 0}, {"", 0}, {"div", 0}},
|
1336
|
+
{"dm", "Directional Movement", ti_dm_start, ti_dm, TI_TYPE_INDICATOR, 2, 1, 2, {"high", "low", 0}, {"period", 0}, {"plus_dm", "minus_dm", 0}},
|
1337
|
+
{"dpo", "Detrended Price Oscillator", ti_dpo_start, ti_dpo, TI_TYPE_INDICATOR, 1, 1, 1, {"real", 0}, {"period", 0}, {"dpo", 0}},
|
1338
|
+
{"dx", "Directional Movement Index", ti_dx_start, ti_dx, TI_TYPE_INDICATOR, 3, 1, 1, {"high", "low", "close", 0}, {"period", 0}, {"dx", 0}},
|
1339
|
+
{"edecay", "Exponential Decay", ti_edecay_start, ti_edecay, TI_TYPE_MATH, 1, 1, 1, {"real", 0}, {"period", 0}, {"edecay", 0}},
|
1340
|
+
{"ema", "Exponential Moving Average", ti_ema_start, ti_ema, TI_TYPE_OVERLAY, 1, 1, 1, {"real", 0}, {"period", 0}, {"ema", 0}},
|
1341
|
+
{"emv", "Ease of Movement", ti_emv_start, ti_emv, TI_TYPE_INDICATOR, 3, 0, 1, {"high", "low", "volume", 0}, {"", 0}, {"emv", 0}},
|
1342
|
+
{"exp", "Vector Exponential", ti_exp_start, ti_exp, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"exp", 0}},
|
1343
|
+
{"fisher", "Fisher Transform", ti_fisher_start, ti_fisher, TI_TYPE_INDICATOR, 2, 1, 2, {"high", "low", 0}, {"period", 0}, {"fisher", "fisher_signal", 0}},
|
1344
|
+
{"floor", "Vector Floor", ti_floor_start, ti_floor, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"floor", 0}},
|
1345
|
+
{"fosc", "Forecast Oscillator", ti_fosc_start, ti_fosc, TI_TYPE_INDICATOR, 1, 1, 1, {"real", 0}, {"period", 0}, {"fosc", 0}},
|
1346
|
+
{"hma", "Hull Moving Average", ti_hma_start, ti_hma, TI_TYPE_OVERLAY, 1, 1, 1, {"real", 0}, {"period", 0}, {"hma", 0}},
|
1347
|
+
{"kama", "Kaufman Adaptive Moving Average", ti_kama_start, ti_kama, TI_TYPE_OVERLAY, 1, 1, 1, {"real", 0}, {"period", 0}, {"kama", 0}},
|
1348
|
+
{"kvo", "Klinger Volume Oscillator", ti_kvo_start, ti_kvo, TI_TYPE_INDICATOR, 4, 2, 1, {"high", "low", "close", "volume", 0}, {"short period", "long period", 0}, {"kvo", 0}},
|
1349
|
+
{"lag", "Lag", ti_lag_start, ti_lag, TI_TYPE_MATH, 1, 1, 1, {"real", 0}, {"period", 0}, {"lag", 0}},
|
1350
|
+
{"linreg", "Linear Regression", ti_linreg_start, ti_linreg, TI_TYPE_OVERLAY, 1, 1, 1, {"real", 0}, {"period", 0}, {"linreg", 0}},
|
1351
|
+
{"linregintercept", "Linear Regression Intercept", ti_linregintercept_start, ti_linregintercept, TI_TYPE_INDICATOR, 1, 1, 1, {"real", 0}, {"period", 0}, {"linregintercept", 0}},
|
1352
|
+
{"linregslope", "Linear Regression Slope", ti_linregslope_start, ti_linregslope, TI_TYPE_INDICATOR, 1, 1, 1, {"real", 0}, {"period", 0}, {"linregslope", 0}},
|
1353
|
+
{"ln", "Vector Natural Log", ti_ln_start, ti_ln, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"ln", 0}},
|
1354
|
+
{"log10", "Vector Base-10 Log", ti_log10_start, ti_log10, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"log10", 0}},
|
1355
|
+
{"macd", "Moving Average Convergence/Divergence", ti_macd_start, ti_macd, TI_TYPE_INDICATOR, 1, 3, 3, {"real", 0}, {"short period", "long period", "signal period", 0}, {"macd", "macd_signal", "macd_histogram", 0}},
|
1356
|
+
{"marketfi", "Market Facilitation Index", ti_marketfi_start, ti_marketfi, TI_TYPE_INDICATOR, 3, 0, 1, {"high", "low", "volume", 0}, {"", 0}, {"marketfi", 0}},
|
1357
|
+
{"mass", "Mass Index", ti_mass_start, ti_mass, TI_TYPE_INDICATOR, 2, 1, 1, {"high", "low", 0}, {"period", 0}, {"mass", 0}},
|
1358
|
+
{"max", "Maximum In Period", ti_max_start, ti_max, TI_TYPE_MATH, 1, 1, 1, {"real", 0}, {"period", 0}, {"max", 0}},
|
1359
|
+
{"md", "Mean Deviation Over Period", ti_md_start, ti_md, TI_TYPE_MATH, 1, 1, 1, {"real", 0}, {"period", 0}, {"md", 0}},
|
1360
|
+
{"medprice", "Median Price", ti_medprice_start, ti_medprice, TI_TYPE_OVERLAY, 2, 0, 1, {"high", "low", 0}, {"", 0}, {"medprice", 0}},
|
1361
|
+
{"mfi", "Money Flow Index", ti_mfi_start, ti_mfi, TI_TYPE_INDICATOR, 4, 1, 1, {"high", "low", "close", "volume", 0}, {"period", 0}, {"mfi", 0}},
|
1362
|
+
{"min", "Minimum In Period", ti_min_start, ti_min, TI_TYPE_MATH, 1, 1, 1, {"real", 0}, {"period", 0}, {"min", 0}},
|
1363
|
+
{"mom", "Momentum", ti_mom_start, ti_mom, TI_TYPE_INDICATOR, 1, 1, 1, {"real", 0}, {"period", 0}, {"mom", 0}},
|
1364
|
+
{"msw", "Mesa Sine Wave", ti_msw_start, ti_msw, TI_TYPE_INDICATOR, 1, 1, 2, {"real", 0}, {"period", 0}, {"msw_sine", "msw_lead", 0}},
|
1365
|
+
{"mul", "Vector Multiplication", ti_mul_start, ti_mul, TI_TYPE_SIMPLE, 2, 0, 1, {"real", "real", 0}, {"", 0}, {"mul", 0}},
|
1366
|
+
{"natr", "Normalized Average True Range", ti_natr_start, ti_natr, TI_TYPE_INDICATOR, 3, 1, 1, {"high", "low", "close", 0}, {"period", 0}, {"natr", 0}},
|
1367
|
+
{"nvi", "Negative Volume Index", ti_nvi_start, ti_nvi, TI_TYPE_INDICATOR, 2, 0, 1, {"close", "volume", 0}, {"", 0}, {"nvi", 0}},
|
1368
|
+
{"obv", "On Balance Volume", ti_obv_start, ti_obv, TI_TYPE_INDICATOR, 2, 0, 1, {"close", "volume", 0}, {"", 0}, {"obv", 0}},
|
1369
|
+
{"ppo", "Percentage Price Oscillator", ti_ppo_start, ti_ppo, TI_TYPE_INDICATOR, 1, 2, 1, {"real", 0}, {"short period", "long period", 0}, {"ppo", 0}},
|
1370
|
+
{"psar", "Parabolic SAR", ti_psar_start, ti_psar, TI_TYPE_OVERLAY, 2, 2, 1, {"high", "low", 0}, {"acceleration factor step", "acceleration factor maximum", 0}, {"psar", 0}},
|
1371
|
+
{"pvi", "Positive Volume Index", ti_pvi_start, ti_pvi, TI_TYPE_INDICATOR, 2, 0, 1, {"close", "volume", 0}, {"", 0}, {"pvi", 0}},
|
1372
|
+
{"qstick", "Qstick", ti_qstick_start, ti_qstick, TI_TYPE_INDICATOR, 2, 1, 1, {"open", "close", 0}, {"period", 0}, {"qstick", 0}},
|
1373
|
+
{"roc", "Rate of Change", ti_roc_start, ti_roc, TI_TYPE_INDICATOR, 1, 1, 1, {"real", 0}, {"period", 0}, {"roc", 0}},
|
1374
|
+
{"rocr", "Rate of Change Ratio", ti_rocr_start, ti_rocr, TI_TYPE_INDICATOR, 1, 1, 1, {"real", 0}, {"period", 0}, {"rocr", 0}},
|
1375
|
+
{"round", "Vector Round", ti_round_start, ti_round, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"round", 0}},
|
1376
|
+
{"rsi", "Relative Strength Index", ti_rsi_start, ti_rsi, TI_TYPE_INDICATOR, 1, 1, 1, {"real", 0}, {"period", 0}, {"rsi", 0}},
|
1377
|
+
{"sin", "Vector Sine", ti_sin_start, ti_sin, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"sin", 0}},
|
1378
|
+
{"sinh", "Vector Hyperbolic Sine", ti_sinh_start, ti_sinh, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"sinh", 0}},
|
1379
|
+
{"sma", "Simple Moving Average", ti_sma_start, ti_sma, TI_TYPE_OVERLAY, 1, 1, 1, {"real", 0}, {"period", 0}, {"sma", 0}},
|
1380
|
+
{"sqrt", "Vector Square Root", ti_sqrt_start, ti_sqrt, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"sqrt", 0}},
|
1381
|
+
{"stddev", "Standard Deviation Over Period", ti_stddev_start, ti_stddev, TI_TYPE_MATH, 1, 1, 1, {"real", 0}, {"period", 0}, {"stddev", 0}},
|
1382
|
+
{"stderr", "Standard Error Over Period", ti_stderr_start, ti_stderr, TI_TYPE_MATH, 1, 1, 1, {"real", 0}, {"period", 0}, {"stderr", 0}},
|
1383
|
+
{"stoch", "Stochastic Oscillator", ti_stoch_start, ti_stoch, TI_TYPE_INDICATOR, 3, 3, 2, {"high", "low", "close", 0}, {"k period", "k slowing period", "d period", 0}, {"stoch_k", "stoch_d", 0}},
|
1384
|
+
{"stochrsi", "Stochastic RSI", ti_stochrsi_start, ti_stochrsi, TI_TYPE_INDICATOR, 1, 1, 1, {"real", 0}, {"period", 0}, {"stochrsi", 0}},
|
1385
|
+
{"sub", "Vector Subtraction", ti_sub_start, ti_sub, TI_TYPE_SIMPLE, 2, 0, 1, {"real", "real", 0}, {"", 0}, {"sub", 0}},
|
1386
|
+
{"sum", "Sum Over Period", ti_sum_start, ti_sum, TI_TYPE_MATH, 1, 1, 1, {"real", 0}, {"period", 0}, {"sum", 0}},
|
1387
|
+
{"tan", "Vector Tangent", ti_tan_start, ti_tan, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"tan", 0}},
|
1388
|
+
{"tanh", "Vector Hyperbolic Tangent", ti_tanh_start, ti_tanh, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"tanh", 0}},
|
1389
|
+
{"tema", "Triple Exponential Moving Average", ti_tema_start, ti_tema, TI_TYPE_OVERLAY, 1, 1, 1, {"real", 0}, {"period", 0}, {"tema", 0}},
|
1390
|
+
{"todeg", "Vector Degree Conversion", ti_todeg_start, ti_todeg, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"degrees", 0}},
|
1391
|
+
{"torad", "Vector Radian Conversion", ti_torad_start, ti_torad, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"radians", 0}},
|
1392
|
+
{"tr", "True Range", ti_tr_start, ti_tr, TI_TYPE_INDICATOR, 3, 0, 1, {"high", "low", "close", 0}, {"", 0}, {"tr", 0}},
|
1393
|
+
{"trima", "Triangular Moving Average", ti_trima_start, ti_trima, TI_TYPE_OVERLAY, 1, 1, 1, {"real", 0}, {"period", 0}, {"trima", 0}},
|
1394
|
+
{"trix", "Trix", ti_trix_start, ti_trix, TI_TYPE_INDICATOR, 1, 1, 1, {"real", 0}, {"period", 0}, {"trix", 0}},
|
1395
|
+
{"trunc", "Vector Truncate", ti_trunc_start, ti_trunc, TI_TYPE_SIMPLE, 1, 0, 1, {"real", 0}, {"", 0}, {"trunc", 0}},
|
1396
|
+
{"tsf", "Time Series Forecast", ti_tsf_start, ti_tsf, TI_TYPE_OVERLAY, 1, 1, 1, {"real", 0}, {"period", 0}, {"tsf", 0}},
|
1397
|
+
{"typprice", "Typical Price", ti_typprice_start, ti_typprice, TI_TYPE_OVERLAY, 3, 0, 1, {"high", "low", "close", 0}, {"", 0}, {"typprice", 0}},
|
1398
|
+
{"ultosc", "Ultimate Oscillator", ti_ultosc_start, ti_ultosc, TI_TYPE_INDICATOR, 3, 3, 1, {"high", "low", "close", 0}, {"short period", "medium period", "long period", 0}, {"ultosc", 0}},
|
1399
|
+
{"var", "Variance Over Period", ti_var_start, ti_var, TI_TYPE_MATH, 1, 1, 1, {"real", 0}, {"period", 0}, {"var", 0}},
|
1400
|
+
{"vhf", "Vertical Horizontal Filter", ti_vhf_start, ti_vhf, TI_TYPE_INDICATOR, 1, 1, 1, {"real", 0}, {"period", 0}, {"vhf", 0}},
|
1401
|
+
{"vidya", "Variable Index Dynamic Average", ti_vidya_start, ti_vidya, TI_TYPE_OVERLAY, 1, 3, 1, {"real", 0}, {"short period", "long period", "alpha", 0}, {"vidya", 0}},
|
1402
|
+
{"volatility", "Annualized Historical Volatility", ti_volatility_start, ti_volatility, TI_TYPE_INDICATOR, 1, 1, 1, {"real", 0}, {"period", 0}, {"volatility", 0}},
|
1403
|
+
{"vosc", "Volume Oscillator", ti_vosc_start, ti_vosc, TI_TYPE_INDICATOR, 1, 2, 1, {"volume", 0}, {"short period", "long period", 0}, {"vosc", 0}},
|
1404
|
+
{"vwma", "Volume Weighted Moving Average", ti_vwma_start, ti_vwma, TI_TYPE_OVERLAY, 2, 1, 1, {"close", "volume", 0}, {"period", 0}, {"vwma", 0}},
|
1405
|
+
{"wad", "Williams Accumulation/Distribution", ti_wad_start, ti_wad, TI_TYPE_INDICATOR, 3, 0, 1, {"high", "low", "close", 0}, {"", 0}, {"wad", 0}},
|
1406
|
+
{"wcprice", "Weighted Close Price", ti_wcprice_start, ti_wcprice, TI_TYPE_OVERLAY, 3, 0, 1, {"high", "low", "close", 0}, {"", 0}, {"wcprice", 0}},
|
1407
|
+
{"wilders", "Wilders Smoothing", ti_wilders_start, ti_wilders, TI_TYPE_OVERLAY, 1, 1, 1, {"real", 0}, {"period", 0}, {"wilders", 0}},
|
1408
|
+
{"willr", "Williams %R", ti_willr_start, ti_willr, TI_TYPE_INDICATOR, 3, 1, 1, {"high", "low", "close", 0}, {"period", 0}, {"willr", 0}},
|
1409
|
+
{"wma", "Weighted Moving Average", ti_wma_start, ti_wma, TI_TYPE_OVERLAY, 1, 1, 1, {"real", 0}, {"period", 0}, {"wma", 0}},
|
1410
|
+
{"zlema", "Zero-Lag Exponential Moving Average", ti_zlema_start, ti_zlema, TI_TYPE_OVERLAY, 1, 1, 1, {"real", 0}, {"period", 0}, {"zlema", 0}},
|
1411
|
+
{0, 0, 0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}}};
|
1412
|
+
|
1413
|
+
const ti_indicator_info *ti_find_indicator(const char *name)
|
1414
|
+
{
|
1415
|
+
int imin = 0;
|
1416
|
+
int imax = sizeof(ti_indicators) / sizeof(ti_indicator_info) - 2;
|
1417
|
+
while (imax >= imin)
|
1418
|
+
{
|
1419
|
+
const int i = (imin + ((imax - imin) / 2));
|
1420
|
+
const int c = strcmp(name, ti_indicators[i].name);
|
1421
|
+
if (c == 0)
|
1422
|
+
{
|
1423
|
+
return ti_indicators + i;
|
1424
|
+
}
|
1425
|
+
else if (c > 0)
|
1426
|
+
{
|
1427
|
+
imin = i + 1;
|
1428
|
+
}
|
1429
|
+
else
|
1430
|
+
{
|
1431
|
+
imax = i - 1;
|
1432
|
+
}
|
1433
|
+
}
|
1434
|
+
return 0;
|
1435
|
+
}
|