Browse Source

Add trade origin to chart

develop
mark-sch 2 years ago
parent
commit
3a22c9d0a7
2 changed files with 10 additions and 3 deletions
  1. +9
    -2
      chart.html
  2. +1
    -1
      package-lock.json

+ 9
- 2
chart.html View File

@ -3,6 +3,8 @@
The component is ONLY free of charge for non-profit/personal use.
For further details or for buying a commercial license, visit the vendor
website: https://shop.highsoft.com/highcharts/
http://jsfiddle.net/tvpcwLj9/
-->
<html>
@ -30,10 +32,15 @@
for (let i=0; i < tradeLength; i += 1) {
let isBuy = data.trades[i].action === 'buy' ? true : false;
let txt = `
Trade: ${data.trades[i].action.toUpperCase()} <br/><br/>
Price: ${data.trades[i].price}
`;
if (data.trades[i].origin !== undefined) txt += '<br/><br/>Origin: ' + data.trades[i].origin
trades.push({
x: data.trades[i].date*1000, // the date
title: isBuy ? 'B' : 'S',
text: 'Trade: ' + data.trades[i].action.toUpperCase() + '<br/><br/>Price: ' + data.trades[i].price + '',
text: txt,
color: isBuy ? 'green' : 'red',
fillColor: isBuy ? 'green' : 'red',
stackDistance: isBuy ? 50 : 25,
@ -270,4 +277,4 @@
});
</script>
</body>
</html>
</html>

+ 1
- 1
package-lock.json View File

@ -1,6 +1,6 @@
{
"name": "gekko",
"version": "2019.0.68.234",
"version": "2019.0.68.255",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

Loading…
Cancel
Save