Skip to content

Instantly share code, notes, and snippets.

@jfrez
Last active January 17, 2020 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfrez/a80235190b760619455a40090b8947b3 to your computer and use it in GitHub Desktop.
Save jfrez/a80235190b760619455a40090b8947b3 to your computer and use it in GitHub Desktop.
Pred
<script src="https://cdnjs.cloudflare.com/ajax/libs/echarts/4.6.0/echarts-en.min.js"></script>
<script
src="https://code.jquery.com/jquery-2.2.4.min.js"
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous"></script>
<script>
function addPlot (symbol,data) {
g = document.createElement('div');
g.setAttribute("id", symbol);
g.style.width = "600px";
g.style.height = "300px";
g.style.cssFloat = "left";
var dates = [];
var vals = [];
for(var i in data.dates){
dates.push(i);
vals.push(data.dates[i]);
}
document.body.appendChild(g);
var myChart = echarts.init(g);
var option = {
title: {
text: symbol
},
tooltip: {},
legend: {
data:['Close']
},
xAxis: {
data: dates
},
yAxis: {
min:Math.min.apply(null,vals),
max:Math.max.apply(null,vals)
},
series: [{
type: 'line',
data: vals
}]
};
myChart.setOption(option);
}
function getJson(){
$.ajax({
method:"get",
dataType:"json",
url:"https://gist.githubusercontent.com/jfrez/a80235190b760619455a40090b8947b3/raw/pred.json",
success:function(data){
for(var d in data){
addPlot(d,data[d]);
}
}
})
}
$(function(){
getJson();
});
</script>
{
"TSLA": {
"dates": {
"2020/01/16": 513.49,
"2020/01/17": 518.41595,
"2020/01/18": 517.09845,
"2020/01/19": 510.50043,
"2020/01/20": 499.7984,
"2020/01/21": 500.12415,
"2020/01/22": 517.1965,
"2020/01/23": 497.5843,
"2020/01/24": 498.2071,
"2020/01/25": 498.27063
},
"tendency": 6.421408999999983,
"maxwin": 20.831649999999968
},
"SPOT": {
"dates": {
"2020/01/16": 151.84,
"2020/01/17": 152.94289,
"2020/01/18": 152.19283,
"2020/01/19": 152.45155,
"2020/01/20": 153.25441,
"2020/01/21": 152.59987,
"2020/01/22": 152.69102,
"2020/01/23": 152.70801,
"2020/01/24": 152.15335,
"2020/01/25": 152.2444
},
"tendency": -0.6678330000000301,
"maxwin": 1.4144100000000037
},
"SNE": {
"dates": {
"2020/01/16": 72.62,
"2020/01/17": 73.139145,
"2020/01/18": 72.69167,
"2020/01/19": 72.05527,
"2020/01/20": 70.92451,
"2020/01/21": 70.88515,
"2020/01/22": 73.10168,
"2020/01/23": 70.902534,
"2020/01/24": 70.92355,
"2020/01/25": 70.96905
},
"tendency": 0.7987441000000075,
"maxwin": 2.2539950000000033
},
"NVDA": {
"dates": {
"2020/01/16": 248.93,
"2020/01/17": 251.88422,
"2020/01/18": 252.43616,
"2020/01/19": 249.97458,
"2020/01/20": 247.87021,
"2020/01/21": 248.34085,
"2020/01/22": 249.74823,
"2020/01/23": 249.11395,
"2020/01/24": 249.78958,
"2020/01/25": 247.60672
},
"tendency": -0.6394499999999539,
"maxwin": 4.829440000000005
},
"NTDOY": {
"dates": {
"2020/01/16": 48.84,
"2020/01/17": 49.382988,
"2020/01/18": 50.03287,
"2020/01/19": 49.85155,
"2020/01/20": 49.32387,
"2020/01/21": 49.291847,
"2020/01/22": 49.855907,
"2020/01/23": 49.964443,
"2020/01/24": 49.901875,
"2020/01/25": 49.672516
},
"tendency": -0.7717865999999987,
"maxwin": 1.1928699999999992
},
"NFLX": {
"dates": {
"2020/01/16": 338.62,
"2020/01/17": 338.9231,
"2020/01/18": 335.09082,
"2020/01/19": 330.90475,
"2020/01/20": 333.74295,
"2020/01/21": 335.773,
"2020/01/22": 338.79056,
"2020/01/23": 334.68228,
"2020/01/24": 328.8176,
"2020/01/25": 332.54202
},
"tendency": 3.831292000000076,
"maxwin": 10.10549999999995
},
"MELI": {
"dates": {
"2020/01/16": 666.45996,
"2020/01/17": 676.27966,
"2020/01/18": 667.7157,
"2020/01/19": 658.08276,
"2020/01/20": 654.85785,
"2020/01/21": 659.60175,
"2020/01/22": 675.4893,
"2020/01/23": 659.29346,
"2020/01/24": 658.91943,
"2020/01/25": 658.1632
},
"tendency": 2.973653000000013,
"maxwin": 21.42181000000005
},
"HAS": {
"dates": {
"2020/01/16": 103.62,
"2020/01/17": 105.334625,
"2020/01/18": 104.810265,
"2020/01/19": 104.23241,
"2020/01/20": 103.349495,
"2020/01/21": 103.05895,
"2020/01/22": 105.048065,
"2020/01/23": 103.79742,
"2020/01/24": 104.0067,
"2020/01/25": 103.74176
},
"tendency": -0.4799690000000112,
"maxwin": 2.2756750000000068
},
"GOOG": {
"dates": {
"2020/01/16": 1451.7,
"2020/01/17": 1464.102,
"2020/01/18": 1453.5078,
"2020/01/19": 1444.4209,
"2020/01/20": 1423.6335,
"2020/01/21": 1423.5527,
"2020/01/22": 1458.3999,
"2020/01/23": 1425.9854,
"2020/01/24": 1429.603,
"2020/01/25": 1426.2166
},
"tendency": 11.587819999999965,
"maxwin": 40.54930000000013
},
"GDDY": {
"dates": {
"2020/01/16": 72.42,
"2020/01/17": 73.34135,
"2020/01/18": 71.86226,
"2020/01/19": 71.947945,
"2020/01/20": 72.348595,
"2020/01/21": 73.10559,
"2020/01/22": 73.33098,
"2020/01/23": 73.18586,
"2020/01/24": 72.810196,
"2020/01/25": 72.62707
},
"tendency": -0.2779846000000106,
"maxwin": 1.4790899999999993
},
"FB": {
"dates": {
"2020/01/16": 221.77,
"2020/01/17": 226.4462,
"2020/01/18": 224.45679,
"2020/01/19": 223.46475,
"2020/01/20": 218.30441,
"2020/01/21": 217.7675,
"2020/01/22": 224.96768,
"2020/01/23": 219.3513,
"2020/01/24": 221.63557,
"2020/01/25": 219.44044
},
"tendency": 0.009535999999997102,
"maxwin": 8.678699999999992
},
"EBAY": {
"dates": {
"2020/01/16": 35.92,
"2020/01/17": 36.863766,
"2020/01/18": 36.91772,
"2020/01/19": 37.011135,
"2020/01/20": 36.908398,
"2020/01/21": 36.49988,
"2020/01/22": 36.70304,
"2020/01/23": 37.1828,
"2020/01/24": 37.699787,
"2020/01/25": 37.001255
},
"tendency": -0.9507781000000008,
"maxwin": 1.779786999999999
},
"EA": {
"dates": {
"2020/01/16": 111.26,
"2020/01/17": 112.170364,
"2020/01/18": 112.40263,
"2020/01/19": 111.777725,
"2020/01/20": 111.47718,
"2020/01/21": 111.17594,
"2020/01/22": 110.46745,
"2020/01/23": 111.29668,
"2020/01/24": 111.43205,
"2020/01/25": 110.10517
},
"tendency": -0.09651889999999241,
"maxwin": 2.297460000000001
},
"DBX": {
"dates": {
"2020/01/16": 18.0,
"2020/01/17": 18.045515,
"2020/01/18": 18.770733,
"2020/01/19": 18.858854,
"2020/01/20": 18.520218,
"2020/01/21": 18.801365,
"2020/01/22": 18.712524,
"2020/01/23": 18.778414,
"2020/01/24": 19.807102,
"2020/01/25": 19.804842
},
"tendency": -0.8099567000000043,
"maxwin": 1.8071020000000004
},
"CSCO": {
"dates": {
"2020/01/16": 49.05,
"2020/01/17": 49.833588,
"2020/01/18": 49.248283,
"2020/01/19": 49.36697,
"2020/01/20": 49.584038,
"2020/01/21": 49.71711,
"2020/01/22": 49.8952,
"2020/01/23": 49.953796,
"2020/01/24": 49.820152,
"2020/01/25": 49.577175
},
"tendency": -0.5546312000000029,
"maxwin": 0.9037959999999998
},
"CRM": {
"dates": {
"2020/01/16": 182.69,
"2020/01/17": 183.45268,
"2020/01/18": 180.78162,
"2020/01/19": 180.5426,
"2020/01/20": 180.17526,
"2020/01/21": 181.42085,
"2020/01/22": 183.27551,
"2020/01/23": 180.49188,
"2020/01/24": 179.57384,
"2020/01/25": 179.76886
},
"tendency": 1.47269,
"maxwin": 3.8788399999999967
},
"COMM": {
"dates": {
"2020/01/16": 14.75,
"2020/01/17": 15.503447,
"2020/01/18": 16.47711,
"2020/01/19": 17.151312,
"2020/01/20": 17.150694,
"2020/01/21": 16.704536,
"2020/01/22": 15.750479,
"2020/01/23": 17.316402,
"2020/01/24": 18.181927,
"2020/01/25": 17.447487
},
"tendency": -1.8933394000000021,
"maxwin": 3.4319270000000017
},
"ATVI": {
"dates": {
"2020/01/16": 60.43,
"2020/01/17": 60.327488,
"2020/01/18": 61.452606,
"2020/01/19": 61.066345,
"2020/01/20": 60.298004,
"2020/01/21": 59.906742,
"2020/01/22": 60.14302,
"2020/01/23": 60.31587,
"2020/01/24": 60.595337,
"2020/01/25": 60.11823
},
"tendency": -0.035364199999996515,
"maxwin": 1.5458640000000017
},
"AMZN": {
"dates": {
"2020/01/16": 1877.94,
"2020/01/17": 1891.2971,
"2020/01/18": 1871.6807,
"2020/01/19": 1856.8457,
"2020/01/20": 1864.9805,
"2020/01/21": 1885.9592,
"2020/01/22": 1904.5615,
"2020/01/23": 1887.3354,
"2020/01/24": 1874.7322,
"2020/01/25": 1883.4531
},
"tendency": -1.938539999999648,
"maxwin": 47.715799999999945
},
"AMD": {
"dates": {
"2020/01/16": 49.77,
"2020/01/17": 49.824142,
"2020/01/18": 49.462246,
"2020/01/19": 49.02659,
"2020/01/20": 48.796024,
"2020/01/21": 48.88624,
"2020/01/22": 50.20731,
"2020/01/23": 48.69537,
"2020/01/24": 48.871464,
"2020/01/25": 49.03839
},
"tendency": 0.512222400000006,
"maxwin": 1.5119400000000027
},
"AKAM": {
"dates": {
"2020/01/16": 95.82,
"2020/01/17": 96.810875,
"2020/01/18": 95.7765,
"2020/01/19": 94.96756,
"2020/01/20": 93.89005,
"2020/01/21": 93.841545,
"2020/01/22": 95.74843,
"2020/01/23": 93.90999,
"2020/01/24": 93.998886,
"2020/01/25": 93.74053
},
"tendency": 0.9695633999999984,
"maxwin": 3.070344999999989
},
"ADP": {
"dates": {
"2020/01/16": 174.88,
"2020/01/17": 176.0523,
"2020/01/18": 174.1181,
"2020/01/19": 173.6437,
"2020/01/20": 174.05019,
"2020/01/21": 175.03125,
"2020/01/22": 176.82108,
"2020/01/23": 174.81036,
"2020/01/24": 175.04947,
"2020/01/25": 175.23189
},
"tendency": -0.088833999999963,
"maxwin": 3.1773799999999994
},
"AAPL": {
"dates": {
"2020/01/16": 315.24,
"2020/01/17": 320.94775,
"2020/01/18": 315.3981,
"2020/01/19": 309.98846,
"2020/01/20": 302.29016,
"2020/01/21": 302.26517,
"2020/01/22": 314.97107,
"2020/01/23": 302.55988,
"2020/01/24": 303.61615,
"2020/01/25": 302.63312
},
"tendency": 6.249013999999988,
"maxwin": 18.682579999999973
},
"0700.HK": {
"dates": {
"2020/01/17": 399.0,
"2020/01/18": 404.76016,
"2020/01/19": 406.25183,
"2020/01/20": 404.30603,
"2020/01/21": 401.627,
"2020/01/22": 399.51678,
"2020/01/23": 401.80328,
"2020/01/24": 403.41254,
"2020/01/25": 405.79892,
"2020/01/26": 402.6427,
"2020/01/27": 401.1483
},
"tendency": -3.751594545454509,
"maxwin": 7.251829999999984
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment