Advertisement
Guest User

Untitled

a guest
Aug 17th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. api ref:
  2.  
  3. Fills
  4. List Fills
  5. [
  6. {
  7. "trade_id": 74,
  8. "product_id": "BTC-USD",
  9. "price": "10.00",
  10. "size": "0.01",
  11. "order_id": "d50ec984-77a8-460a-b958-66f114b0de9b",
  12. "created_at": "2014-11-07T22:19:28.578544Z",
  13. "liquidity": "T",
  14. "fee": "0.00025",
  15. "settled": true,
  16. "side": "buy"
  17. }
  18. ]
  19.  
  20.  
  21. q = auth_client.get_fills(product_id="ETC-USD")
  22. x_bid = (q[0][0]['side'])
  23. last_buy = float(q[0][0]['price'])
  24. profit = last_buy + 0.010
  25. x_last_buy = last_buy
  26. print(last_buy,"the last buy price")
  27. print(profit, "profit")
  28.  
  29. if x_bid == 'buy':
  30. print ("bought at", last_buy)
  31.  
  32. code:
  33.  
  34. I tried putting side = buy that dind't work, I tried an If statement, but it uses the key and only gives me the last order weather it's buy or sell.
  35.  
  36. Traceback (most recent call last):
  37. File "newmaker22.py", line 73, in <module>
  38. q = auth_client.get_fills(product_id="ETC-USD",side="buy")
  39. TypeError: get_fills() got an unexpected keyword argument 'side'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement