Features

Fibonacci Tool

Fibonacci Tool

Fibonacci tool is used for trend analysis in financial charts.

Features

Chart Types
Interaction
Analytics
BOX01/23/1501/27/1501/29/1502/02/1502/04/1502/06/1502/10/1502/12/1502/17/1502/19/1502/23/1502/25/1502/27/1503/03/1503/05/1503/09/1503/11/1503/13/1503/17/1503/19/1503/23/1503/25/1503/27/1503/31/1504/02/1504/07/1504/09/1504/13/1504/15/1504/17/1504/21/1504/23/1504/27/1504/29/1505/01/1505/05/1505/07/1505/11/1505/13/1505/15/1505/19/1505/21/1505/26/1505/28/15202438.2%50.0%61.8%

Settings

Description

Fibonacci tool is used for trend analysis in financial charts. With the help of range selector, you can choose data range for calculation.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FinancialChartExplorer.Models;
 
namespace FinancialChartExplorer.Controllers
{
    public partial class HomeController : Controller
    {
        public ActionResult FibonacciTool()
        {
            var model = BoxData.GetDataFromJson();
            ViewBag.DemoSettingsModel = new ClientSettingsModel() { Settings = CreateFibonacciToolSettings() };
            return View(model);
        }
 
        private static IDictionary<string, object[]> CreateFibonacciToolSettings()
        {
            var settings = new Dictionary<string, object[]>
            {
                {"Type", new object[]{"Arcs", "Fans", "Retracements", "Time Zones"}},
                {"Uptrend", new object[]{"True","False"}},
                {"Label Position", new object[]{"Bottom", "Center", "Left", "None", "Right", "Top"}},
                {"Range Selector", new object[]{"False","True"}},
                {"Start.X", new object[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
                    "11", "12", "13", "14", "15", "20", "25", "30", "35", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "55", "60"}},
                {"Start.Y", new object[]{"15.12", "15.75", "16.12", "16.75", "17.12", "17.75",
                    "18.12", "18.75", "19.12", "19.75", "20.12", "20.75", "21.12", "21.75", "22.12", "22.75", "23.12", "23.75", "24.12", "24.75", "25.12", "25.75"}},
                {"End.X", new object[]{"30", "31", "32", "33", "34", "35", "36", "37", "38", "39",
                    "40", "45", "50", "51", "52", "53", "54", "55", "56", "57", "58", "60"}},
                {"End.Y", new object[]{"15.10", "15.53", "16.10", "16.53", "17.10", "17.53",
                    "18.10", "18.53", "19.10", "19.53", "20.10", "20.53", "21.10", "21.53", "22.10", "22.53", "23.10", "23.53", "24.10", "24.53", "25.10", "25.53"}},
                {"StartX", new object[]{"-10", "-5", "-4", "-3", "-2", "-1", "0", "1", "2", "3", "4", "5", "10"}},
                {"EndX", new object[]{"-10", "-5", "-4", "-3", "-2", "-1", "0", "1", "2", "3", "4", "5", "10"}}
            };
 
            return settings;
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
@using FinancialChartExplorer.Models
 
@model List<FinanceData>
@{
    ViewBag.DemoSettings = true;
    ClientSettingsModel demoSettingsModel = ViewBag.DemoSettingsModel;
}
 
 
<script type="text/javascript">
    var seriesIndex;
 
    function hideOption(optionName) {
        var eleMenu = wijmo.getElement('#' + optionName.replace('.', '_').replace(/ /g, ''));
        if (eleMenu) {
            eleMenu.style.display = 'none';
        }
    }
 
    function showOption(optionName, value, allowedValues) {
        var id = optionName.replace('.', '_').replace(/ /g, ''),
            labelText = optionName.replace('.', ' '),
            eleMenu = wijmo.getElement('#' + id), menu;
        if (eleMenu) {
            eleMenu.style.display = '';
        }
        if (typeof (value) !== 'undefined') {
            menu = wijmo.Control.getControl('#' + id);
            if (menu) {
                menu.header = ' ' + labelText + ': ' + '<b>' + value + '</b>';
                if (allowedValues && allowedValues.length > 0) {
                    var items = [];
                    allowedValues.forEach(function (item) {
                        items.push({ Header: item, CommandParameter: item });
                    });
                    menu.itemsSource = items;
                }
            }
        }
    }
 
    function showSeries(chart, index) {
        for (var i = 1; i < chart.series.length; i++) {
            chart.series[i].visibility = (i == index) ? wijmo.chart.SeriesVisibility.Visible : wijmo.chart.SeriesVisibility.Hidden;
        }
    }
 
    function updateType(chart, value) {
        var series;
        switch (value) {
            case 'Arcs':
                seriesIndex = 2;
                series = chart.series[seriesIndex];
                showOption('Label Position', wijmo.chart.LabelPosition[series.labelPosition], ['Top', 'Center', 'Bottom', 'None']);
                showOption('Start.X', series.start.x);
                showOption('Start.Y', series.start.y);
                showOption('End.X', series.end.x);
                showOption('End.Y', series.end.y);
                hideOption('StartX');
                hideOption('EndX');
                hideOption('Range Selector');
                hideOption('Uptrend');
                showSeries(chart, seriesIndex);
                break;
            case 'Fans':
                seriesIndex = 3;
                series = chart.series[seriesIndex];
                showOption('Label Position', wijmo.chart.LabelPosition[series.labelPosition], ['Top', 'Center', 'Bottom', 'None']);
                showOption('Start.X', series.start.x);
                showOption('Start.Y', series.start.y);
                showOption('End.X', series.end.x);
                showOption('End.Y', series.end.y);
                hideOption('StartX');
                hideOption('EndX');
                hideOption('Range Selector');
                hideOption('Uptrend');
                showSeries(chart, seriesIndex);
                break;
            case 'Retracements':
                seriesIndex = 1;
                series = chart.series[seriesIndex];
                rs = c1.getExtender(chart, 'RangeSelector'),
                showOption('Label Position', wijmo.chart.LabelPosition[series.labelPosition], ['Left', 'Center', 'Right', 'None']);
                showOption('Uptrend', series.uptrend ? 'True' : 'False');
                showOption('Range Selector', rs.isVisible ? 'True' : 'False');
                hideOption('Start.X');
                hideOption('Start.Y');
                hideOption('End.X');
                hideOption('End.Y');
                hideOption('StartX');
                hideOption('EndX');
                showSeries(chart, seriesIndex);
                break;
            case 'Time Zones':
                seriesIndex = 4;
                series = chart.series[seriesIndex];
                showOption('Label Position', wijmo.chart.LabelPosition[series.labelPosition], ['Left', 'Center', 'Right', 'None']);
                showOption('StartX', series.startX);
                showOption('EndX', series.endX);
                hideOption('Start.X');
                hideOption('Start.Y');
                hideOption('End.X');
                hideOption('End.Y');
                hideOption('Range Selector');
                hideOption('Uptrend');
                showSeries(chart, seriesIndex);
                break;
        }
    }
 
    function rangeChanged(sender, args) {
        var chart = wijmo.Control.getControl('#' + '@(demoSettingsModel.ControlId)'),
            rs = c1.getExtender(chart, 'RangeSelector');
        if (!chart || !rs) {
            return;
        }
 
        chart.beginUpdate();
        chart.series[1].minX = rs.min;
        chart.series[1].maxX = rs.max;
        chart.endUpdate();
    }
 
    function customChangeUptrend(control, value) {
        var series = control.series[seriesIndex];
        if (series) {
            series.uptrend = (value === 'True');
        }
    }
 
    function customChangeLabelPosition(control, value) {
        var series = control.series[seriesIndex];
        if (series) {
            series.labelPosition = wijmo.chart.LabelPosition[value];
        }
    }
 
    function customChangeRangeSelector(control, value) {
        var rs = c1.getExtender(control, 'RangeSelector');
        if (rs) {
            rs.isVisible = (value === 'True');
        }
    }
 
    function customChangeStart_X(control, value) {
        var series = control.series[seriesIndex];
        if (series) {
            series.start = new wijmo.chart.DataPoint(parseFloat(value), series.start.y);
        }
    }
 
    function customChangeStart_Y(control, value) {
        var series = control.series[seriesIndex];
        if (series) {
            series.start = new wijmo.chart.DataPoint(series.start.x, parseFloat(value));
        }
    }
 
    function customChangeEnd_X(control, value) {
        var series = control.series[seriesIndex];
        if (series) {
            series.end = new wijmo.chart.DataPoint(parseFloat(value), series.end.y);
        }
    }
 
    function customChangeEnd_Y(control, value) {
        var series = control.series[seriesIndex];
        if (series) {
            series.end = new wijmo.chart.DataPoint(series.end.x, parseFloat(value));
        }
    }
 
    function customChangeStartX(control, value) {
        var series = control.series[seriesIndex];
        if (series) {
            series.startX = parseFloat(value);
        }
    }
 
    function customChangeEndX(control, value) {
        var series = control.series[seriesIndex];
        if (series) {
            series.endX = parseFloat(value);
        }
    }
 
    c1.documentReady(function () {
        var chart = wijmo.Control.getControl('#' + '@(demoSettingsModel.ControlId)');
        if (chart) {
            updateType(chart, 'Arcs');
        }
    });
</script>
 
 
@(Html.C1().FinancialChart()
.Id(demoSettingsModel.ControlId)
.Bind(Model)
.BindingX("X")
.SymbolSize(6)
.ChartType(C1.Web.Mvc.Finance.ChartType.Candlestick)
.Series(sers =>
    {
        sers.Add().Binding("High,Low,Open,Close").Name("BOX");
        sers.AddFibonacci().Binding("Close").Uptrend(true).LabelPosition(C1.Web.Mvc.Chart.LabelPosition.Left).Style(svgb => svgb.FontSize(10));
        sers.AddFibonacciArcs().Binding("Close").Start(new DataPoint(46, 19.75)).End(new DataPoint(54, 17.10)).LabelPosition(C1.Web.Mvc.Chart.LabelPosition.Top);
        sers.AddFibonacciFans().Binding("Close").Start(new DataPoint(10, 18.12)).End(new DataPoint(32, 20.53)).LabelPosition(C1.Web.Mvc.Chart.LabelPosition.Top);
        sers.AddFibonacciTimeZones().Binding("Close").StartX(0).EndX(3);
    })
.AddRangeSelector(rsb => rsb.Id("RangeSelector").Seamless(true).OnClientRangeChanged("rangeChanged").IsVisible(false))
)
 
@section Description{
    <p>
        Fibonacci tool is used for trend analysis in financial charts. With the help of range selector, you can choose data range for calculation.
    </p>
}
@section Summary{
    <p>
        Fibonacci tool is used for trend analysis in financial charts.
    </p>
}