Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jalberty2018 opened this issue Jun 23, 2022 · 0 comments

Comments

@jalberty2018
Copy link

jalberty2018 commented Jun 23, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant