You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will make a good unit test even if it was a one-time occurrence:
Have some open trades which create a grid.
Test that the balance command will create two trades. Sometimes, it (correctly!) says we are too far out of balance.
You can use the file cached.json and process.USECACHE='must' to prevent getting data from the exchange. Ensure that it returns a price which requires a trade to achieve balance according to your allocation.
The bot places trades above and below the current price by adding or subtracting the tolerance. Since we aren't currently in balance, it then figures out how much to trade at the current price, creates an order for it with a conditional close, and sets the price for the conditional close to match whichever trade is on the same side. This will cause the order resulting from execution of the balancing trade to be combined with one of the two other orders. If the order is larger than the side it will be added to, note that the trade made on that side would require to be made with a negative amount. This is what "We're too far out of balance" means.
Execute the balance command so that it deletes all existing trades and creates the three new trades.
Wait until the trade at the current price is executed (and produces the conditional close) and then issue report (or just hit enter) to see if the bot combines the new order with one of the existing ones. That's what failed for me, but after restarting the bot, it combined the orders just fine.
The text was updated successfully, but these errors were encountered:
This will make a good unit test even if it was a one-time occurrence:
The text was updated successfully, but these errors were encountered: