News for hackers. Stuff that matters.
Re:Cryptocurrency trading bot in ~40 lines of JavaScript by thomasfromcdnjs on Thursday July 25, 2019 @03:55AM (#20523494)
Great to see people are interested in the tutorial.

I'd be happy to answer any questions to the best of my ability.

Re:Cryptocurrency trading bot in ~40 lines of JavaScript by uberneo on Thursday July 25, 2019 @06:12AM (#20524112)
I can see that there is no variable of "fees" which usually applies even on a LIMIT order. For example Coinbase Pro has Maker fees of 0.15%. Ideally this fees should be added to BUY order and subtracted from SELL order, as that will actually cost you.
Re:Cryptocurrency trading bot in ~40 lines of JavaScript by mercutio88 on Thursday July 25, 2019 @04:17AM (#20523580)
Cool stuff. 20% Deviation from the market price is quite high though. I suppose orders will never get a chance to execute. What would be a more realistic percentage? Could it be based on the current volatility for example? Or am I missing something.
Re:Cryptocurrency trading bot in ~40 lines of JavaScript by thomasfromcdnjs on Thursday July 25, 2019 @04:41AM (#20523694)
Yep, you are 100% correct.

This is a very naive bot, it will rarely ever execute at that margin but you will never lose either. You are just betting on the fact that hopefully someone buys out the orderbook by accident or because they really want that asset.

A more realistic margin is 0.0000001% but when you start doing that, you will start losing money so you will want a much better algorithmic trading strategy.

I will probably write a hedging tutorial next.

Re:Cryptocurrency trading bot in ~40 lines of JavaScript by mercutio88 on Thursday July 25, 2019 @04:44AM (#20523707)
the current implementation will do great on flash crashes :-)