All Projects → ackleymi → Swiftstock

ackleymi / Swiftstock

Licence: mit
A Swift financial markets library for accessing Yahoo! Finance APIs ⚠️ Not maintained

Programming Languages

swift
15916 projects

Labels

Projects that are alternatives of or similar to Swiftstock

HCLineChartView
HCLineChartView is a beautiful iOS library for drawing line charts. It is highly customizable and easy to use.
Stars: ✭ 22 (-81.03%)
Mutual labels:  charting
Quantmod
Quantitative Financial Modelling Framework
Stars: ✭ 578 (+398.28%)
Mutual labels:  charting
Deep Viz
A React component library, providing concise and beautiful diversity charts with Canvas, SVG, E-map, WebGL, Dom, based on data visualization experience and commercial data display practice.
Stars: ✭ 55 (-52.59%)
Mutual labels:  charting
Deep-Viz-Website
The Deep-Viz Components' display website ( Base on React + Dva + Ant-Design) 组件库Deep-Viz的展示网站
Stars: ✭ 12 (-89.66%)
Mutual labels:  charting
Flutter circular chart
Animated radial and pie charts for Flutter
Stars: ✭ 330 (+184.48%)
Mutual labels:  charting
Amcharts4
The most advanced amCharts charting library for JavaScript and TypeScript apps.
Stars: ✭ 907 (+681.9%)
Mutual labels:  charting
go-info-displays
Using Go for Information Displays
Stars: ✭ 45 (-61.21%)
Mutual labels:  charting
Interactivedatadisplay
Interactive Data Display for JavaScript
Stars: ✭ 94 (-18.97%)
Mutual labels:  charting
Pandas Technical Indicators
Technical Indicators implemented in Python using Pandas
Stars: ✭ 388 (+234.48%)
Mutual labels:  charting
Tacharting
A charing application to download, plott and analyse securities, indicators, strategies and trading records
Stars: ✭ 50 (-56.9%)
Mutual labels:  charting
extensions
Set of modules that complements Signum Framework: Authorization, Charting, ControlPanels, Mailing, Processes, Scheduled Tasks, Disconnected, User Queries...
Stars: ✭ 30 (-74.14%)
Mutual labels:  charting
Lightweight Charts
Financial lightweight charts built with HTML5 canvas
Stars: ✭ 4,390 (+3684.48%)
Mutual labels:  charting
Ggnet
GG.Net Data Visualization
Stars: ✭ 45 (-61.21%)
Mutual labels:  charting
asciichart-sharp
C# port of asciichart
Stars: ✭ 27 (-76.72%)
Mutual labels:  charting
Unity Ugui Xcharts
A charting and data visualization library for Unity. 一款基于UGUI的数据可视化图表插件。
Stars: ✭ 1,086 (+836.21%)
Mutual labels:  charting
ag-grid
The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.
Stars: ✭ 8,743 (+7437.07%)
Mutual labels:  charting
Jsxgraph
JSXGraph is a cross-browser library for interactive geometry, function plotting, charting, and data visualization in a web browser.
Stars: ✭ 605 (+421.55%)
Mutual labels:  charting
Django Ra Erp
A Django based framework to create diverse business solutions, equipped with a reporting engine and a responsive dashboard.
Stars: ✭ 108 (-6.9%)
Mutual labels:  charting
Asciichart
Nice-looking lightweight console ASCII line charts ╭┈╯ for NodeJS, browsers and terminal, no dependencies
Stars: ✭ 1,107 (+854.31%)
Mutual labels:  charting
React Google Sheet To Chart
📊 React component that renders Google Sheets as attractive charts with minimum effort
Stars: ✭ 45 (-61.21%)
Mutual labels:  charting

banner

SwiftStock is the simplest way to add real-time Yahoo! Finance stock market data to your Swift app. It's a major Swift upgrade for my previous contribution, MAStockGraph. For simplicity, the example project (SwiftStockExample.xcworkspace) I built has the Alamofire cocoapod included for networking with the Yahoo Finance APIs. Run pod install as usual if it complains. Please open issues on the project if you run into snags!

SwiftStock consists of three parts-

  1. A predictive stock quote search API.
  2. A comprehensive financial instrument API with all the best data points :D.
  3. A charting API that yields a full set of time-and-sales data over various time frames (including the elusive intraday 😊)

demo

Requirements

SwiftStock uses Swift 2.1 with ARC and requires iOS 9.0+. It also requires Alamofire be installed.

Installation

Manual

Copy the swift file SwiftStockKit to your project.

Cocoapods

Supported in a later update.

Usage

Quote Search

// Pass in your search term
SwiftStockKit.fetchStocksFromSearchTerm(term: searchText) { (stockInfoArray) -> () in

        // And it returns an array of results of type
        struct StockSearchResult {
		    var symbol: String?
		    var name: String?
		    var exchange: String?
		    var assetType: String?
		}

    }

Get a stock from a symbol

// Pass in your symbol
 SwiftStockKit.fetchStockForSymbol(symbol: stockSymbol) { (stock) -> () in

       //And it returns a stock object that looks like this
       struct Stock {
		    var ask: String?
		    var averageDailyVolume: String?
		    var bid: String?
		    var bookValue: String?
		    var changeNumeric: String?
		    var changePercent: String?
		    var dayHigh: String?
		    var dayLow: String?
		    var dividendShare: String?
		    var dividendYield: String?
		    var ebitda: String?
		    var epsEstimateCurrentYear: String?
		    var epsEstimateNextQtr: String?
		    var epsEstimateNextYr: String?
		    var eps: String?
		    var fiftydayMovingAverage: String?
		    var lastTradeDate: String?
		    var last: String?
		    var lastTradeTime: String?
		    var marketCap: String?
		    var companyName: String?
		    var oneYearTarget: String?
		    var open: String?
		    var pegRatio: String?
		    var peRatio: String?
		    var previousClose: String?
		    var priceBook: String?
		    var priceSales: String?
		    var shortRatio: String?
		    var stockExchange: String?
		    var symbol: String?
		    var twoHundreddayMovingAverage: String?
		    var volume: String?
		    var yearHigh: String?
		    var yearLow: String?

		    //this has everything neatly packaged to go into a datasource
		    var dataFields: [[String : String]]
		}

	}

Charting

// Pass in your symbol and chart time range (enum)
SwiftStockKit.fetchChartPoints(symbol: stockSymbol, range: range) { (chartPoints) -> () in

	    // And it returns an array of results of type
		struct ChartPoint {
		    var date: NSDate?
		    var volume: Int?
		    var open: CGFloat?
		    var close: CGFloat?
		    var low: CGFloat?
		    var high: CGFloat?

		}
		// Perfect for making candles 😊
    }

In the example I included a quick little swift charting library that accepts the array of ChartPoint's. Feel free to use that if you wish as well! (Bonus points for upgrading it with candles support and opening a pull request)

To-Do

  • UI Updates to the new styles- Apple keeps changing their mind about they want autolayout to work.
  • Cocoapods / Carthage Support
  • Test coverage and CI with Travis.
  • Bug bullet-proofing.

License

The MIT License (MIT)

Copyright (c) 2016 Michael Ackley

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].