dscotese / kraken-grid

A bot that extends grid trading once you use it to create a grid.
GNU General Public License v3.0
9 stars 3 forks source link

Dropping prices should cause smaller trades. #33

Open dscotese opened 1 year ago

dscotese commented 1 year ago

6 described an issue and a solution which involved solving another issue first and I closed it. This is the promised replacement and a proposal on how to make a lower overall account value (from the bot's perspective) translate into smaller trades at lower prices.

One of my concerns is generating too much traffic, clogging both your ISP and Kraken's ISP with new orders and cancellations. Since prices are changing all the time, what we should do instead of constantly cancelling and recreating trades with slightly different prices, is to make a best guess. There is already code in balancer.js (buyAndSell function) which sums up the portion of the users savings that the user wants in crypto (cryptp) so that the balancer can create trades that would be needed if the entire crypto market goes up or down, which is pretty close to what happens. This is how I imagine the best guess should be calculated. At some point, it might be worthwhile to add something that allows the user to specify that the bot should assume some additional mathematical relationship between the prices of some of their assets and the prices of other of assets. For now, if it ever seems useful, I will only implement code to assume that if the price of a crypto goes up or down far enough to justify a trade, the prices of the other cryptos will also have done about the same thing.

This issue is very low priority.