Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Bittrex Exchange #1215

Merged
merged 13 commits into from
Jan 24, 2018
Merged

Bittrex Exchange #1215

merged 13 commits into from
Jan 24, 2018

Conversation

station384
Copy link
Contributor

@station384 station384 commented Jan 24, 2018

Correction for #1211, #1170, #1164
Updated bittrex api from node.bittrex.api -> node-bittrex-api

node.bittrex.api is no longer maintained

Added some error handling so exchange is now passing back useful errors
to the engine.
i.e. it will no longer keep retrying a buy sell order if there isn’t
enough funds.

socket errors no longer crash the system but passed to the retry
handler.

npm must be updated.
npm install node-bittrex-api

After these corrections it eliminated the errors cited in #1211.

Unintentional corrections: (I like these :)
Errors now passed back to engine.js for proper handling
Orders will now readjust price ( old versions was silently failing )

station384 and others added 11 commits January 21, 2018 12:26
* Fix SRSI calculation

* Added test case for SRSI. Switched RSI and SRSI output to float and adjusted display accordingly

* Oops, disabled all other tests by mistake

* Fix test assertion
This fixes the error `/usr/bin/env: ‘node\r’: No such file or directory`
Report is now able to display values less than 1.  space limited to 7
characters per column so smallest value is 0.00001
Updated bittrex api from node.bittrex.api -> node-bittrex-api

node.bittrex.api is no longer maintained

Added some error handling so exchange is now passing back useful errors
to the engine.
i.e.  it will no longer keep retrying a buy sell order if there isn’t
enough funds.

socket errors no longer crash the system but passed to the retry
handler.
var bittrex_authed = require('node-bittrex-api'),
bittrex_public = require('node-bittrex-api'),
moment = require('moment'),
n = require('numbro')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indenting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is formatted according the the setting in .eslintrc.
I'll manually format it.

moment = require('moment'),
n = require('numbro'),
colors = require('colors')
var bittrex_authed = require('node-bittrex-api'),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure. The market history on bittrex is very limited. It will pull only the last couple of trades. there is a workaround that someone came up with using the v2 api that seems to get around this limitation, I'll look at implementing it. hate having to leave a marking noop trading for days to get a decent history on.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just double checked this moving to forward causes
on markets I already have data on
error: getTrades() returned duplicate results
{ product_id: 'XRP-USDT', to: 1516785694047 }
{ product_id: 'XRP-USDT', to: 1516785694047 }
it returns nothing on markets I don't have data on.

So for now, I think it should remain as backward until I can looking into the history calls in bittrex.

if(!data.success) {
if (data.message && data.message.match(recoverableErrors)) {
if ( data.message && data.message.match(recoverableErrors)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: unnecessary whitespace

@station384
Copy link
Contributor Author

will correct in a few.

remove white space,  a debug property, and extra lines.
@station384
Copy link
Contributor Author

@DeviaVir, it looks like I got all the corrections for formatting.

The history part is just broken due to the api, and the way bittrex returns market data.
I'll look at that later today and see if I can implement the a possible fix mentioned in #499.

I would also like to convert this to using websockets but that is for a later date.

@DeviaVir
Copy link
Owner

SGTM I will merge this now so we can look at the other additions fresh.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants