How do you validate values for an order using QuickFix

安稳与你 提交于 2020-03-27 04:44:52

问题


I'm a beginner with quickfix and I'm not sure if the problem I'm having is trivial or not. I want to validate the values of an order using quickfix such as symbol, price, quantity, etc. Does quickfix provide a function in python that validates if a price is of type PRICE and that its value is valid (for example: 4.23)?

Here is the reference: http://www.quickfixengine.org/FIX42.html#field_Price


回答1:


As DumbCoder says in the comment QuickFix does not validate the contents of a message. If the PRICE (FIX4.2 tag 44) field is defined to be a float type for example, it can be any float value be it negative, zero or positive. PRICE types in financial markets are not usually negative although there are exceptions.

So it is up to you to validate the message contents for the type of message you are processing. A fill message (e.g. you bought 100 shares of AAPL for 123.45) for a simple stock order would generally never have a negative price value but it is left up to you the programmer to add this contextual validation.

As an example of an exception consider a fill message in a futures markets for a spread order. This in an instruction to trade two separate instruments together somewhat atomically and could result in a negative price so that you got money back and a position in a contract.



来源:https://stackoverflow.com/questions/41030492/how-do-you-validate-values-for-an-order-using-quickfix

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!