jeka-kiselyov / kramjah

Crypto Trading Bot In Node.JS
https://t.me/kramjah
GNU Affero General Public License v3.0
37 stars 12 forks source link

Error when start #2

Closed cooliobr closed 2 years ago

cooliobr commented 2 years ago

Hi, i got this message when i try to start bot

info: wss://api.demo.hitbtc.com/api/3/ws/trading Initializing WebSocket connection... info: wss://api.demo.hitbtc.com/api/3/ws/trading WebSocket connection opened info: wss://api.demo.hitbtc.com/api/3/ws/trading Authing... info: wss://api.demo.hitbtc.com/api/3/ws/trading Sending request... login info: wss://api.demo.hitbtc.com/api/3/ws/trading Got error code=1004, message=Unsupported authorization method, description=api_key and secret_key required info: wss://api.demo.hitbtc.com/api/3/ws/trading Got response for: login Took 260ms info: wss://api.demo.hitbtc.com/api/3/ws/trading Authentication failure. info: wss://api.demo.hitbtc.com/api/3/ws/trading Terminating...

i have created a file with .env and keys from hitbtc.

jeka-kiselyov commented 2 years ago

Hi @cooliobr

Does your .env file has content of:

HITBTC_API_KEY=xxxxxxxxxx HITBTC_SECRET_KEY=yyyyyyyyyyy HITBTC_MODE=market

and placed in the root folder of application?

cooliobr commented 2 years ago

yes i placed at root app folder My os is OSX 11.6 ( Big Sur )

Em qua., 20 de out. de 2021 às 12:13, Jeka Kiselyov < @.***> escreveu:

Hi @cooliobr https://github.com/cooliobr

Does your .env file has content of:

HITBTC_API_KEY=xxxxxxxxxx HITBTC_SECRET_KEY=yyyyyyyyyyy HITBTC_MODE=market

and placed in the root folder of application?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jeka-kiselyov/kramjah/issues/2#issuecomment-947766814, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBIDCVWHVWDMYAXQLYMEYLUH3MB5ANCNFSM5GLVG7SQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jeka-kiselyov commented 2 years ago

@cooliobr

You instance connects to demo hitbtc server ( the one here - https://demo.hitbtc.com/ ), means it can't read even HITBTC_MODE variable from the .env file ( it's demo by default, `if (HITBTC_MODE != 'market') HITBTC_MODE = 'demo' )

Be sure there's no extra spaces or something, maybe add extra empty line after it. And I will try to push some update with better logging today, so we can diagnose this better.

cooliobr commented 2 years ago

info: Getting symbol info: BTCUSD info: API Initialization... info: API Got symbols information 1339 info: Tick size: 0.01 info: Quantity increment: 0.00001 info: Base currency: BTC info: Quote currency: USDT info: Got symbol infromation from the market: btcusd info: Restoring bids data from market... info: wss://api.hitbtc.com/api/3/ws/trading Initializing WebSocket connection... info: wss://api.hitbtc.com/api/3/ws/trading WebSocket connection opened info: wss://api.hitbtc.com/api/3/ws/trading Authing... info: wss://api.hitbtc.com/api/3/ws/trading Sending request... login info: wss://api.hitbtc.com/api/3/ws/trading Got error code=1004, message=Unsupported authorization method, description=api_key and secret_key required info: wss://api.hitbtc.com/api/3/ws/trading Got response for: login Took 249ms info: wss://api.hitbtc.com/api/3/ws/trading Authentication failure. info: wss://api.hitbtc.com/api/3/ws/trading Terminating...

same, i have tried before

Att.

Rafael Machado HALLO! Media Group. REGS IT LTDA. ANTIK Business Representative BRASIL "Believe in the future, believe in your success" "Não existe patch para a estupidez humana"

Em qua., 20 de out. de 2021 às 13:57, Jeka Kiselyov < @.***> escreveu:

@cooliobr https://github.com/cooliobr

You instance connects to demo hitbtc server ( the one here - https://demo.hitbtc.com/ ), means it can't read even HITBTC_MODE variable from the .env file ( it's demo by default, `if (HITBTC_MODE != 'market') HITBTC_MODE = 'demo' )

Be sure there's no extra spaces or something, maybe add extra empty line after it. And I will try to push some update with better logging today, so we can diagnose this better.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jeka-kiselyov/kramjah/issues/2#issuecomment-947855107, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBIDCV7GILMOUGZONM2WCTUH3YF3ANCNFSM5GLVG7SQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jeka-kiselyov commented 2 years ago

@cooliobr connects to the right server now, though. Means, HITBTC_MODE variable readed Ok. Maybe check other two ( HITBTC_API_KEY and HITBTC_SECRET_KEY ) for extra spaces?

cooliobr commented 2 years ago

i made some changes in .js files to connect in correct server

i will try latter with linux machine

Em qua., 20 de out. de 2021 às 14:10, Jeka Kiselyov < @.***> escreveu:

@cooliobr https://github.com/cooliobr connects to the right server now, though. Means, HITBTC_MODE variable readed Ok. Maybe check other two ( HITBTC_API_KEY and HITBTC_SECRET_KEY ) for extra spaces?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jeka-kiselyov/kramjah/issues/2#issuecomment-947865833, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBIDCRZHIS6B5MVD4SL7BTUH3ZZZANCNFSM5GLVG7SQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jeka-kiselyov commented 2 years ago

@cooliobr got it, I will improve logging anyway in that place.

btw, it was confirmed to work on mac (not mine though, not sure about version).

cooliobr commented 2 years ago

Brother, i reboot my mac , after this it work

Att.

Rafael Machado HALLO! Media Group. REGS IT LTDA. ANTIK Business Representative BRASIL "Believe in the future, believe in your success" "Não existe patch para a estupidez humana"

Em qua., 20 de out. de 2021 às 14:33, Jeka Kiselyov < @.***> escreveu:

@cooliobr https://github.com/cooliobr got it, I will improve logging anyway in that place.

btw, it was confirmed to work on mac (not mine though, not sure about version).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jeka-kiselyov/kramjah/issues/2#issuecomment-947887650, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBIDCVA3CQYXM2ZD3SWYXDUH34ORANCNFSM5GLVG7SQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jeka-kiselyov commented 2 years ago

Cool. @cooliobr

Good luck with trading. Don't forget to be careful with trading settings.

cooliobr commented 2 years ago

Thanks... You have any good strategy ? pair SHIB-USDT or SHIB-BTC or any other.

jeka-kiselyov commented 2 years ago

@cooliobr actually, to start, I'd prefer something classic around eth-btc-usdt or something from top 5. Much less stress, as it's less volatile, and somehow ok to stay with coins even if price goes down too much.

But feel free to play with strategy on historical data ( with flashback command) on your pairs. I don't have something I can recommend to be successful on all cases.

cooliobr commented 2 years ago

i try for some hours and no orders make, what i do wrong ? i put btc-usdt, can you help my with any strategy ?

Att.

Rafael Machado HALLO! Media Group. REGS IT LTDA. ANTIK Business Representative BRASIL "Believe in the future, believe in your success" "Não existe patch para a estupidez humana"

Em qua., 20 de out. de 2021 às 16:11, Jeka Kiselyov < @.***> escreveu:

@cooliobr https://github.com/cooliobr actually, to start, I'd prefer something classic around eth-btc-usdt or something from top 5. Much less stress, as it's less volatile, and somehow ok to stay with coins even if price goes down too much.

But feel free to play with strategy on historical data ( with flashback command) on your pairs. I don't have something I can recommend to be successful on all cases.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jeka-kiselyov/kramjah/issues/2#issuecomment-947959504, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBIDCVZWQM5KXB3VGE3GKTUH4H7JANCNFSM5GLVG7SQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jeka-kiselyov commented 2 years ago

Default strategy posts buy orders when price goes down.

You can comment out this lines:


        if (shiftsPast[0] > -0.5 || shiftsPast[1] > -0.5) {
            // do not add any buy bids if price is rising in last 2 hours
            //
            return;
        }

in Simple.js, and it will create buy orders right after starting