yageek / tulipindicators-swift

:bar_chart: Swift Technical Analysis library around tulip
https://yageek.github.io/tulipindicators-swift/
GNU Lesser General Public License v3.0
22 stars 4 forks source link

Negative Volume index (nvi) implemented as Normalized Average True range (natr) #7

Open jalberty2018 opened 2 years ago

jalberty2018 commented 2 years ago

/// Normalized Average True Range /// - Parameter inputs: An array of Quotable elements. public func natr(_ inputs: [T], period n: Int) -> (Int, [Double]) { return Tulip.shared.call_indicator(name: "natr", inputs: HLC(inputs), options: [Double(n)]) }

Remove next:

/// Normalized Average True Range /// - Parameter inputs: An array of Quotable elements. public func nvi(_ inputs: [T], period n: Int) -> (Int, [Double]) { return Tulip.shared.call_indicator(name: "natr", inputs: CV(inputs), options: [Double(n)]) }

Replace with:

/// Negative Volume Index /// - Parameter inputs: An array of Quotable elements. public func nvi(_ inputs: [T]) -> (Int, [Double]) { return Tulip.shared.call_indicator(name: "nvi", inputs: CV(inputs), options: []) }