kylerberry / JACT

Just Another Crypto Trader. (gdax crypto trading bot)
3 stars 0 forks source link

partial buys bug #27

Closed kylerberry closed 6 years ago

kylerberry commented 6 years ago

doesn't properly calculate some things when a buy is partially filled. It uses the last filled order as the position size, when realistically the position size is the combination of all the previosly partial filled buys:

example series of orders that would reproduce:

[
{ size: '1', side: 'buy', price: '100'},
{ size: '.5', side: 'buy', price: '100'}
{ size: '.5', side: 'buy', price: '100'}
{ size: '.5', side: 'sell', price: '110'}
]

you can see that the last order, a sell should be size 2 but instead is size .5 of the last buy in the sequence

probably affected methods:

kylerberry commented 6 years ago

resolved by https://github.com/kylerberry/JACT/pull/31