-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathindex.js
29 lines (26 loc) · 887 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require('dotenv').config();
const Wolf = require('./modules/Wolf.js');
const config = {
tradingPair: process.env.TARGET_ASSET + process.env.BASE_ASSET,
profitPercentage: Number(process.env.PROFIT_PERCENTAGE)/100,
budget: Number(process.env.BUDGET),
compound: process.env.COMPOUND.toLowerCase() === "true",
profitLockPercentage: Number(process.env.PROFIT_LOCK_PERCENTAGE)/100,
stopLimitPercentage: Number(process.env.STOP_LIMIT_PERCENTAGE)/100
};
const wolf = new Wolf(config);
//this may not be needed anymore: https://stackoverflow.com/a/48337609/5725837
if (process.platform === 'win32') {
require('readline')
.createInterface({
input: process.stdin,
output: process.stdout
})
.on('SIGINT', function() {
process.emit('SIGINT');
});
}
process.on('SIGINT', async function() {
await wolf.kill();
process.exit(0);
});