-
Notifications
You must be signed in to change notification settings - Fork 537
Data Structures
André Dumas edited this page Sep 17, 2014
·
5 revisions
Wiki ▸ API Reference ▸ Data Structures
TechanJS expects data to be of a specific structure. All data arrays are assumed to be sorted in ascending date order:
var data = data.sort(function(a, b) {
return d3.ascending(a.date, b.date);
});
[
{
date: new Date(2014, 2, 11),
open: 12.3,
high: 12.45,
low: 12.22,
close: 12.25
volume: 1987289
},
{
date: new Date(2014, 2, 12),
open: 12.35,
high: 12.40,
low: 12.10,
close: 12.25
volume: 2325432
}
]
Applicable to:
[
{
date: new Date(2014, 2, 11),
value: 12.3
},
{
date: new Date(2014, 2, 12),
value: 12.35
}
]
Applicable to:
[
{
date: new Date(2014, 3, 5),
macd: 0.11,
signal: 0.27,
difference: -0.16,
zero: 0
},
{
date: new Date(2014, 3, 6),
macd: -0.12,
signal: -0.09,
difference: -0.02,
zero: 0
}
]
Applicable to:
[
{
date: new Date(2014, 3, 5),
rsi: 60,
overbought: 70,
oversold: 30,
middle: 0
},
{
date: new Date(2014, 3, 6),
rsi: 34.95,
overbought: 70,
oversold: 30,
middle: 0
}
]
Applicable to:
[
{
value: 34.5
}
]
Applicable to:
Note: Start and end dates are currently not used, but probably will be in future
[
{
start: new Date(2014, 2, 11),
end: new Date(2014, 5, 9),
value: 63.64
},
{
start: new Date(2013, 10, 21),
end: new Date(2014, 2, 17),
value: 55.50
}
]
Applicable to:
[
{
start: {
date: new Date(2014, 2, 11),
value: 72.50
},
end: {
date: new Date(2014, 5, 9),
value: 63.34
}
},
{
start: {
date: new Date(2013, 10, 21),
value: 43
},
end: {
date: new Date(2014, 2, 17),
value: 70.50
}
}
]
Applicable to: