Haehnchen / crypto-trading-bot

Cryptocurrency trading bot in javascript for Bitfinex, Bitmex, Binance, Bybit ... (public edition)
MIT License
3.1k stars 979 forks source link

Ticker no found #260

Open kangoulya opened 3 years ago

kangoulya commented 3 years ago

Aloha, I'm trying it on binance futures coin,

c.init = () => { return new Promise(resolve => { require('request')('https://dapi.binance.com/dapi/v1/exchangeInfo', (error, response, body) => { let z = [ 'ADAUSD', 'BCHUSD', 'BNBUSD', 'BTCUSD', 'DOGEUSD', 'DOTUSD', 'EGLDUSD', 'EOSUSD', 'ETCUSD', 'ETHUSD', 'FILUSD', 'LINKUSD', 'LTCUSD', 'LUNAUSD', 'SOLUSD', 'THETAUSD', 'TRXUSD', 'UNIUSD', 'XLMUSD', 'XRPUSD' ] z.forEach((pair) => { c.symbols.push({ 'symbol': pair, 'exchange': 'binance', 'periods': ['1m', '15m', '1h', '4h'], 'trade': { 'currency_capital': 1, 'strategies': [ { 'strategy': 'dca_dipper', 'options': { 'period': '15m', 'amount_currency': '2', 'percent_below_price': 0.1, 'hma_period': 9, 'hma_source': 'close' } }, { 'strategy': 'dip_catcher', 'options': { 'period': '15m', 'trend_cloud_multiplier': 4, 'hma_high_period': 9, 'hma_high_candle_source': 'close', 'hma_low_period': 9, 'hma_low_candle_source': 'close' } } ] }, 'watchdogs': [ { 'name': 'risk_reward_ratio', 'target_percent': 3.1, 'stop_percent': 1.6 } ] }) }) resolve() }) }) }

But Ticker no found :

crypto-trading-bot | Ticker no found for + binance_futuresETHUSD
crypto-trading-bot | Ticker no found for + binance_futuresFILUSD crypto-trading-bot | Ticker no found for + binance_futuresLUNAUSD
crypto-trading-bot | Ticker no found for + binance_futuresFILUSD crypto-trading-bot | Ticker no found for + binance_futuresDOTUSD
crypto-trading-bot | Ticker no found for + binance_futuresXRPUSD crypto-trading-bot | Ticker no found for + binance_futuresLTCUSD
crypto-trading-bot | Ticker no found for + binance_futuresUNIUSD crypto-trading-bot | Ticker no found for + binance_futuresLUNAUSD
crypto-trading-bot | Ticker no found for + binance_futuresLTCUSD crypto-trading-bot | Ticker no found for + binance_futuresXRPUSD
crypto-trading-bot | Ticker no found for + binance_futuresSOLUSD crypto-trading-bot | Ticker no found for + binance_futuresUNIUSD
crypto-trading-bot | Ticker no found for + binance_futuresDOGEUSD crypto-trading-bot | Ticker no found for + binance_futuresEGLDUSD
crypto-trading-bot | Ticker no found for + binance_futuresEOSUSD crypto-trading-bot | Ticker no found for + binance_futuresBTCUSD
crypto-trading-bot | Ticker no found for + binance_futuresBCHUSD crypto-trading-bot | Ticker no found for + binance_futuresBNBUSD
crypto-trading-bot | Ticker no found for + binance_futuresETHUSD crypto-trading-bot | Ticker no found for + binance_futuresEOSUSD
crypto-trading-bot | Ticker no found for + binance_futuresLINKUSD crypto-trading-bot | Ticker no found for + binance_futuresLINKUSD
crypto-trading-bot | Ticker no found for + binance_futuresXLMUSD

thematz1 commented 3 years ago

I also get this error on spot, but with some slight differences.

crypto-trading-bot | {"message":"Stoploss Watcher: no entry for position: {\"symbol\":\"BTCBUSD\",\"side\":\"long\",\"amount\":0.00000664,\"updatedAt\":\"2021-09-24T22:01:03.724Z\"}","level":"error","timestamp":"2021-09-24T22:01:03.813Z"} crypto-trading-bot | {"message":"Stoploss Watcher: no entry for position: {\"symbol\":\"ETHBUSD\",\"side\":\"long\",\"amount\":0.0000616,\"updatedAt\":\"2021-09-24T22:01:03.724Z\"}","level":"error","timestamp":"2021-09-24T22:01:03.826Z"} crypto-trading-bot | {"message":"Stoploss Watcher: no entry for position: {\"symbol\":\"BNBBUSD\",\"side\":\"long\",\"amount\":0.0000229,\"updatedAt\":\"2021-09-24T22:01:03.724Z\"}","level":"error","timestamp":"2021-09-24T22:01:03.837Z"} crypto-trading-bot | {"message":"Stoploss Watcher: no entry for position: {\"symbol\":\"ZILBUSD\",\"side\":\"long\",\"amount\":0.0256,\"updatedAt\":\"2021-09-24T22:01:03.724Z\"}","level":"error","timestamp":"2021-09-24T22:01:03.846Z"} crypto-trading-bot | {"message":"Stoploss Watcher: no entry for position: {\"symbol\":\"VETBUSD\",\"side\":\"long\",\"amount\":0.0657,\"updatedAt\":\"2021-09-24T22:01:03.724Z\"}","level":"error","timestamp":"2021-09-24T22:01:03.859Z"} crypto-trading-bot | {"message":"Binance: order create error: -1100","level":"error","timestamp":"2021-09-24T22:01:04.087Z"} crypto-trading-bot | {"message":"Binance: order create error: -1100","level":"error","timestamp":"2021-09-24T22:01:04.100Z"} crypto-trading-bot | {"message":"Binance: order create error: -1100","level":"error","timestamp":"2021-09-24T22:01:04.112Z"} crypto-trading-bot | {"message":"Binance: order create error: -1100","level":"error","timestamp":"2021-09-24T22:01:04.127Z"} crypto-trading-bot | {"message":"Binance: order create error: -1100","level":"error","timestamp":"2021-09-24T22:01:04.139Z"} crypto-trading-bot | Ticker no found for + binanceZILBUSD crypto-trading-bot | Ticker no found for + binanceBTCBUSD crypto-trading-bot | Ticker no found for + binanceADABUSD crypto-trading-bot | Ticker no found for + binanceETHBUSD crypto-trading-bot | Ticker no found for + binanceBNBBUSD crypto-trading-bot | Ticker no found for + binanceVETBUSD

Within the dashboard it does not show the 24h ticker Screen Shot 2021-09-24 at 6 02 30 PM

So far, I have tried:

Further, the app loads with active positions that are not listed in the trades section. These positions are impossible to close because there are no orders for them or funds of the currency being sold that available in the account.

I have checked the db files and they seem half working, there is data in candlesticks and logs tables and not the signals, ticker, ticker_log and candlestick_log tables. I can't seem to find where positions are stored without looking into the code.

If I find anything I will update my post. If anyone could help, it would be greatly appreciated.

thematz1 commented 3 years ago

I have found that shifting money in my account fixes the open positions issue i was having. Ensuring that there is none of a specific currency when there should be no open position fixes one of the issues noted above.

It seems the dayCandles in the ta.js file is not finding anything that matches the timestamp criteria. Perhaps there is a missing backfill at startup. When removing the minimum or maximum filter which look to grab candlesticks from 24h behind it will begin to display a number, however that number does not match that of the exchange without the filter on both ends.

I have found that the issue is resolved when running the dashboard config with a shorter interval. The account needs to have only funds in the base currency, and some time must pass to populate the database in order for the dayCandles to find any candlesticks that meet the criteria needed to calculate a 24h change.

I have tried backtesting to see if that would fill the database but there was no change. I will leave it running for some time and hopefully enough candlesticks are stored to start displaying a ticker before any open positions are taken.

thematz1 commented 3 years ago

The error goes away after some time running while the database populates.