Today’s Chart: VSLR

The chart below is created using the Plot.ly JS library. This a daily chart starting from 2015-10-14 to 2016-04-14.

function makeplot() {
Plotly.d3.csv(“http://www.neuralmarkettrends.com/public/autocharts/VSLR_2016-04-14_data.csv”, function(data){ processData(data) } );
};

function processData(allRows) {

console.log(allRows);
var data_open = [], data_close = [], data_high = [], data_low = [], dates = [];
for (var i=0; i<allRows.length; i++) {
row = allRows[i];
data_close.push(parseFloat(row['close']));
data_high.push(parseFloat(row['high']));
data_low.push(parseFloat(row['low']));
data_open.push(parseFloat(row['open']));
}
makePlotly( data_open, data_close, data_high, data_low );
}

function makePlotly( data_open, data_close, data_high, data_low ){
var data_dates = getAllDays('2015-10-14', '2016-04-14');

var fig = PlotlyFinance.createCandlestick({
open: data_open,
high: data_high,
low: data_low,
close: data_close,
dates: data_dates
});

fig.layout.title = 'Daily Stock Chart';

fig.layout.annotations = [
{
text: "VSLR Stock",
x: '-0.05',
y: 0.5,
xref: 'paper',
yref: 'paper',
font:{
size: 18
},
showarrow: false,
xanchor: 'right',
textangle: 270
}
];

Plotly.newPlot('myDiv', fig.data, fig.layout);
};

// Utility Function to generate all days
function getAllDays(start, end) {
var s = new Date(start);
var e = new Date(end);
var a = [];

while(s < e) {
a.push(s);
s = new Date(s.setDate(
s.getDate() + 1
))
}

return a;
};

makeplot();

Source: Blot NMT Feed