junta / tradingview-alert-connector

Integrating TradingView strategy alert and executing automated trading for futures DEXes
https://tv-connector.gitbook.io/docs/
MIT License
76 stars 42 forks source link

isFirstOrder error? #2

Closed nighttalker closed 1 year ago

nighttalker commented 1 year ago

Hi,

Last night, render sent me an email that said, "Your webservice [name of my dydx tradingview integration bot] has failed. Upon further investigation, render's dashboard says:

Server unhealthy Exited with status 1 while running your code.

Here's what I found in the logs:

_Nov 24 04:00:14 AM Recieved Tradingview strategy alert: { Nov 24 04:00:14 AM strategy: '1/10_UTBotStrat1HourBacktest', Nov 24 04:00:14 AM market: 'ETH_USD', Nov 24 04:00:14 AM size: '4', Nov 24 04:00:14 AM reverse: true, Nov 24 04:00:14 AM order: 'sell', Nov 24 04:00:14 AM position: 'short', Nov 24 04:00:14 AM price: '1194.6000000000001', Nov 24 04:00:14 AM passphrase: '***' Nov 24 04:00:14 AM } Nov 24 04:00:15 AM strategyData undefined Nov 24 04:00:15 AM /app/dist/services/buildOrderParams.js:5 Nov 24 04:00:15 AM function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } Nov 24 04:00:15 AM ^ Nov 24 04:00:15 AM TypeError: Cannot read properties of undefined (reading 'isFirstOrder') Nov 24 04:00:15 AM at /app/dist/services/buildOrderParams.js:48:41 Nov 24 04:00:15 AM at Generator.next () Nov 24 04:00:15 AM at fulfilled (/app/dist/services/buildOrderParams.js:5:58) Nov 24 04:00:15 AM at runMicrotasks () Nov 24 04:00:15 AM at processTicksAndRejections (node:internal/process/task_queues:96:5) Nov 24 04:00:15 AM error Command failed with exit code 1. Nov 24 04:00:15 AM info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Nov 24 04:00:17 AM yarn run v1.22.18 Nov 24 04:00:17 AM $ tsc && NODEENV=production ts-node dist/index.js Nov 24 04:00:37 AM dYdX-tradingview-integration app listening on port 10000

I'm not very familiar with coding but followed your tutorial and was able to get it running. It worked great for a while there, so I don't know if something recently changed or what's going on. I re-tested a few times and kept receiving the same error. It looks like something might be up with 'isFirstOrder'?

Just now, I tested my alerts again, but with a different alert strategy and received "Side field of tradingview alert is not correct. Must be buy or sell". This could be user error, but that would be odd as the strategy I was using for this account has remained the same with the exception of some parameters being tweaked. In other words, I haven't touched anything on the code side of things. Any help would be appreciated!

junta commented 1 year ago

Hi, for Side field error, Can you send me your alert template and log of your Tradingview strategy on Twitter or discord DM? Twitter: https://twitter.com/CryptoIbuki Discord: 0xIbuki#7462