diff --git a/examples/example.js b/examples/example.js index 999bb9c..70ce856 100644 --- a/examples/example.js +++ b/examples/example.js @@ -51,6 +51,6 @@ client.init({ function emaAlgorithm(buy, sell, data) { console.log(" ") console.log(data.price); - console.log(data.sma.daily(50)); - console.log(data.sma.daily(200)); + console.log(data.ema.daily(10)); + console.log(data.ema.daily(50)); } \ No newline at end of file diff --git a/src/index.js b/src/index.js index bda9de1..c1c3e35 100644 --- a/src/index.js +++ b/src/index.js @@ -195,6 +195,9 @@ module.exports = { } }).then((res) => { res = JSON.parse(res); + if (res['Information']) throw new Error( + "Alpha Vantage Call volume exceeded - try decreasing how often the API is verified" + ); var obj = res[Object.keys(res)[1]]; var first_el = obj[Object.keys(obj)[0]]; callback(first_el[Object.keys(first_el)[0]]);