Glitches when live trading on Poloniex


Here are some glitches I experienced when live trading on Poloniex.

  1. Poloniex accepts only limit orders, with limits in a specified range (between 0 and 5000, apparenty irrespective of the exchange rate). It would be nice if Catalyst could automatically convert market orders into limit orders with limits far away from the current price to make sure they are filled.

  2. When ordering, Poloniex deducts the fees, and you get a warning because the amount you get is smaller than the amount you ordered.

  3. I sold an eth/btc postiion through order_target_percent(pair, 0.0), and got a remaining position of about 1e-19 eth. On my Poloniex account it shows 0. Not sure what this is due to. Is there any way to manually set the position to zero?

  4. Then the algo tried to sell the 1e-19 eth and crashed because there is a minimum order size of 0.000001. Again it would be great if Catalyst could take care of this, by ignoring orders smaller than the minimum, rather than crashing. It’s of course possible to implement this in the algo, but as everybody has to do it for every algo, it would probably be better if Catalyst was dealing with it properly.

I’ll keep updating the list if I encounter more problems.


Unfortunately, if the exchange doesn’t support an order style of a specific type (market, stop limit, etc.,), I don’t think that there would be a way to automatically submit an order using that style. My strategy has been to compute an acceptable amount of slippage that I’d allow in a trade, and set it to automatically calculate that price when submitting the order.

I have also had issues with the fees impacting the amount actually purchased. The difference between my results and yours though is that instead of having a fractional amount leftover, the blotter shows me as having a short position that is roughly the equivalent to the cost of fees, oddly enough.

Here is what I’ve tried to do to minimize issues. It hasn’t worked 100% of the time, but it has come close. When buying, instead of ordering order_target_percent, I calculate the percent manually, and order using order_target. Example:

if context.ema_buy:
limit_price = round(price * context.limit_buy_pct, 8)
buy_amount = round(cash/limit_price, 8)
order_target(, round(buy_amount, 8), limit_price=limit_price)’{}: buying {buy_amount} at {limit_price}’.format(data.current_dt, buy_amount=buy_amount, limit_price=limit_price))

I use rounding (Python 2.7) to try and get the number as precise as possible, as this seems to limit the probability of the order getting “hung up” in Catalyst. When I go to sell, I round the limit price, but I order using order_target_percent, with percent being 0. I had issues if I tried to do order_target and putting in a negative number. Also, because it would sometimes show a negative position after selling, I changed the conditions of allowing my next buy to being from having a position of 0 to a position of <= 0.

Finally, I haven’t had any luck with it in Catalyst yet, but when I used to live trade stocks using Quantopian on Robinhood, if the blotter was showing an incorrect amount in my portfolio (which it often did), I would buy a share of that stock manually, wait for the blotter to update my positions in the algo, and then sell that share, and it would usually correct itself.


Thanks for your input.

Well, a market sell order is a limit order with limit 0, and a market buy order is a limit order with limit infinity, so it would be possible to implement market orders on Poloniex. But setting a price is probably safer, indeed.

Actually, I realized my 1e-19 eth is actually a short position (which is impossible because I don’t have margin trading enabled). But that’s much smaller than the fee amount. So I’m not sure what happened. I tried to modify manually the pickled file cumulative_performance.p in the algorithm folder, but it didn’t help. So a question is where does the algorithm stores its positions?

Yes, I also solved the problem by making my algo consider positions smaller than something like 1e-6 as zero.