Skip to content

order_test.cpp and GTC orders #18

Description

@DanceBot1234

Just figured out this is only needed with GTC orders!

Not sure if this qualifies as a new issue but I could not get order_test.cpp to work with GTC orders because of rounding issues with tick size.

For example, running order_test.cpp as is results in a 400 error:
Order placement response: 400
Price (0.1700000850000425) breaks minimum tick size rule: 0.01

If anyone is looking for a quick solution, modifying line 368 from
raw_taker = std::floor(raw_taker * 10000) / 10000; // roundDown to 4 decimals

to

raw_taker = std::floor(raw_taker * 100) / 100;        // roundDown to 2 decimals
raw_maker = raw_taker * raw_price;  //  recalc maker amount with new rounded taker amount

works, not sure if that is the proper implementation or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions