Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules/
dist/
data.json
envfile
.env
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"semi": false
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.tabSize": 2
}
28 changes: 11 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@
## Installation

```bash
git clone https://gitlab.com/MadDeveloper/bot-warhead.git theddy
git clone https://gitlab.com/MadDeveloper/trading-bot.git theddy
cd theddy
npm install --global typescript lite-server
npm install
```

Create your API keys on the platform (binance, gdax, etc.) and export them as environment vars.
Create your API keys on the platform (binance, etc.) and export them as environment vars.
For exemple, on Linux, add to your ~/.bashrc the following lines:

```bash
export BINANCE_API_KEY=lorem
export BINANCE_API_SECRET=lorem
export BINANCE_API_PASSPHRASE=lorem
export GDAX_API_KEY=lorem
export GDAX_API_SECRET=lorem
export GDAX_API_PASSPHRASE=lorem
export BINANCE_API_KEY=
export BINANCE_API_SECRET=
export BINANCE_API_PASSPHRASE=
```

## Getting started
Expand All @@ -34,7 +30,7 @@ Or one by step:

```bash
npm run build && npm start
````
```

If you want to see in realtime the chart:

Expand All @@ -45,21 +41,19 @@ npm run chart
And then you can go to http://localhost:3000 and watch the magic happening!

## Docker

### Setup

```bash
touch envfile
touch .env
```

Then add the following lines to the envfile:
Then add the following lines to the .env file:

```bash
BINANCE_API_KEY=xxxxxx
BINANCE_API_SECRET=xxxxx
BINANCE_API_PASSPHRASE=xxxxx
GDAX_API_KEY=xxxx
GDAX_API_SECRET=xxxxx
GDAX_API_PASSPHRASE=xxxxx
```

### Build
Expand All @@ -77,11 +71,11 @@ npm run docker:build
### Run

```bash
docker run -it --env-file envfile -p 3000:3000 theddy
docker run -it --env-file .env -p 3000:3000 theddy
```

or

```bash
npm run docker:run
```
```
17 changes: 13 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
}

#myChart {
width: 99% !important;
max-height: 700px !important;
margin: 0;
padding: 0;
}
Expand Down Expand Up @@ -261,7 +259,18 @@ <h4 class="sub-heading">Next price of panic sell</h4>
}

function drawChart() {
const context = document.querySelector("#myChart").getContext('2d')
const chart = document.querySelector("#myChart")
const context = chart.getContext('2d')
const scale = window.devicePixelRatio
const width = window.innerWidth;
const height = 700;

chart.style.width = `${width}px`;
chart.style.height = `${height}px`;
chart.width = Math.floor(width * scale);
chart.height = Math.floor(height * scale);
context.scale(scale, scale);

const newChart = new Chart(context, {
type: 'scatter',
data: {
Expand Down Expand Up @@ -461,4 +470,4 @@ <h4 class="sub-heading">Next price of panic sell</h4>
</script>
</body>

</html>
</html>
Loading