urketadic / mirror_trader

Bot will copy trades from main account to all your other accounts on crypto exchanges (Binance, Bitmex, Bybit, Deribit)
https://www.deficlerk.com/
9 stars 10 forks source link

error when launching the app #3

Open tranceporter opened 3 years ago

tranceporter commented 3 years ago

Hi,

When I run cd admin && npm start, I get the following error:

root@ip-172-31-26-226:/home/ubuntu/mirror_trader-master# cd admin && npm start npm ERR! Linux 5.4.0-1032-aws npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start" npm ERR! node v8.10.0 npm ERR! npm v3.5.2

npm ERR! missing script: start npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request: npm ERR! /home/ubuntu/mirror_trader-master/admin/npm-debug.log

Also googling a bit, one of the alternative was the navigate to admin folder, and run "node app.js". Doing so, gives this error

root@ip-172-31-26-226:/home/ubuntu/mirror_trader-master/admin# node app.js Server Booted on http://localhost:3000 /home/ubuntu/mirror_trader-master/admin/modules/app_process.js:247 if(err) throw err; ^

Error: ENOENT: no such file or directory, open '/home/ubuntu/mirror_trader-master/admin/modules/../../engine/binance/console_messages.txt'

Looks like absolute path lookup issue. What am I doing wrong?

Thanks, Shreyas

tranceporter commented 3 years ago

Probably need to use this instead in app_process.js (start function)

let reqPath = path.join(__dirname, '../../engine/${exchange}/console_messages.txt')

tranceporter commented 3 years ago

ok made a lot of progress. I believe I am nearly there now. A couple of things. Order_new and Order_cancel are deprecated and replaced with Order_newV2 and Order_cancelV2. However, now I am getting this error when I open a position on master account

root@ip-172-31-26-226:/home/ubuntu/mirror_trader-master/admin# node app.js Server Booted on http://localhost:3000 /settings/turn_on_bybit/ [ '/home/ubuntu/mirror_trader-master/engine/bybit/main_bybit.py' ] child process exited with code 0

tranceporter commented 3 years ago

ok, more info

I am opening a 1 contract log on Bybit for btcusd. The order is being picked up by the bot, but it now throws a json parse error

New order detected! w Param validation for 'qty' failed on the 'required' tag Exiting...

tranceporter commented 3 years ago

ok. so was able to get it all working, Couple of points. Code seems to have sys.exit() for Bybit where order has been copied and "ok" status is returned. This means after the first round of orders have been copied successfully, the bot stops monitoring. I have commented out that sys.exit() to keep it running forever.

Secondly, I was getting the above quantity error due to this line:

to_qty=str(int(to_usd_balance*from_percent))

Essentially, if the position size is less than 1x of the balance, then I am speculating that the to_qty becomes 0. I am going to try with 1x balance and see what happens.

tranceporter commented 3 years ago

yup, all working if position is 1x of balance. One last thing. I am getting 10-15 second lag in mirroring orders for Bybit. For new order it copies in 5-6 seconds, but if I market close the position on master account, it takes 15-20 seconds for tthe position to be market closed on Bybit slave account, Is this normal?

urketadic commented 3 years ago

Bitmex,Binance and Deribit work much better and transactions are instant, less than a second. Only problem is Bitmex market orders recently got broken, maybe the API got outdated, I will check.

Bybit was always laggy and bit buggy. I will see if I can improve it. The solution to the first error you got is just creating console_messages.txt in binance folder. The error message is telling you this file is missing.

Thank you for all the feedback.

tranceporter commented 3 years ago

Thank you. I would change the code to use Order_NewV2 and Order_CancelV2. Not sure if any of the others have changed. Yeah seems Bybit is laggy, which sucks.

tranceporter commented 3 years ago

Ok so today after leaving the bot running for a few days, I got this error. Looks like I will need to switch to some endpoint.

1DD18B1A-8433-4542-8CA3-10D9764F1F0D

lm742611149 commented 2 years ago

Ok so today after leaving the bot running for a few days, I got this error. Looks like I will need to switch to some endpoint.

1DD18B1A-8433-4542-8CA3-10D9764F1F0D

Hi, I have met the same "start" script error. Can you please upload your new code to a new branch? I'm not sure how to handle it. @tranceporter @urketadic

Thanks