Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Position issues #4

Open
dannycoin opened this issue Mar 31, 2021 · 0 comments
Open

Position issues #4

dannycoin opened this issue Mar 31, 2021 · 0 comments

Comments

@dannycoin
Copy link

dannycoin commented Mar 31, 2021

2021-03-31 06:21:01,909 - MarketMaker - _on_user_update - DEBUG - Order 7e78dc3b-d4ee-472c-b847-e60312ac0748 (57661.5;1000): FILLED
2021-03-31 06:21:01,909 - MarketMaker - _on_user_update - INFO - Balance: nan, Position: 57820.1082660994, 2000
2021-03-31 06:21:01,913 - MarketMaker - _on_user_update - WARNING - Position, got from server differes with the calculated one: (57836.8999; 2000) vs (57820.1082660994; 2000)
File "/home/danny/DEV/Python/bots/BitmexGridTrader-master/crypto_futures_py/bitmex.py", line 316, in start_user_update_socket
__process_msg(result)
File "/home/danny/DEV/Python/bots/BitmexGridTrader-master/crypto_futures_py/bitmex.py", line 299, in __process_msg
__process_position_update(msg)
File "/home/danny/DEV/Python/bots/BitmexGridTrader-master/crypto_futures_py/bitmex.py", line 255, in __process_position_update
on_update(
File "/home/danny/DEV/Python/bots/BitmexGridTrader-master/sourse/marketmaker.py", line 173, in _on_user_update
self.position.price = data.price
An error happened in user update socket AttributeError 'PositionUpdate' object has no attribute 'price':
{"table":"position","action":"update","data":[{"account":180969,"symbol":"XBTUSD","openOrderBuyQty":3000,"openOrderBuyCost":-5257000,"execBuyQty":1000,"execBuyCost":1734000,"execQty":1000,"execCost":-1734000,"execComm":-433,"currentTimestamp":"2021-03-31T10:21:00.790Z","currentQty":2000,"currentCost":-3543000,"currentComm":883,"unrealisedCost":-3459000,"grossOpenCost":5257000,"grossExecCost":1734000,"markValue":-3478000,"riskValue":8735000,"homeNotional":0.03478,"foreignNotional":-2000,"posCost":-3459000,"posCost2":-3459000,"posInit":691800,"posComm":3114,"posMargin":694914,"posMaint":15567,"initMargin":1060075,"maintMargin":675914,"realisedPnl":83117,"unrealisedGrossPnl":-19000,"unrealisedPnl":-19000,"unrealisedPnlPcnt":-0.0055,"unrealisedRoePcnt":-0.0275,"avgCostPrice":57836.8999,"avgEntryPrice":57836.8999,"breakEvenPrice":57837,"marginCallPrice":48333,"liquidationPrice":48333,"bankruptPrice":48193,"timestamp":"2021-03-31T10:21:00.790Z","lastValue":-3478000,"currency":"XBt","markPrice":57503.37}]}, restarting...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant