Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is account['available'] set only once at running the script? #4

Open
Lasterie opened this issue Aug 11, 2017 · 6 comments
Open

Is account['available'] set only once at running the script? #4

Lasterie opened this issue Aug 11, 2017 · 6 comments

Comments

@Lasterie
Copy link

Lasterie commented Aug 11, 2017

I have my config set to sell 25% of my eth stash (let's say for the example: 2 ether) when a tweet matches a pattern. The first time it matched a tweet, it sold 25% of the stash: 0.5 ether. Stash value should be now 1,5 ether. Which is good. The next time it matched a tweet to sell, it tried to sell the same amount. Again 0.50 ether. That's not 25% of 1,5 ether. It should have been .375 ether.

Which led me thinking: is the account available correctly calculated each time an order is placed?

@nellore
Copy link
Owner

nellore commented Aug 11, 2017

So it's definitely retrieved again right before a rule is executed (see https://github.com/nellore/vickitrix/blob/master/vickitrix/__init__.py#L181), but your reporting this issue has me a little worried. I'll look into it before releasing the next version, probably in the next week.

Thanks.

@Lasterie
Copy link
Author

Maybe I am mistaken, but I had it configed to sell 50% of the stash and after two matched tweets, the stash was gone in whole. That shouldn't be the intended outcome, I think.

Thanks! I also sent you a little tip in the tipping jar.

@nellore
Copy link
Owner

nellore commented Aug 11, 2017

I saw, and I very much appreciate it! Thanks so much for helping with bug fixes, too.

@Lasterie
Copy link
Author

In addition to this: https://gitter.im/nellore/vickitrix?at=59914dd9614889d47546b677 , I found another example that's related to the storage of variables:

The script tried to place a sell order with more btc than I had. It also happened the other way around: it tried to place an order but didn't use the full available funds (0.00600, while 0.2 BTC was available). The 0.00600 was what was left after the trade before. So I guess something is not stored properly. When I restart the script, it works fine!

Tuesday, Aug 15, 2017 at 09:07:40 AM UTC || TWEET MATCHED || 
Tuesday, Aug 15, 2017 at 09:07:40 AM UTC || Available to trade: 0.0000000000000000 LTC, 0.0000000000000000 ETH, 0.2000000000000 BTC, 0.0000000000000 EUR
Tuesday, Aug 15, 2017 at 09:07:40 AM UTC || PLACING ORDER
{   
    "size": "0.00600",
    "type": "market",
    "side": "sell",
    "product_id": "BTC-EUR"
}
Tuesday, Aug 15, 2017 at 09:07:40 AM UTC || One of {"price", "funds", "size"} is zero! Order not placed.

@nellore
Copy link
Owner

nellore commented Aug 27, 2017

@Lasterie would you mind emailing me your rules so I can look into the issue further? anellore@gmail.com .

@Lasterie
Copy link
Author

Lasterie commented Sep 1, 2017

Done!

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

No branches or pull requests

2 participants