Giter VIP home page Giter VIP logo

Comments (20)

nellore avatar nellore commented on August 25, 2024

"The smallest order you can place for a buy or sell trade on GDAX is 0.01 BTC, ETH, or LTC," from https://support.gdax.com/customer/en/portal/articles/2426595-gdax-limits-for-deposits-withdrawals-trades-and-balances, so that particular order isn't possible. But you're right, the reported error isn't accurate, and I think the code that handles checking for this is off too. (Looking to see if one of price, funds, or size is too close to zero is wrong; it should be checking only size.) If you'd like vickitrix to attempt to place all your orders anyway, remove the if statement here: https://github.com/nellore/vickitrix/blob/master/vickitrix/__init__.py#L212 .

from vickitrix.

Lasterie avatar Lasterie commented on August 25, 2024

Thanks! I ran into another issue though. Could it be correct that Gdax requires the input for "size" to have a maximum number of decimals? I have orders placed via the script, but they don't show up in gdax. When I put "0.1" hard coded as the size (instead of {{available[BTC]}*0.1), it works.

from vickitrix.

nellore avatar nellore commented on August 25, 2024

{available[BTC}*0.1 means "how much BTC you have available to trade times 0.1"; right now, you have so little available to trade (note that limit orders you've already placed will make your BTC unavailable to trade!) that multiplying it by 0.1 gives a value < 0.01.

from vickitrix.

Lasterie avatar Lasterie commented on August 25, 2024

That makes sense, but I place an order > 0.01:

Wednesday, Aug 09, 2017 at 03:56:07 PM UTC || PLACING ORDER
{
    "size": "0.015",
    "type": "market",
    "side": "sell",
    "product_id": "BTC-EUR"
}
Wednesday, Aug 09, 2017 at 03:56:07 PM UTC || Order placed.

And the order doesn't show up on gdax.

from vickitrix.

nellore avatar nellore commented on August 25, 2024

You've placed a market order: http://www.investopedia.com/terms/m/marketorder.asp . It's executed immediately. To see what went down, click your gravatar in the upper right on GDAX, then click Fills.

from vickitrix.

Lasterie avatar Lasterie commented on August 25, 2024

Yes, I checked but the orders are not there. There is one: an order of 0.01000000. It is placed by the vickitrix script. But by hard setting the "size" to "0.01" like this. This works immediatly and I see the order get filled.

   	'side' : 'sell',
                'type' : 'market',
                'product_id' : 'BTC-EUR',
                'size' : '0.01'

Instead of this (which doens't work):

   	'side' : 'sell',
                'type' : 'market',
                'product_id' : 'BTC-EUR',
                'size' : '{available[BTC]}*0.1'

Thanks so much for your quick replies!

from vickitrix.

Lasterie avatar Lasterie commented on August 25, 2024

Quick follow-up, I even tried with a larger amount, but the market order didn't get placed:

Wednesday, Aug 09, 2017 at 04:12:30 PM UTC || PLACING ORDER
{
    "size": "0.0287318114758",
    "type": "market",
    "side": "sell",
    "product_id": "BTC-EUR"
}
Wednesday, Aug 09, 2017 at 04:12:31 PM UTC || Order placed.

from vickitrix.

Lasterie avatar Lasterie commented on August 25, 2024

When I copy/paste the size in Gdax (the website itself, not via the API), it displays this error:

https://i.imgur.com/4TxjcaH.png

"Enter a valid value. The two closest values are 0,02873181 and 0,02873182"

Which led me to think, is there a maximum number of digits?

from vickitrix.

nellore avatar nellore commented on August 25, 2024

No idea what's going on here! Maybe we can debug live in the Gitter at some point? https://gitter.im/nellore/vickitrix .

from vickitrix.

Lasterie avatar Lasterie commented on August 25, 2024

Yeah sure, can you point me to a doc with info how to setup live debugging?

from vickitrix.

Lasterie avatar Lasterie commented on August 25, 2024

I tried it with a limit order, but the issue remains: the order doesnt get placed in Gdax, while the script says it said it did:

Config:

        'orders' : [
            { 
              	'side' : 'sell',
                'price' : '{inside_ask}',
                'type' : 'limit',
                'product_id' : 'BTC-EUR',
                'size' : '{available[BTC]}*0.1'
            }

Output:

Thursday, Aug 10, 2017 at 06:39:01 AM UTC || PLACING ORDER
{
    "price": "2885",
    "size": "0.0163228137379",
    "type": "limit",
    "side": "sell",
    "product_id": "BTC-EUR"
}
Thursday, Aug 10, 2017 at 06:39:01 AM UTC || Order placed.

from vickitrix.

Lasterie avatar Lasterie commented on August 25, 2024

I even tried it without the "*0.1", so with the entire btc funds. Script said it placed the order, but it didn't make it to gdax. Again, it does work when setting the size to a fixed value like "0.1".

from vickitrix.

Lasterie avatar Lasterie commented on August 25, 2024

I found it. As I thought, the problem is the number of decimals of "size" when the order is placed. I "hacked" this into init.py on line 127 to ensure the size is of a length of maximum 7 digits.

dough[account['currency']] = (account['available'][:7]) if len(account['available']) > 7 else account['available']

Now it works, the order is placed! Question: is this the proper way to do it? (I guess not, I'm not a good developer)

from vickitrix.

nellore avatar nellore commented on August 25, 2024

Interesting! I do not think the issue is that the size must be a maximum of seven characters; if that were true, you could not for example trade more than 9999999 of a given currency at once. It is possible not more than five decimal places are permitted here. You could try

dough[account['currency']] = '{0:.5f}'.format(float(dough[account['available']]))

. I'll look into this a bit more soon.

from vickitrix.

Lasterie avatar Lasterie commented on August 25, 2024

Thanks, that's a better approach indeed! I fixed the typo (the second "currency" should be "available"), but I still get this error when I run the script:

[Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/vickitrix/__init__.py", line 596, in go
    get_dough(gdax_client, status_update=True)
  File "/usr/local/lib/python2.7/site-packages/vickitrix/__init__.py", line 127, in get_dough
    dough[account['currency']] = '{0:.5f}'.format(float(dough[account['available']]))
KeyError: u'_MYETHERBALANCE_'
]

from vickitrix.

nellore avatar nellore commented on August 25, 2024

Oh, sorry, the code shouldn't be changed there at all! Instead, try changing L195-L202 to

order[money] = '{0:.5f}'.format(float(eval(
                                    order[money].format(
                                            tweet='status.text',
                                            available=self.available,
                                            inside_bid=inside_bid,
                                            inside_ask=inside_ask
                                        )
                                )))

from vickitrix.

Lasterie avatar Lasterie commented on August 25, 2024

Thanks, tried that. The number of )))) is one too many in your last line.

from vickitrix.

nellore avatar nellore commented on August 25, 2024

Fixed! Thanks; I'll put this in the next version of vickitrix.

from vickitrix.

Lasterie avatar Lasterie commented on August 25, 2024

There's a small problem with this fix, it rounds the number to 5 decimals, but sometimes this leads to trying to sell a stack that is higher than you have. For instance:

Wednesday, Aug 16, 2017 at 02:46:21 AM UTC || Available to trade: 0.0000000000000000 LTC, 0.0000000000000000 ETH, 0.2076559273792344 BTC, 0.0000268925485000 EUR
Wednesday, Aug 16, 2017 at 02:46:22 AM UTC || PLACING ORDER
{   
    "size": "0.20766",
    "type": "market",
    "side": "sell",
    "product_id": "BTC-EUR"
}

You see that the available btc is 0.2076559273792344 but it tries to sell 0.20766, which you don't have.

from vickitrix.

razorberry avatar razorberry commented on August 25, 2024

I am having a similar problem, but i'm not sure that its down to rounding errors.

Monday, Sep 04, 2017 at 06:31:55 PM EDT || TWEET MATCHED || @Vickibotethbtc: ETH
BTC  I am going long ETHBTC #eth #ethereum
Monday, Sep 04, 2017 at 06:31:55 PM EDT || Available to trade: 0.000000000000000
0 LTC, 0.0000000000000000 ETH, 0.0050250894717000 USD, 0.0281246047054000 BTC
Monday, Sep 04, 2017 at 06:31:56 PM EDT || PLACING ORDER
{
    "price": "0.07155",
    "size": "0.0281246047054",
    "type": "limit",
    "side": "buy",
    "product_id": "ETH-BTC"
}
Monday, Sep 04, 2017 at 06:31:56 PM EDT || Order placed.
Monday, Sep 04, 2017 at 06:31:56 PM EDT || Available to trade: 0.000000000000000
0 LTC, 0.0000000000000000 ETH, 0.0050250894717000 USD, 0.0281246047054000 BTC

The size is the correct amount, but the order still didn't go through. Perhaps the limit price changed before it went through. Does gdax provide an error in this case in order to retry?

from vickitrix.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.