Skip to content

Instantly share code, notes, and snippets.

@micheleberardi
Last active November 9, 2021 00:48
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 micheleberardi/fa5b65e1a3f6d2c7a3fe9780501bd720 to your computer and use it in GitHub Desktop.
Save micheleberardi/fa5b65e1a3f6d2c7a3fe9780501bd720 to your computer and use it in GitHub Desktop.
BadxMMy
<script type="text/javascript" src="https://unpkg.com/lightweight-charts@3.4.0/dist/lightweight-charts.standalone.production.js"></script>
(async () => {
const chart = LightweightCharts.createChart(document.body, {
width: 600,
height: 300,
layout: {
backgroundColor: "#000000",
textColor: "rgba(255, 255, 255, 0.9)"
},
grid: {
vertLines: {
color: "rgba(197, 203, 206, 0.5)"
},
horzLines: {
color: "rgba(197, 203, 206, 0.5)"
}
},
crosshair: {
mode: LightweightCharts.CrosshairMode.Normal
},
rightPriceScale: {
borderColor: "rgba(197, 203, 206, 0.8)"
},
timeScale: {
borderColor: "rgba(197, 203, 206, 0.8)"
}
});
const candleSeries = chart.addCandlestickSeries({
upColor: "rgba(255, 144, 0, 1)",
downColor: "#000",
borderDownColor: "rgba(255, 144, 0, 1)",
borderUpColor: "rgba(255, 144, 0, 1)",
wickDownColor: "rgba(255, 144, 0, 1)",
wickUpColor: "rgba(255, 144, 0, 1)"
});
const response = await fetch("https://api.cryptomike.io/v1.0/api/td?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9&ticker=tsla");
const data = await response.json();
console.log(data);
candleSeries.setData(data);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment