Skip to content

Commit 6945f32

Browse files
committed
use MAType instead of c_uint
1 parent 015b18f commit 6945f32

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/root.zig

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ pub fn ADXR(allocator: std.mem.Allocator, high: []const f64, low: []const f64, c
328328
return outreal;
329329
}
330330

331-
pub fn APO(allocator: std.mem.Allocator, real: []const f64, fastperiod: i32, slowperiod: i32, matype: c_uint) ![]f64 {
331+
pub fn APO(allocator: std.mem.Allocator, real: []const f64, fastperiod: i32, slowperiod: i32, matype: MAType) ![]f64 {
332332
var outbegidx: i32 = undefined;
333333
var outnbelement: i32 = undefined;
334334
const length = real.len;
@@ -439,7 +439,7 @@ pub fn AVGDEV(allocator: std.mem.Allocator, real: []const f64, timeperiod: i32)
439439
return outreal;
440440
}
441441

442-
pub fn BBANDS(allocator: std.mem.Allocator, real: []const f64, timeperiod: i32, nbdevup: f64, nbdevdn: f64, matype: c_uint) !struct {
442+
pub fn BBANDS(allocator: std.mem.Allocator, real: []const f64, timeperiod: i32, nbdevup: f64, nbdevdn: f64, matype: MAType) !struct {
443443
outrealupperband: []f64,
444444
outrealmiddleband: []f64,
445445
outreallowerband: []f64,
@@ -1633,7 +1633,7 @@ pub fn LOG10(allocator: std.mem.Allocator, real: []const f64) ![]f64 {
16331633
return outreal;
16341634
}
16351635

1636-
pub fn MA(allocator: std.mem.Allocator, real: []const f64, timeperiod: i32, matype: c_uint) ![]f64 {
1636+
pub fn MA(allocator: std.mem.Allocator, real: []const f64, timeperiod: i32, matype: MAType) ![]f64 {
16371637
var outbegidx: i32 = undefined;
16381638
var outnbelement: i32 = undefined;
16391639
const length = real.len;
@@ -1669,7 +1669,7 @@ pub fn MACD(allocator: std.mem.Allocator, real: []const f64, fastperiod: i32, sl
16691669
};
16701670
}
16711671

1672-
pub fn MACDEXT(allocator: std.mem.Allocator, real: []const f64, fastperiod: i32, fastmatype: c_uint, slowperiod: i32, slowmatype: c_uint, signalperiod: i32, signalmatype: c_uint) !struct {
1672+
pub fn MACDEXT(allocator: std.mem.Allocator, real: []const f64, fastperiod: i32, fastmatype: MAType, slowperiod: i32, slowmatype: MAType, signalperiod: i32, signalmatype: MAType) !struct {
16731673
outmacd: []f64,
16741674
outmacdsignal: []f64,
16751675
outmacdhist: []f64,
@@ -1735,7 +1735,7 @@ pub fn MAMA(allocator: std.mem.Allocator, real: []const f64, fastlimit: f64, slo
17351735
};
17361736
}
17371737

1738-
pub fn MAVP(allocator: std.mem.Allocator, real: []const f64, periods: []const f64, minperiod: i32, maxperiod: i32, matype: c_uint) ![]f64 {
1738+
pub fn MAVP(allocator: std.mem.Allocator, real: []const f64, periods: []const f64, minperiod: i32, maxperiod: i32, matype: MAType) ![]f64 {
17391739
var outbegidx: i32 = undefined;
17401740
var outnbelement: i32 = undefined;
17411741
const length = checkLength2(real, periods);
@@ -2008,7 +2008,7 @@ pub fn PLUS_DM(allocator: std.mem.Allocator, high: []const f64, low: []const f64
20082008
return outreal;
20092009
}
20102010

2011-
pub fn PPO(allocator: std.mem.Allocator, real: []const f64, fastperiod: i32, slowperiod: i32, matype: c_uint) ![]f64 {
2011+
pub fn PPO(allocator: std.mem.Allocator, real: []const f64, fastperiod: i32, slowperiod: i32, matype: MAType) ![]f64 {
20122012
var outbegidx: i32 = undefined;
20132013
var outnbelement: i32 = undefined;
20142014
const length = real.len;
@@ -2177,7 +2177,7 @@ pub fn STDDEV(allocator: std.mem.Allocator, real: []const f64, timeperiod: i32,
21772177
return outreal;
21782178
}
21792179

2180-
pub fn STOCH(allocator: std.mem.Allocator, high: []const f64, low: []const f64, close: []const f64, fastk_period: i32, slowk_period: i32, slowk_matype: c_uint, slowd_period: i32, slowd_matype: c_uint) !struct {
2180+
pub fn STOCH(allocator: std.mem.Allocator, high: []const f64, low: []const f64, close: []const f64, fastk_period: i32, slowk_period: i32, slowk_matype: MAType, slowd_period: i32, slowd_matype: MAType) !struct {
21812181
outslowk: []f64,
21822182
outslowd: []f64,
21832183
} {
@@ -2197,7 +2197,7 @@ pub fn STOCH(allocator: std.mem.Allocator, high: []const f64, low: []const f64,
21972197
};
21982198
}
21992199

2200-
pub fn STOCHF(allocator: std.mem.Allocator, high: []const f64, low: []const f64, close: []const f64, fastk_period: i32, fastd_period: i32, fastd_matype: c_uint) !struct {
2200+
pub fn STOCHF(allocator: std.mem.Allocator, high: []const f64, low: []const f64, close: []const f64, fastk_period: i32, fastd_period: i32, fastd_matype: MAType) !struct {
22012201
outfastk: []f64,
22022202
outfastd: []f64,
22032203
} {
@@ -2217,7 +2217,7 @@ pub fn STOCHF(allocator: std.mem.Allocator, high: []const f64, low: []const f64,
22172217
};
22182218
}
22192219

2220-
pub fn STOCHRSI(allocator: std.mem.Allocator, real: []const f64, timeperiod: i32, fastk_period: i32, fastd_period: i32, fastd_matype: c_uint) !struct {
2220+
pub fn STOCHRSI(allocator: std.mem.Allocator, real: []const f64, timeperiod: i32, fastk_period: i32, fastd_period: i32, fastd_matype: MAType) !struct {
22212221
outfastk: []f64,
22222222
outfastd: []f64,
22232223
} {

0 commit comments

Comments
 (0)