chronoxor / CppTrader

High performance components for building Trading Platform such as ultra fast matching engine, order book processor
MIT License
820 stars 254 forks source link

Validate trailing order #11

Closed yueliangwen closed 4 years ago

yueliangwen commented 4 years ago

image

At order.cpp: 83, is the -1000 validation number exactly?

chronoxor commented 4 years ago

According to the spec in include\trader\matching\order.h:180:

        Positive value represents absolute distance from the market.
        Negative value represents percentage distance from the market
        with 0.01% precision (-1 means 0.01, -10000 means 100%).

Therefore validation rules restricts -1000 <= TrailingDistance <= -1 in case of 0.01% precision.