public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            TKChart chart = new TKChart(this.ExampleBounds);

            chart.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            this.View.AddSubview(chart);

            var xAxis     = new TKChartDateTimeCategoryAxis();
            var formatter = new NSDateFormatter();

            formatter.DateFormat = "d MMM";
            xAxis.LabelFormatter = formatter;
            xAxis.Style.MajorTickStyle.TicksOffset         = -3;
            xAxis.Style.MajorTickStyle.TicksHidden         = false;
            xAxis.Style.MajorTickStyle.TicksWidth          = 1.5f;
            xAxis.Style.MajorTickStyle.TicksFill           = new TKSolidFill(new UIColor(203 / 255.0f, 203 / 255.0f, 203 / 255.0f, 1f));
            xAxis.Style.MajorTickStyle.MaxTickClippingMode = TKChartAxisClippingMode.Visible;
            xAxis.PlotMode = TKChartAxisPlotMode.BetweenTicks;

            var yAxis = new TKChartNumericAxis(new NSNumber(320), new NSNumber(360));

            yAxis.MajorTickInterval = 20;

            var series = new TKChartCandlestickSeries(StockDataPoint.LoadStockPoints(10).ToArray());

            series.GapLength = 0.6f;
            series.XAxis     = xAxis;
            chart.YAxis      = yAxis;

            chart.AddSeries(series);
        }
Beispiel #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            CGRect exampleBounds         = this.ExampleBounds;
            CGRect overlayChartBounds    = new CGRect(exampleBounds.X, exampleBounds.Y, exampleBounds.Width, exampleBounds.Height / 1.5f);
            CGRect indicatorsChartBounds = new CGRect(exampleBounds.X, overlayChartBounds.Height + 15, exampleBounds.Width, exampleBounds.Height / 3.0f);

            overlayChart = new TKChart(overlayChartBounds);
            overlayChart.GridStyle.VerticalLinesHidden = false;
            overlayChart.AutoresizingMask = ~UIViewAutoresizing.None;
            this.View.AddSubview(overlayChart);

            indicatorsChart = new TKChart(indicatorsChartBounds);
            indicatorsChart.AutoresizingMask = ~UIViewAutoresizing.None;
            this.View.AddSubview(indicatorsChart);

            data     = StockDataPoint.LoadStockPoints(-1);
            settings = new IndicatorsTableView(this);

            SelectedIndicator = 0;
            SelectedTrendLine = 0;

            series = new TKChartCandlestickSeries(data.ToArray());

            overlayChart.Delegate = new ChartDelegate(indicatorsChart);

            this.loadCharts();
        }
Beispiel #3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            chart = new TKChart(this.ExampleBounds);
            chart.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            chart.GridStyle.VerticalLinesHidden   = false;
            chart.GridStyle.HorizontalLinesHidden = false;
            this.View.AddSubview(chart);

            points = StockDataPoint.LoadStockPoints(42);

            this.reloadChart(this, EventArgs.Empty);
        }
Beispiel #4
0
        public override void ViewDidLoad()
        {
            this.AddOption("Candlestick", ReloadChart);
            this.AddOption("Ohlc", ReloadChart);

            base.ViewDidLoad();

            chart = new TKChart(this.View.Bounds);
            chart.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            chart.GridStyle.VerticalLinesHidden   = false;
            chart.GridStyle.HorizontalLinesHidden = false;
            this.View.AddSubview(chart);

            points = StockDataPoint.LoadStockPoints(42);

            this.ReloadChart();
        }
