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

Added cryptsy and the ability to do trade-percentage in the config file. #200

Closed
wants to merge 13 commits into from

Conversation

mlmurray
Copy link

@mlmurray mlmurray commented Feb 9, 2014

Added in two features:

  1. Cryptsy support. It's not the prettiest (as I'm not a great NodeJS guy), but it seems to work in my testing. I also didn't add in all of the various markets or their minimum values.
  2. tradePercentage: I wanted to have the ability to say "please don't trade away everything" in the config file. That now calculates in the portfolio manager before a trade is executed.

@askmike
Copy link
Owner

askmike commented Feb 9, 2014

Woah amazing work, will definitely look at this asap. Thanks!

Two notes:

  • Your percent calculation always takes a percent of the available fund, instead of a percent of the whole portfolio. So if you say 10%, have ฿1 (currently worth ~$700) and $5, and Gekko will advice to go long, it will buy ฿ for $0.50 (not saying this behaviour is bad, but we should have extremely clear docs describing precise behaviour).
  • We need to put Cryptsy support in the docs. I can also do this myself.

Michael Murray added 3 commits February 9, 2014 11:40
More debug statements to try and find out WTF is going on with the
parser error that keeps crashing the bot.

Also, added a small hack to make Cryptsy orders complete more
effectively.
@mlmurray
Copy link
Author

Mike - glad you liked. Code is messy and I'm still finding bugs.

A question - What is "weird error 2"? I can't quite figure out what min
and max are there.

On Sun, Feb 9, 2014 at 5:34 AM, Mike van Rossum notifications@github.comwrote:

Woah amazing work, will definitely look at this asap. Thanks!

Two notes:

  • Your percent calculation always takes a percent of the available
    fund, instead of a percent of the whole portfolio. So if you say 10%, have
    ฿1 (currently worth ~$700) and $5, and Gekko will advice to go long, it
    will buy ฿ for $0.50 (not saying this behaviour is bad, but we should have
    extremely clear docs describing precise behaviour).
  • We need to put Cryptsy support in the docs. I can also do this
    myself.


Reply to this email directly or view it on GitHubhttps://github.com//pull/200#issuecomment-34573861
.

Mike Murray
http://www.episteme.ca
Phone - 702-582-8428

Twitter - @mmurray http://www.twitter.com/mmurray
Facebook - michael.l.murray http://www.facebook.com/michael.l.murray
LinkedIn - mikemurray http://www.linkedin.com/in/mikemurray

@mlmurray
Copy link
Author

And I'm still confused/curious about the trade percent thing. On line
136, it calculates:

    amount = this.getBalance(this.currency) / this.ticker.ask;

Then, I'm taking a percentage of that on line

  if(this.tradePercent)
    amount = amount * this.tradePercent / 100;

So, in the example, wouldn't it figure out the amount as $5 / { price of
BTC }, and then I'd multiply that by some percentage (e.g. 70%) so that
we're purchasing $3.50 / { price of BTC }? Or did I do that wrong?

On Sun, Feb 9, 2014 at 5:29 PM, Mike Murray mmurray@episteme.ca wrote:

Mike - glad you liked. Code is messy and I'm still finding bugs.

A question - What is "weird error 2"? I can't quite figure out what min
and max are there.

On Sun, Feb 9, 2014 at 5:34 AM, Mike van Rossum notifications@github.comwrote:

Woah amazing work, will definitely look at this asap. Thanks!

Two notes:

  • Your percent calculation always takes a percent of the available
    fund, instead of a percent of the whole portfolio. So if you say 10%, have
    ฿1 (currently worth ~$700) and $5, and Gekko will advice to go long, it
    will buy ฿ for $0.50 (not saying this behaviour is bad, but we should have
    extremely clear docs describing precise behaviour).
  • We need to put Cryptsy support in the docs. I can also do this
    myself.


Reply to this email directly or view it on GitHubhttps://github.com//pull/200#issuecomment-34573861
.

Mike Murray
http://www.episteme.ca
Phone - 702-582-8428

Twitter - @mmurray http://www.twitter.com/mmurray
Facebook - michael.l.murray http://www.facebook.com/michael.l.murray
LinkedIn - mikemurray http://www.linkedin.com/in/mikemurray

Mike Murray
http://www.episteme.ca
Phone - 702-582-8428

Twitter - @mmurray http://www.twitter.com/mmurray
Facebook - michael.l.murray http://www.facebook.com/michael.l.murray
LinkedIn - mikemurray http://www.linkedin.com/in/mikemurray

@askmike
Copy link
Owner

askmike commented Feb 10, 2014

A question - What is "weird error 2"? I can't quite figure out what min and max are there.

That error is haunting me from deep into an old and messy part of the codebase. Refactoring that code is high on my todo list. Is it bothering you a lot or did it happen once? That error is thrown when the order of non empty candles is wrong, something which should never happen.

So, in the example, wouldn't it figure out the amount as $5 / { price of BTC }, and then I'd multiply that by some percentage (e.g. 70%) so that we're purchasing $3.50 / { price of BTC }? Or did I do that wrong?

Yes it appears that is exactly what would happen (have to test it myself), though when I read about the percentage option I was assuming you meant it like a percentage of all your funds, not just the one you are looking at now. A lot of people requested a way for Gekko to only trade with a small part of all funds, and I'm still not 100% sure that your proposal does that (by only looking at the USD for example instead of all funds).

@mlmurray
Copy link
Author

Figured it out - I was playing with the order of some trades and I screwed
up something.

Yes it appears that is exactly what would happen (have to test it myself),
though when I read about the percentage option I was assuming you meant it
like a percentage of all your funds, not just the one you are looking at
now. A lot of people requested a way for Gekko to only trade with a small
part of all funds, and I'm still not 100% sure that your proposal does that
(by only looking at the USD for example instead of all funds).

It would even out to that in the end. Think about it this way... imagine
if you start with a 70% Percentage and you have this:

Mike Murray
http://www.episteme.ca
Phone - 702-582-8428

Twitter - @mmurray http://www.twitter.com/mmurray
Facebook - michael.l.murray http://www.facebook.com/michael.l.murray
LinkedIn - mikemurray http://www.linkedin.com/in/mikemurray

@mlmurray
Copy link
Author

Sent too soon. Grr. I worked out a spreadsheet that shows that you end up
oscillating and basically buying or selling 70% of the asset base at any
given time. But even I found it confusing.

Also - it's harder to do the whole asset base - imagine if I started with a
portfolio that's 50% BTC, 50% USD, but wanted to buy 70% of my assets in
BTC... it would mean I'd have to sell a bunch of BTC first.

On Mon, Feb 10, 2014 at 1:53 PM, Mike Murray mmurray@episteme.ca wrote:

Figured it out - I was playing with the order of some trades and I screwed
up something.

Yes it appears that is exactly what would happen (have to test it
myself), though when I read about the percentage option I was assuming you
meant it like a percentage of all your funds, not just the one you are
looking at now. A lot of people requested a way for Gekko to only trade
with a small part of all funds, and I'm still not 100% sure that your
proposal does that (by only looking at the USD for example instead of all
funds).

It would even out to that in the end. Think about it this way... imagine
if you start with a 70% Percentage and you have this:

Mike Murray
http://www.episteme.ca
Phone - 702-582-8428

Twitter - @mmurray http://www.twitter.com/mmurray
Facebook - michael.l.murray http://www.facebook.com/michael.l.murray
LinkedIn - mikemurray http://www.linkedin.com/in/mikemurray

Mike Murray
http://www.episteme.ca
Phone - 702-582-8428

Twitter - @mmurray http://www.twitter.com/mmurray
Facebook - michael.l.murray http://www.facebook.com/michael.l.murray
LinkedIn - mikemurray http://www.linkedin.com/in/mikemurray

@askmike askmike closed this Feb 12, 2014
@askmike
Copy link
Owner

askmike commented Feb 12, 2014

I think it says I closed because I deleted the localDB branch (merged into master), I am looking at this!

Edit: can't reopen but I'll cherrypick all these commits myself.

@PaulNokel
Copy link

Hi,
i am interested in the cryptsy integration. Are you planning to merge this commits? Do you have an rough time plan?

@askmike
Copy link
Owner

askmike commented Mar 7, 2014

@KuchenKerze pretty busy at the moment, the timescale looks like this:

  • candle manager rewrite (almost done), which fixes a lot of quirky behaviour (check issues).
  • cryptsy
  • TAlib

Note that I am doing all of that alone and I am working on other projects as well so I can't give any ETA.

@christopherdebeer
Copy link

@askmike need help?

@wupeng1211
Copy link
Contributor

Please add btcchina, thanks
On Mar 20, 2014 1:27 AM, "Christopher de Beer" notifications@github.com
wrote:

@askmike https://github.com/askmike need help?


Reply to this email directly or view it on GitHubhttps://github.com//pull/200#issuecomment-38081426
.

@0x3W
Copy link

0x3W commented Apr 6, 2014

So is cryptsy supported on master branch?

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.

6 participants