Skip to content

Instantly share code, notes, and snippets.

View luiscarbonell's full-sized avatar
😜
Focusing

Luis Carbonell luiscarbonell

😜
Focusing
View GitHub Profile
@luiscarbonell
luiscarbonell / marketCapWeighted.js
Last active January 4, 2019 21:39 — forked from abel30567/marketCapWeighted.js
Top 20 Cryptocurrency Market Cap Weighted Algorithm
const _ = require('lodash');
const request = require('request');
// Algorithm will run every 5 seconds
setInterval(() => {
// API request to Coin Market Cap for top 20 cryptocurrencies
request('https://api.coinmarketcap.com/v1/ticker/', (error, response, body) => {
const coins = JSON.parse(body);