-
Notifications
You must be signed in to change notification settings - Fork 2
Quickstart
NOTE: Finance SDK is built on top of the SciChart library. To use it, you must have an active SciChart license. For more details, please, follow the SciChart iOS Licensing page.
Finance SDK allows you to create a full-blown finance chart app with a few lines of code.
The central place of the Finance SDK is the SciFinanceChart. It holds studies, panes, data provider, chart modifiers, such as cursor, legend etc.
Let's see how you can create a chart just in a few steps:
- Create
SciFinanceChartinstance and add it as a subview:
let chart = SciFinanceChart()
// Add your chart as any other UIView using Storyboard, SwiftUI or purely in code.
superview.addSubview(chart)- Create DataProvider.
let candleDataProvider = DefaultCandleDataProvider()
chart.candleDataProvider = candleDataProvider
// fill the dataProvider with your candlestick data
fillDataProvider(candleDataProvider, with: StubDataManager.getCandles())NOTE: Please follow the DataProvider and DataManager section for more details.
- Create Studies. Study is the object that is responsible for charting business logic. Here you decide what your chart should display and how it should be visualized - as a candlestick, line, column, mountain, etc.
As an example, let's add two studies - PriceSeriesStudy to show candlesticks and RSIStudy to show RSI(Relative Strength Index) indicator:
let priceSeriesStudy = PriceSeriesStudy(pane: PaneId.DEFAULT_PANE)
let rsiStudy = RSIStudy(pane: PaneId.uniqueId(name: "RSI"))
chart.studies.add(priceSeriesStudy)
chart.studies.add(rsiStudy)NOTE: Creating our priceSeriesStudy with a
PaneId.DEFAULT_PANEpane id means that we want to place our study on the main pane. If you want it to be a separate pane, create your study with some unique id, as we did with the rsiStudy. Please follow the Pane article for more details.
NOTE: Of course, you can change colors, indicator inputs, and everything else. Please follow the Modify Study Properties section for more details.
- Also, let's enable a cursor:
chart.isCursorEnabled = trueNOTE: By default, the chart has already a few gesture modifiers, like Zoom, Pan, Y-Axis drag, etc. Please follow the Chart Modifiers section for more details.
- Enter the license key.
NOTE: As mentioned above, Finance SDK is built on top of the SciChart library. To see a chart, you must have an active SciChart license. For more details, please, follow the SciChart iOS Licensing page.
After you obtain your license key, use it in your project, like this:
SCIChartSurface.setRuntimeLicenseKey("YOUR_LICENSE_KEY")NOTE: Please, follow the Applying the Runtime License in Your App article for more details.
That's it. You've just created a finance chart with candles, indicators, legend, modifiers, resizing, and saved tons of development time.