Beispiel #5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            TKChart chart = new TKChart(this.View.Bounds);

            chart.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            this.View.AddSubview(chart);

            // >> chart-axis-datetime-cat-cs
            var xAxis     = new TKChartDateTimeCategoryAxis();
            var formatter = new NSDateFormatter();

            formatter.DateFormat = "d MMM";
            xAxis.LabelFormatter = formatter;
            xAxis.DateComponent  = NSCalendarUnit.Hour | NSCalendarUnit.Minute | NSCalendarUnit.Second;
            // << chart-axis-datetime-cat-cs

            // >> chart-tick-style-set-cs
            xAxis.Style.MajorTickStyle.TicksOffset         = -3;
            xAxis.Style.MajorTickStyle.TicksHidden         = false;
            xAxis.Style.MajorTickStyle.TicksWidth          = 1.5f;
            xAxis.Style.MajorTickStyle.TicksFill           = new TKSolidFill(new UIColor(203 / 255.0f, 203 / 255.0f, 203 / 255.0f, 1f));
            xAxis.Style.MajorTickStyle.MaxTickClippingMode = TKChartAxisClippingMode.Visible;
            // << chart-tick-style-set-cs

            // >> chart-category-plot-cs
            xAxis.PlotMode = TKChartAxisPlotMode.BetweenTicks;
            // << chart-category-plot-cs

            var yAxis = new TKChartNumericAxis(new NSNumber(320), new NSNumber(360));

            yAxis.MajorTickInterval = 20;

            var series = new TKChartCandlestickSeries(StockDataPoint.LoadStockPoints(10).ToArray());

            // >> chart-gap-cs
            series.GapLength = 0.6f;
            // << chart-gap-cs
            series.XAxis = xAxis;
            chart.YAxis  = yAxis;

            chart.AddSeries(series);
        }
