Effanuel / BitMEX-scaled-orders

Bitmex trading tool using REST API and Websocket
MIT License
33 stars 15 forks source link

Price and quantity rounding problem for many placed orders #4

Closed Effanuel closed 4 years ago

Effanuel commented 4 years ago

Expected Behavior

Generating multiple count orders using <ScaledOrders /> table should limit Quantity, Range start and Range end of placed orders as to not exceed the provided inputs.

Current Behavior

Given some larger Order count, contracts quantity and last order's price are wrongly calculated.

Results:

Possible Solution

Check Quantity and Range end USD at the end of generating orders

Steps to Reproduce

  1. Inputs:
    • Quantity - 10000
    • Order count - 10
    • Range start USD - 7777
    • Range end USD - 8888
    • Distribution - Positive

Possible Implementation