Skip to content

yageek/tulipindicators-swift

Repository files navigation

tulipindicators-swift

License Carthage compatible Cocoapods

This swift package offers a technical analysis function by wrapping the tulipindicators C library

Installation

You can access the documentation here

Swift package manager

import PackageDescription

let package = Package(
    dependencies: [
        .package(url: "https://github.com/yageek/tulipindicators-swift.git", from: "1.0.1"),
    ]
)

Carthage

github "yageek/tulipindicators-swift" ~> 1.0.1

Cocoapods

pod 'tulipindicators-swift' ~> 1.0.1

Usage

import tulipindicators

let inputs: [Double] = [81.59, 81.06, 82.87, 83.00, 83.61, 83.15, 82.84, 83.99, 84.55, 84.36, 85.53, 86.54, 86.89, 87.77, 87.29]
let (beginIdx, outputs) = msw(inputs, period: 5)

print("Relative Input offset: \(beginIdx)")
print("MSW values: \(outputs)")