Beispiel #6
0
        public override void ViewDidLoad()
        {
            this.AddOption("Simple moving average", "Trendlines", () => AddTrendline(new TKChartSimpleMovingAverageIndicator(this.series)));
            this.AddOption("Exponential moving average", "Trendlines", () => AddTrendline(new TKChartExponentialMovingAverageIndicator(this.series)));
            this.AddOption("Weighted moving average", "Trendlines", () => AddTrendline(new TKChartWeightedMovingAverageIndicator(this.series)));
            this.AddOption("Triangular moving average", "Trendlines", () => AddTrendline(new TKChartTriangularMovingAverageIndicator(this.series)));
            this.AddOption("Bollinger bands indicator", "Trendlines", () => AddTrendline(new TKChartBollingerBandIndicator(this.series)));
            this.AddOption("Moving average envelopes", "Trendlines", () => AddTrendline(new TKChartMovingAverageEnvelopesIndicator(this.series)));
            this.AddOption("Typical price", "Trendlines", () => AddTrendline(new TKChartTypicalPriceIndicator(this.series)));
            this.AddOption("Weighted close", "Trendlines", () => AddTrendline(new TKChartWeightedCloseIndicator(this.series)));
            this.AddOption("Median price", "Trendlines", () => AddTrendline(new TKChartMedianPriceIndicator(this.series)));
            this.AddOption("Modified moving average", "Trendlines", () => AddTrendline(new TKChartModifiedMovingAverageIndicator(this.series)));
            this.AddOption("Adaptive moving average", "Trendlines", () => AddTrendline(new TKChartAdaptiveMovingAverageIndicator(this.series)));

            this.AddOption("Percentage volume oscillator", "Indicators", () => AddIndicator(new TKChartPercentageVolumeOscillator(this.series)));
            this.AddOption("Percentage price oscillator", "Indicators", () => AddIndicator(new TKChartPercentagePriceOscillator(this.series)));
            this.AddOption("Absolute volume oscillator", "Indicators", () => AddIndicator(new TKChartAbsoluteVolumeOscillator(this.series)));
            this.AddOption("MACD indicator", "Indicators", () => AddIndicator(new TKChartMACDIndicator(this.series)));
            this.AddOption("RSI", "Indicators", () => AddIndicator(new TKChartRelativeStrengthIndex(this.series)));
            this.AddOption("Accumulation distribution line", "Indicators", () => AddIndicator(new TKChartAccumulationDistributionLine(this.series)));
            this.AddOption("True range", "Indicators", () => AddIndicator(new TKChartTrueRangeIndicator(this.series)));
            this.AddOption("Average true range", "Indicators", () => AddIndicator(new TKChartAverageTrueRangeIndicator(this.series)));
            this.AddOption("Commodity channel index", "Indicators", () => AddIndicator(new TKChartCommodityChannelIndex(this.series)));
            this.AddOption("Fast stochastic indicator", "Indicators", () => AddIndicator(new TKChartFastStochasticIndicator(this.series)));
            this.AddOption("Slow stochastic indicator", "Indicators", () => AddIndicator(new TKChartSlowStochasticIndicator(this.series)));
            this.AddOption("Rate of change", "Indicators", () => AddIndicator(new TKChartRateOfChangeIndicator(this.series)));
            this.AddOption("TRIX", "Indicators", () => AddIndicator(new TKChartTRIXIndicator(this.series)));
            this.AddOption("Williams percent", "Indicators", () => AddIndicator(new TKChartWilliamsPercentIndicator(this.series)));
            this.AddOption("Ease of movement", "Indicators", () => AddIndicator(new TKChartEaseOfMovementIndicator(this.series)));
            this.AddOption("Detrended price oscillator", "Indicators", () => AddIndicator(new TKChartDetrendedPriceOscillator(this.series)));
            this.AddOption("Force index", "Indicators", () => AddIndicator(new TKChartForceIndexIndicator(this.series)));
            this.AddOption("Rapid adaptive variance", "Indicators", () => AddIndicator(new TKChartRapidAdaptiveVarianceIndicator(this.series)));
            this.AddOption("Standard deviation", "Indicators", () => AddIndicator(new TKChartStandardDeviationIndicator(this.series)));
            this.AddOption("Relative momentum index", "Indicators", () => AddIndicator(new TKChartRelativeMomentumIndex(this.series)));
            this.AddOption("On balance volume", "Indicators", () => AddIndicator(new TKChartOnBalanceVolumeIndicator(this.series)));
            this.AddOption("Price volume trend", "Indicators", () => AddIndicator(new TKChartPriceVolumeTrendIndicator(this.series)));
            this.AddOption("Positive volume index", "Indicators", () => AddIndicator(new TKChartPositiveVolumeIndexIndicator(this.series)));
            this.AddOption("Negative volume index", "Indicators", () => AddIndicator(new TKChartNegativeVolumeIndexIndicator(this.series)));
            this.AddOption("Money flow index", "Indicators", () => AddIndicator(new TKChartMoneyFlowIndexIndicator(this.series)));
            this.AddOption("Ultimate oscillator", "Indicators", () => AddIndicator(new TKChartUltimateOscillator(this.series)));
            this.AddOption("Full stochastic indicator", "Indicators", () => AddIndicator(new TKChartFullStochasticIndicator(this.series)));
            this.AddOption("Market facilitation index", "Indicators", () => AddIndicator(new TKChartMarketFacilitationIndex(this.series)));
            this.AddOption("Chaikin oscillator", "Indicators", () => AddIndicator(new TKChartChaikinOscillator(this.series)));

            base.ViewDidLoad();

            CGRect exampleBounds         = this.View.Bounds;
            CGRect overlayChartBounds    = new CGRect(exampleBounds.X, exampleBounds.Y, exampleBounds.Width, exampleBounds.Height / 1.5f);
            nfloat indicatorsOffset      = exampleBounds.Y + overlayChartBounds.Height + 15;
            CGRect indicatorsChartBounds = new CGRect(exampleBounds.X, indicatorsOffset, exampleBounds.Width, exampleBounds.Height - indicatorsOffset);

            overlayChart = new TKChart(overlayChartBounds);
            overlayChart.GridStyle.VerticalLinesHidden = false;
            overlayChart.AutoresizingMask = ~UIViewAutoresizing.None;
            this.View.AddSubview(overlayChart);

            indicatorsChart = new TKChart(indicatorsChartBounds);
            indicatorsChart.AutoresizingMask = ~UIViewAutoresizing.None;
            this.View.AddSubview(indicatorsChart);

            data   = StockDataPoint.LoadStockPoints(-1);
            series = new TKChartCandlestickSeries(data.ToArray());

            this.loadCharts();
        }