bbgo icon indicating copy to clipboard operation
bbgo copied to clipboard

Trading non-USDT pairs.

Open arthurwolf opened this issue 2 years ago • 4 comments

What happens if I want to trade non-USDT pairs? Like, trading ETH-BTC for example?

The PNL report presumes we are trading USDT (or even just USD?) Reading the code, I can even see places where there are things that look like if ( [...] == "USDT" ) so no other possible pairing is possible apparently.

Is there some recommendation on how to handle trading non-USDT pairs?

Thanks!

arthurwolf avatar Dec 04 '21 17:12 arthurwolf

I used it to trade with XRPBTC , it seems working , only seems weird in the report part.

tony1223 avatar Dec 05 '21 01:12 tony1223

for stable coin pairs, should have no big influence.

zenixls2 avatar Dec 06 '21 01:12 zenixls2

so, the big issue with grid trading, is if the asset/crypto increases in price (and over a year, it statistically tends to do that a lot historically), the grid will sell all of the crypto, and you end the week with USDT.

And so, if instead of grid trading, you had just bought/held the crypto, you would have made more profit.

One solution to this, is to trade crypto/crypto pairs, like ETH/BTC. This way, no matter what, at the end of the trading period, you have crypto, so if crypto "in general" increases, you are not missing out on that increase.

This way, grid trading is the same as holding BTC+ETH, except on top of that, you are making money using the grids.

The issue I'm meeting is, currently, the code is clearly presuming that one of the assets is USDT, if I try to run this using BTC-ETH (or some other pair), the PNL will be messed up.

Any chance this could get fixed?

have it consider we are trading two assets, and in the report, for everything, give the value in asset, and give the value in USDT? so if I trade BTC-ETH, in the PNL, it gives me the beginning value (in usdt) of both BTC and ETH, and the end value (in usdt) of both BTC and ETH?

And if the pair I'm trading happens to have USDT as one of the pair (like BTC-USDT), then it does the same thing, it just doesn't have to convert one of the pair into USDT as it's already USDT

arthurwolf avatar Dec 08 '21 12:12 arthurwolf

Hi @arthurwolf @zenixls2 implemented the high precision, it's already in the main branch, you can check it out

c9s avatar Mar 25 '22 10:03 c9s