Interested in Crypto Trading? Maybe you have just found the quickest way how to lose all investment with cool automatic way!
The bot use 2 APIs:
- Binance API for trading
- Taapi API for getting various Trade indicators
Evaluation of Trade indicator is handled each 1 minute. See index.js cron rule.
- Check the Trade Indicator
- Check Wallet
- Get strategy based on actual Portfolio and Trade Indicator
- Trade based on strategy
The current value of selected indicator. It comes from Taapi.
Using https://taapi.io/ to get indicators like RSI, Fibonacci Retracement, ... See documentation for all supported indicators https://taapi.io/indicators/
Calls Binance to check wallet to optimize strategy.
{
"crypto": {
"symbol": "DOT",
"value": 1.01,
"estimateStable": 37.0001,
"askPrice": 37.73,
"bidPrice": 37.71,
},
"stable": {
"symbol": "BUSD",
"value": 63.0009,
"estimateCrypto": 1.692722425074527
},
"fee": {
"symbol": "BNB",
"value": 0.00383236
},
"total": {
"estimate": 100.001
}
}
Check the actual porfolio. Apply the defined strategy. Feel free to play with strategy. See strategy.js
const getStrategy = (indicator, wallet) => {
// code own strategy
// amonut is always value in stable coin eg. BUSD
// return { action: 'SELL', amount: 20};
// return { action: 'BUY', amount: 20};
// return { action: 'WAIT', amount: 20};
}
Using Binance API to open trades.
Please notice there is used 'MARKET' ORDER which might be considered as risky.
-
Install (setup once)
-
Rename .env-sample to .env and SET API KEYs (setup once)
- TAAPI Free api key
- BINANCE -> Profile -> API management. Ensure binance key have rights to set trade (Enable Spot & Margin Trading, Enable Reading)
- CRYPTO - crypto what you want to trade
- STABLE - stable coin you want to use. Notice the binance must suppot trade crypto with selected stable coin
- INDICATOR - trending strategy, see taapi for available indicators
- INTERVAL - interval applied to indicator
-
Ensure you have (setup once)
- CRYPTO or STABLE coin in wallet
- fraction of BNB coin for cheaper transaction fees
TAAPI_API_KEY=[your taapi api key]
BINANCE_API_KEY=[your binance api key]
BINANCE_SECREY_KEY=[your binance secrey key]
CRYPTO=DOT
STABLE=BUSD
INDICATOR=rsi
INTERVAL=30m
- Install (setup once) Run in project folder.
yarn install
- Start the trade bot (each time you wisth to start bot) Run in project folder.
Start trading
yarn start-backend
Start UI to see data generated from backend
yarn start-frontend
Logs from backend are collected in different places
- Trade logs are collected in frontend/src/data/trade-YYYY-MM-DD.log
- Warning logs are collected in backend/warning.log
- Error logs are collected in backend/error.log
pm2 start yarn --name trade-bot-trader -- start -- pm2 start yarn --name trade-bot-ui-backend -- start -- pm2 start yarn --name trade-bot-ui-frontend -- start -- pm2 save
Q1. I am getting "Timestamp for this request was 1000ms ahead of the server's time.".
A: Ensure your time is in sync. Try to synchronize your time manually.
- Right click on windows clocks
- Select "Adjust date/time"
- Ensure you have enabled both "Set time automatically" and "Set time zone automatically"
- Press "Sync now"
- Check if error disapear
It it helps I recommend update windows registry to sync time more often.
This will set to sync time each 17min (1020 seconds)
- Open Regedit
- Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient
- Adjust value SpecialPollInterval to 1020 as Decimal Value
Q2. I do not recieve value of indicator.
A:
- Please ensure you have correct TAAPI key in .env file
- I have notices from time to time TAAPI have issues and do not sent correct response. This is usually fixed by TAAPI and it start to work normally in few minutes.