Method and system for processing option data
Processing market data through validity check and hash representation solves the existing technology problems of large amount of calculation and insufficient integrity check for option market data processing, achieves more accurate and efficient market data processing, and improves option pricing. Accuracy and timeliness.
Patent Information
- Application Number
- CN202410656506.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-09-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The options market data processing in the prior art has the problems of large amount of calculation and insufficient verification of the integrity and accuracy of the option contract market data of the same expiration month.
By obtaining market data and performing validity verification, use timestamps and trading volumes to determine the validity of contract data, determine verification methods for multiple data sources, and ensure the expiration month and sequence consistency of contract data, using hash representation. and storage to realize the checksum calculation of the entire market data.
It improves the accuracy and efficiency of market data processing, reduces the number of calculations and the amount of calculations, and ensures the accuracy and timeliness of option pricing.
Smart Images

Figure CN118710402A
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an option data processing method and system. Background Art
[0002] As a basic financial derivative, options play a series of important functions in the capital market, such as price discovery, risk management, and hedging. Its underlying assets cover multiple fields such as stocks, securities price indices, futures contracts, government bonds, and commodities, and have become an indispensable part of the financial market. Option trading has significantly improved market efficiency and improved the market risk hedging mechanism.
[0003] The core of the on-exchange option trading business lies in pricing. Option pricing is essentially an information processing process, that is, calculating the reasonable price of options through a series of operations based on input data. The input data includes historical market data of option contracts, option contract element data, interest rate data, underlying asset market data, etc.
[0004] Among them, market data is the most important, with the largest amount of data and the most frequent changes. Generally speaking, an option contract for an underlying asset will be divided into several contracts with expiration months. There will be multiple contracts with different exercise prices in the same expiration month. There will be two types of options, call and put, for the same exercise price. Therefore, the same underlying asset can derive many option contracts. In the entire derivatives trading process, the exchange samples the transaction data at a fixed frequency and discloses the market data. The data content only includes the data snapshots of the contracts with price changes within this time interval. On the other hand, there is a correlation between the market changes of option contracts with the same expiration month. Pricing and trading need to be carried out for the overall situation of all contracts with the same expiration month, but the sending and receiving of market data is streamed one by one. How to judge in the streaming data that the data of the same expiration month has been fully collected, and how to efficiently and timely process this batch of market data are crucial to the subsequent option pricing and trading.
[0005] In the existing technology, updating the option market data one by one will trigger the relevant calculations of option pricing, which requires huge amount of calculations, and there is a lack of verification of the integrity and accuracy of the option contract market data in the same expiration month. Summary of the invention
[0006] Based on this, it is necessary to address the problems existing in the existing technologies, such as the update of option market data one by one will trigger related calculations for option pricing, which requires a huge amount of calculations, and there is a lack of technical problems in the integrity and accuracy verification of the market data of option contracts in the same expiration month. A method and system for processing market data more accurately and efficiently is proposed.
[0007] Provided are an option data processing method, system, computer device and storage medium.
[0008] In some embodiments, a method for processing option data includes:
[0009] Obtaining market data and performing validity verification on the market data;
[0010] In response to the market data being derived from a same data source, determining the validity of the contract data based on a timestamp and a transaction volume of the same contract data in the market data;
[0011] In response to the market data being derived from multiple data sources, determining a corresponding verification method based on a sending order of contract data in the market data, and verifying the market data based on the determined verification method;
[0012] In response to the contract data satisfying the verification result, data calculation is performed based on the verified contract data.
[0013] In some embodiments, in response to the market data being derived from multiple data sources, determining a corresponding verification method based on a sending order of contract data in the market data, and verifying the market data based on the determined verification method includes:
[0014] In response to the contract data in the market data being sent in a deterministic order, determining the expiration month of the contract data, and performing validity verification on the contract data based on a comparison result between the contract month of the currently received contract data and the expiration month;
[0015] In response to the contract data in the market data being sent in an uncertain order, the validity of the contract data is checked based on time information of the currently received contract data.
[0016] In some embodiments, in response to the contract data in the market data being sent in a deterministic order, determining the expiration month of the contract data, and performing validity verification on the contract data based on a comparison result between the contract month of the currently received contract data and the expiration month, includes:
[0017] Determine the expiration month of the contract data in the market data;
[0018] Obtaining a contract code of contract data in the currently received market data, wherein the contract code is determined based on the contract month of the contract data;
[0019] In response to the currently received contract code being greater than the expiration month, it is determined that the entire market data has been successfully verified.
[0020] In some embodiments, in response to the contract data in the market data being sent in an uncertain order, performing validity verification on the contract data based on time information of the currently received contract data includes:
[0021] Determine the first starting time point of the first batch of snapshot quotations and the first ending time point of the first batch of snapshot quotations receiving the entire snapshot;
[0022] Determine the second starting time point for the second batch of snapshot quotes;
[0023] Based on the time relationship between the first starting time point, the first ending time point and the second starting time point, it is determined whether the entire market data is successfully verified.
[0024] In some embodiments, the determining whether the entire market data is successfully verified based on the time relationship between the first starting time point, the first ending time point, and the second starting time point includes:
[0025] In response to the second starting time point being greater than the sum of the first starting time point and the first ending time point, it is determined that the verification of the entire market data is successful.
[0026] In some embodiments, in response to the market data being derived from the same data source, judging the validity of the contract data based on the timestamp and transaction volume of the same contract data in the market data includes:
[0027] In response to the timestamp of the same contract data satisfying T2>T1, and the trading volume satisfying Vt2>=Vt1, the contract data is judged to be valid, wherein T1 and T2 represent the timestamps of the two market data, and Vt1 and Vt2 represent the cumulative trading volume of the market on the same day in the two market data.
[0028] In some embodiments, the method further comprises:
[0029] The contract data in the market data is hashed and stored according to the contract month and exercise price;
[0030] The validity checking of the market data includes:
[0031] Based on the contract month, the contract data of the corresponding month is obtained from the pre-stored market data.
[0032] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0033] Obtaining market data and performing validity verification on the market data;
[0034] In response to the market data being derived from a same data source, determining the validity of the contract data based on a timestamp and a transaction volume of the same contract data in the market data;
[0035] In response to the market data being derived from multiple data sources, determining a corresponding verification method based on a sending order of contract data in the market data, and verifying the market data based on the determined verification method;
[0036] In response to the contract data satisfying the verification result, data calculation is performed based on the verified contract data.
[0037] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0038] Obtaining market data and performing validity verification on the market data;
[0039] In response to the market data being derived from a same data source, determining the validity of the contract data based on a timestamp and a transaction volume of the same contract data in the market data;
[0040] In response to the market data being derived from multiple data sources, determining a corresponding verification method based on a sending order of contract data in the market data, and verifying the market data based on the determined verification method;
[0041] In response to the contract data satisfying the verification result, data calculation is performed based on the verified contract data.
[0042] The present application also provides an option data processing system, the system comprising: a real-time market data module, a data integration module, a validity verification module, a basic data module, a contract data module and a whole-frame verification module;
[0043] The real-time market data module is used to obtain market data in real time;
[0044] Data integration module, used to merge and filter multiple market data;
[0045] The validity check module is used to realize the validity judgment of the market data. Through the pre-configured validity check algorithm, the received market data is judged for validity, and the valid market data is filtered out and loaded into the system;
[0046] Basic data module, used to select and load basic contract data;
[0047] The contract data module is used to specify the expiration month of the option contract data as the parameter input of the module, filter the entire input data through the parameters, and select the option contract data that meets the expiration month as the basic data to be loaded into the system. The basic data of the contract includes one or more of the contract code, transaction code, contract execution price and contract expiration date;
[0048] The whole-frame inspection module is used to realize the whole-frame judgment of the market.
[0049] In some embodiments, the basic data module obtains the basic transaction contract data corresponding to a preset time from a data source, filters the contract information to be processed from the basic transaction contract data according to the filtering information configured by the user, and constructs the filtered contract information in the memory in the form of a hash table as static data for use by subsequent modules.
[0050] In some embodiments, the whole-frame verification module is used to, in response to the market data being derived from the same data source, determine the validity of the contract data based on the timestamp and transaction volume of the same contract data in the market data; in response to the market data being derived from multiple data sources, determine the corresponding verification method based on the sending order of the contract data in the market data, and verify the market data based on the determined verification method; in response to the contract data satisfying the verification result, perform data calculation based on the verified contract data.
[0051] The above-mentioned option data processing method, system, computer equipment and storage medium screen out valid market data through the validity verification method, and obtain the verification algorithm of the verification module to ensure that the entire market data is collected and provided for external use, thereby obtaining a more accurate and efficient method for processing market data, which greatly reduces the number and amount of calculations in option pricing and trading, and improves the accuracy and timeliness of calculations. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 This is a flow chart of an option data processing method provided in one of the embodiments of the present application;
[0053] Figure 2 A schematic diagram of a process for implementing the steps of selecting and loading contract basic data by using a basic data module provided in one embodiment of the present application;
[0054] Figure 3 A schematic diagram of the steps for processing market data when market data is not sent in a fixed order provided in one of the embodiments of the present application;
[0055] Figure 4A schematic diagram of an algorithm for determining whether contract data conforms to a certain order in a whole snapshot provided in one of the embodiments of the present application;
[0056] Figure 5 An option data processing system provided in one of the embodiments of the present application;
[0057] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0059] It should be noted that options, as basic financial derivatives, play a series of important functions in the capital market, such as price discovery, risk management, hedging, etc. Its underlying assets cover stocks, securities price indices, futures contracts, government bonds, commodities and other fields, becoming an indispensable and important part of the financial market. Option trading has significantly improved market efficiency and improved the market risk hedging mechanism.
[0060] The core of the on-exchange option trading business lies in pricing. Option pricing is essentially an information processing process, that is, calculating the reasonable price of options through a series of operations based on the input data. The input data includes historical market data of option contracts, option contract element data, interest rate data, market data of underlying assets, etc. Among them, market data is the most important and has the largest amount of data and the most frequent changes. Generally speaking, an option contract for an underlying asset will be divided into several contracts with expiration months. The same expiration month will have multiple contracts with different exercise prices. The same exercise price will have two types of options, call and put. Therefore, the same underlying asset can derive many option contracts. In the entire process of derivatives trading, the exchange samples the transaction data at a fixed frequency and discloses the market data. The data content only includes data snapshots of contracts with price changes within this time interval.
[0061] On the other hand, there is a correlation between the market changes of option contracts with the same expiration month. Pricing and trading need to be carried out based on the overall situation of all contracts with the same expiration month, but the sending and receiving of market data is done in a streaming manner one by one. How to judge in the streaming data that the data of the same expiration month has been fully collected, and how to process this batch of market data efficiently and timely are crucial to subsequent option pricing and trading.
[0062] Based on this, the present application provides a method for processing options data, aiming to provide a method and system for processing market data more accurately and efficiently.
[0063] In one embodiment, Figure 1 As shown, the present application provides an option data processing method, the method comprising:
[0064] Step 101, obtaining market data and performing validity verification on the market data.
[0065] In the option trading scenario, market data is the most important data with the largest data volume and the most frequent changes. Generally speaking, an option contract for an underlying asset will be divided into several contracts with expiration months. There will be multiple contracts with different exercise prices in the same expiration month. There will be two types of options, call and put, for the same exercise price. Therefore, many option contracts can be derived from the same underlying asset. There is a correlation between the market changes of option contracts with the same expiration month. Pricing and trading need to be carried out for the overall situation of all contracts with the same expiration month, but the sending and receiving of market data is streamed one by one. How to judge in the streaming data that the data of the same expiration month has been completely collected, and how to efficiently and timely process this batch of market data are crucial to the subsequent option pricing and trading. Therefore, it is necessary to verify the validity of the received market data to ensure that the obtained market data is accurate.
[0066] In some embodiments, the method further includes: hashing and storing the contract data in the market data according to the contract month and the exercise price; and verifying the validity of the market data includes: obtaining the contract data of the corresponding month from the pre-stored market data based on the contract month.
[0067] In this way, all tradable market data (option contracts) collected by the information system on the day are stored in a hash table with the contract month and exercise price as the primary key, which makes it convenient to quickly index to option contracts with the same expiration month based on the contract month in the subsequent validity verification link, and to quickly locate option contracts with specified exercise prices in the subsequent calculation process.
[0068] Among them, the purpose of validity verification is to take into account the correlation between the market changes of option contracts with the same expiration month. Pricing and trading need to be carried out for the overall situation of all contracts with the same expiration month, but the sending and receiving of market data are streamed one by one, so it cannot be guaranteed that the subsequent calculation process can be carried out based on the contract data of the same expiration month. In this way, it cannot be guaranteed that the calculated pricing is accurate. Therefore, it is necessary to verify the validity of the received market data. In this way, the verified contract data belonging to the same expiration month can be used to calculate option pricing, making the calculation result more accurate.
[0069] Step 102, in response to the market data being derived from the same data source, determining the validity of the contract data based on the timestamp and transaction volume of the same contract data in the market data.
[0070] For market data from the same data source, the market timestamp T increases in time series, and the cumulative trading volume Vt of the same contract increases monotonically with the change of the timestamp. In the most extreme case, at two time points T1 and T2, there is no transaction in the entire market. In this case, the cumulative trading volume will also satisfy Vt2 = Vt1. Therefore, the validity of the most basic contract market data can be determined by the monotonicity rules of timestamp T and trading volume Vt.
[0071] It should be noted that the most basic characteristics of the market data disclosed by the stock exchange in the securities market (including the buying and selling prices, positions, transactions, etc.) include: the market time must be increasing, and the transaction volume in the market must be increasing. However, due to complex reasons in the link (network transmission, encoding and decoding, etc.), data that does not conform to business logic may appear. Therefore, the rule of (T2>T1, Vt2>Vt1) is used to determine whether it is valid. If invalid data appears, it is considered dirty data and this data will not be calculated later.
[0072] In some embodiments, in response to the market data being derived from the same data source, the validity of the contract data is judged based on the timestamp and trading volume of the same contract data in the market data, including: in response to the timestamp of the same contract data satisfying T2>T1, and the trading volume satisfying Vt2>=Vt1, the contract data is judged to be valid.
[0073] Among them, the timestamp refers to the absolute time when the exchange discloses market data on a regular basis, and the trading volume refers to the cumulative trading volume information of the contract at the time of the timestamp.
[0074] Step 103, in response to the market data being derived from multiple data sources, determining a corresponding verification method based on the sending order of the contract data in the market data, and verifying the market data based on the determined verification method.
[0075] When multiple channels of market information are accessed separately, the data flow within each channel conforms to the rules of time increment and non-duplication of data. However, when multiple channels of market information are accessed simultaneously, data from different sources intersect with each other, and various problems such as time rollback and data duplication may occur.
[0076] According to the above embodiment, the original market data obtained from multiple sources can be received and integrated, and according to the integration and merging algorithm, the system can be guaranteed to obtain the fastest, correct and non-redundant data. The integrated market data is verified by an internal custom validity verification algorithm, and the verified data enters the next module, which also enables the next module to obtain more accurate data. In addition, the verification enabled by the system is only the most basic validity judgment, and the module also supports custom algorithms for expansion.
[0077] Subsequent business modules can perform more detailed screening based on business needs using custom validity judgment algorithms to filter out invalid data considered by the business. The following are examples of several custom validity algorithms:
[0078] Price difference greater than threshold algorithm: Some pricing algorithms have higher requirements for the accuracy of market prices. In this case, a verification rule can be defined that the price difference between the bid and ask prices in the current market is valid data only when it is within a certain threshold range. Market data with too large a price difference means that market participants make random bid and ask quotations and do not really want to trade at this price. This price has no reference significance and is therefore considered invalid data.
[0079] Absolute value range algorithm: Some pricing algorithms have certain requirements on the range of indicator data in the market. For example, they only process data with absolute values between 3% and 97%. Data outside this range is considered to be noise data, which will interfere with normal business calculations and will be filtered out as invalid data.
[0080] Verification algorithms like these that are customized according to specific business needs can be integrated into the system as modules, making the data source for subsequent business module operations more accurate and effective.
[0081] For example, the contract data may be sent in a certain order or not. For the contract data sent in a certain order.
[0082] In some embodiments, in response to the market data being derived from multiple data sources, a corresponding verification method is determined based on the order in which the contract data in the market data is sent, and the market data is verified based on the determined verification method, including: in response to the contract data in the market data being sent in a deterministic order, determining the expiration month of the contract data, and performing validity verification on the contract data based on a comparison result between the contract month of the currently received contract data and the expiration month; in response to the contract data in the market data being sent in an uncertain order, performing validity verification on the contract data based on the time information of the currently received contract data.
[0083] In some embodiments, based on whether the option contracts in the market data are sent in a certain order, the verification and determination of the entire market data can be divided into two cases. The first case is sent in a deterministic order, and the second case is not sent in a deterministic order.
[0084] In some embodiments, in response to the contract data in the market data being sent in a deterministic order, the expiration month of the contract data is determined, and based on a comparison result of the contract month of the currently received contract data with the expiration month, the validity of the contract data is verified, including: determining the expiration month of the contract data in the market data; obtaining the contract code of the contract data in the currently received market data, wherein the contract code is determined based on the contract month of the contract data; and in response to the currently received contract code being greater than the expiration month, determining that the verification of the entire market data is successful.
[0085] Specifically, when the internal contracts (contract data) of the market data are sent in a deterministic order, for the contract data with the contract expiration month N, it is recorded as N i , i=1...k, the code of the last contract in the entire option contract sequence is N k The contract code of the contract data in each received market data is recorded as M. When M>N k When, it represents the entire sequence N i , i=1...k snapshots are received, which means the entire market data has been received, that is, the verification has passed, so the calculation of subsequent modules can be triggered.
[0086] In some embodiments, in response to the fact that the contract data in the market data is sent in an uncertain order, the validity of the contract data is verified based on the time information of the currently received contract data, including: determining a first starting time point for the first batch of snapshot market conditions, and a first ending time point for the first batch of snapshot market conditions to receive the entire snapshot; determining a second starting time point for the second batch of snapshot market conditions; and determining whether the entire market data has been successfully verified based on the time relationship between the first starting time point, the first ending time point, and the second starting time point.
[0087] In some embodiments, determining whether the entire market data has been successfully verified based on the time relationship between the first starting time point, the first ending time point, and the second starting time point includes: in response to the second starting time point being greater than the sum of the first starting time point and the first ending time point, determining that the entire market data has been successfully verified.
[0088] Specifically, if the internal contract data of the market data is not sent in a deterministic order, this application also proposes a time estimation method to determine the end of the entire market snapshot. Figure 3 , record T1 as the starting time of the first batch of snapshot quotations of the exchange, T2 as the starting time of the second batch of snapshot quotations of the exchange, T s It is the time from the first batch of snapshots to the time when the entire snapshot is fully received. s For the same exchange, it is an almost fixed value, so it can be obtained based on historical data statistics, so that when the first snapshot data T1 is received, the current time point T≥T1+T s , which means that the verification of the entire market situation has been completed, thereby triggering the calculation of subsequent modules.
[0089] Step 105: In response to the contract data satisfying the verification result, data calculation is performed based on the verified contract data.
[0090] In this way, in the process of pricing calculation based on contract data, the accurate acquisition of contract data is guaranteed, so that the calculated pricing can be more reasonable and accurate.
[0091] In the above embodiment, a verification and judgment criterion for the entire market data is provided, and the entire market data verification mark is used to inform the outside world whether the market data is available, thereby ensuring that the market data of the same time dimension is used in the entire calculation process.
[0092] In the above embodiment, a set of efficient market processing methods is provided, which facilitates users to obtain market information of option contracts on the market as timely, quickly and accurately as possible, and better provide input data, so as to provide users with timely and accurate theoretical prices of option contracts, and provide a basis for subsequent quotation transactions and risk calculations.
[0093] like Figure 5 As shown, the present application also provides an option data processing system, which realizes the effect of efficiently and quickly processing market data in option pricing. The system includes: a real-time market data module, a data integration module, a validity verification module, a basic data module, a contract data module and a whole-frame verification module.
[0094] The real-time market data module is used to obtain market data in real time;
[0095] Data integration module, used to merge and filter multiple market data;
[0096] The validity check module is used to realize the validity judgment of the market data. Through the pre-configured validity check algorithm, the received market data is judged for validity, and the valid market data is filtered out and loaded into the system;
[0097] Basic data module, used to select and load basic contract data;
[0098] The contract data module is used to specify the expiration month of the option contract data as the parameter input of the module, filter the entire input data through the parameters, and select the option contract data that meets the expiration month as the basic data to be loaded into the system. The basic data of the contract includes one or more of the contract code, transaction code, contract execution price and contract expiration date;
[0099] The whole-frame inspection module is used to realize the whole-frame judgment of the market.
[0100] In some embodiments, the basic data module obtains the basic transaction contract data corresponding to a preset time from a data source, filters the contract information to be processed from the basic transaction contract data according to the filtering information configured by the user, and constructs the filtered contract information in the memory in the form of a hash table as static data for use by subsequent modules.
[0101] In the above embodiment, the basic data of option contracts in the original market are filtered and stored as needed, and the snapshot market data in the market is processed by the invention instance to generate the entire market data to trigger subsequent option pricing risk calculations, transaction instruction generation and other operations.
[0102] Among them, the basic data module is used to select and load the basic contract data. Figure 2 , obtain the basic trading contracts in the market on that day from the data source as the basis of this instance, and use the filtering information configured by the user, including the underlying securities and expiration months of the option contracts, to filter the contract information that needs to be processed by this instance. It will run once each time the system starts, and the basic contract information will be built in the memory in the form of a hash table as static data for use by subsequent modules.
[0103] As the foundation for the construction of the entire technical solution, the basic data module needs to select and load market data once every trading day. After the market data is loaded, it remains unchanged during the entire trading day. The system will classify the market data according to the expiration month based on the basic contract data, and uniformly calculate the option contract data for the same expiration month. This module is the basis for the operation of other modules and is the first module to run in the entire system. Users can specify the expiration month of the option contract data as the parameter input of the module, filter the entire input data through the parameters, and select the option contract data that meets the expiration month as the basic data to be loaded into the system. The basic data of the contract mainly includes: contract code, transaction code, contract execution price and contract expiration date and other information.
[0104] The data integration module realizes the merging and screening of multiple market data. Specifically, in order to obtain faster and richer market data, the system needs to connect to at least two market sources to collect real-time data. When multiple market sources are connected separately, the data flow within each channel complies with the rules of time increment and non-duplicate data. However, when multiple market sources are connected at the same time, data from different sources intersect with each other, which may cause various problems such as time rollback and data duplication.
[0105] This module connects to multiple external market data sources and performs multi-channel market optimization and repeated screening functions. It can not only ensure that the system obtains the fastest market data, but also ensure that the system obtains correct and non-redundant data through repeated screening functions.
[0106] When receiving the market information on the current trading market in real time, the first step of filtering is performed according to the basic contract information. The market data that is not in the list of contracts of concern will be discarded, thereby filtering out the market information that needs to be updated.
[0107] In this embodiment, this module is connected to multiple upstream market data sources, and can achieve multi-path optimization of different lines and different sources.
[0108] The market data from the same source and the same link meet the following characteristics: the timestamp of the same contract data meets the requirement of T2>T1 and the transaction volume meets the requirement of Vt2>=Vt1.
[0109] However, in the case of receiving multiple market quotes simultaneously, due to different sources and varying speeds of link transmission, there will be a situation where the timestamps and trading volumes of the market quotes entering the module intersect with each other. Therefore, when receiving market quotes, it is necessary to make a judgment based on this characteristic. If the module receives market quote data that does not conform to this characteristic, it means that this piece of market quote data is outdated information, indicating that more timely data has been received into the system through other sources or links. Therefore, this market quote information will be discarded. This can ensure that the fastest valid data is found from multiple sources and enters this instance system. For example, for two pieces of data T1 and T3 inside link L1, and two pieces of data T2 and T4 inside link L2, assuming the time order is T1 < T2 < T3 < T4, both conform to the monotonic rule inside the two links. However, when the system receives data from both L1 and L2 simultaneously, a data stream like <T1, T3, T2, T4> may occur. In this case, when T2 is received, since the system has processed the more timely data T3, T2 will be considered as outdated data and discarded, ensuring that the latest data received first from L1 and L2 can be loaded into the system.
[0110] The validity verification module is used to implement the judgment of market quote validity. Due to issues such as trading status, data transmission, and the intersection of market quote sequences caused by multiple market quote sources, data that does not conform to the subsequent calculation logic may be received from external market quote sources. Therefore, through a pre-configured validity verification algorithm, the validity of each received market quote can be judged, so as to filter out valid market quote data and load it into the system. This module currently pre-sets a variety of basic algorithms, including: absolute value range algorithm, selling price greater than buying price algorithm, price spread greater than threshold algorithm, etc.
[0111] In the above embodiment, this module sequentially uses the validity algorithms inside the module to perform verification on the input market quote data, and the data that conforms to the verification enters the next module.
[0112] The module has built-in some common algorithms and supports custom algorithms for extension. Some of the built-in algorithms are such as price validity, buy-sell price spread greater than threshold, buy-sell quantity greater than 0, selling price greater than buying price, etc.
[0113] The overall inspection module is used to implement the judgment of the overall market quote. The market quotes of the exchange belong to snapshot market quotes, which will be sent at a fixed frequency at fixed intervals. Currently, the vast majority of domestic exchanges use a sending time interval of 500 milliseconds, that is, 2 snapshot data are sent evenly per second. In order to reduce the data volume, the market quote data sent each time does not include all option contract data, but only includes the contract information whose data has changed during this interval. Generally speaking, the number of contracts included in the market quote snapshot ranges from dozens to hundreds, and their timestamps are the same, which is the moment of the snapshot.
[0114] If the calculation is performed before the market data for the same expiration month is completely received, the input data of the pricing service will contain part of the previous expired market data, resulting in the calculation result not being able to reflect the actual market situation in a timely manner, and causing a large deviation from the actual theoretical price. At the same time, the number of contracts included in each data transmission is not a fixed value, so it is difficult to judge whether the data for the entire month has been received based on the number of market data received.
[0115] In the above embodiment, an algorithm for judging the entire market is proposed for this type of situation. When the entire market is obtained, a subsequent calculation is triggered to ensure that the entire calculation process uses market data of the same time dimension. Depending on whether the contracts within the entire market data conform to a certain order, the algorithm for judging the entire market has two different logics.
[0116] When the internal contracts of the market data are sent in a certain order, suppose we need to make a judgment on the entire market with a contract with expiration month N as N. i , i = 1...k, and record the code N of the last contract in month N in the entire option contract sequence k , the contract code of each received market data is recorded as M, because the market data is sent in the order of contracts, so when the condition M>N k When it is satisfied, it means that all contracts in the order M have been sent, which means that the entire sequence N i , i=1...k snapshots have all been received, satisfying the condition that the entire market data for month N has been received.
[0117] If the internal contract of the market data does not have a deterministic order, the time estimation method can be used to determine the end of the market snapshot. Figure 3 Description, T1 is the starting time of the first batch of snapshot quotations of the exchange, T2 is the starting time of the second batch of snapshot quotations of the exchange, the first batch of quotations contains N contract data, T s The time point from which the entire snapshot is received starting from the first batch of snapshots. According to the current situation, T s It is a fixed value for the same exchange, which can be easily calculated based on historical data. In this way, when the first snapshot data is received, s After the time, the current snapshot is considered to have been received, and subsequent calculations can be performed.
[0118] The whole-picture verification module will update the whole-picture market sign to indicate whether the current market data is available. If calculation is performed when the sign is not available, part of the latest market data and part of expired data will be used, resulting in a large deviation in the calculation result, which cannot reflect the actual market situation in a timely manner.
[0119] The exchange publishes market data in the format of snapshots, and the current frequency is 500 milliseconds. The content will include the contract market that has changed compared to the last time. Therefore, when the module receives the market, a batch of contract market will be received continuously, but the timestamps of the market are all snapshots.
[0120] This invention example uses Figure 4 As shown in the figure, the algorithm for judging the entire snapshot of contract data that conforms to a certain order is explained. The number of expiration months for each product in the market is mostly four or five, which will be disclosed in advance in the contract details. In this example, the algorithm is explained using two expiration month product contracts. The contract codes of the two expiration months start with 1- and 2- respectively, and there are 6 different contracts in each month. The order of sending the market information conforms to: Order = (1-1, 1-2, 2-3, 1-4, 2-1, 2-2, 2-3, 1-5, 1-6, 2-3, 2-4, 2-5, 2-6). Then, in the entire sequence, the last contract in January is 1-6. When the contract market information after 1-6 is received, it means that all the contract market information in January has been received. The horizontal axis in the figure represents time. In this example, when the market information data of 1-1, 1-3, 2-1, 2-2, and 1-5 are received, it is impossible to determine whether the entire market information has been received, so it will not trigger subsequent calculations. However, when the 2-3 market data is received, it means that all the contract data before this contract in the sequence has been received, that is, the entire market has ended. Note that although the last 1-6 market data of the January sequence was not received, it is because 1-6 did not change in this market, so the exchange did not send the market for this contract.
[0121] In the actual operation of the example, for exchanges such as the Shenzhen Stock Exchange and the Shanghai Futures Exchange, the sequence of market information sent follows a certain contract order, so this algorithm is used to make judgments and guide subsequent operations.
[0122] For the Shanghai Stock Exchange, the sending sequence of quotation does not follow a fixed order, so we use Figure 3 The algorithm shown in the figure is run. In actual statistics, it is found that the value of Ts is about 20 milliseconds. Each time the first market information with a different timestamp is received, a 20-millisecond timer is used. The timer will trigger the setting of the flag for the completion of the entire market information. This flag tells the subsequent calculations whether the current market information can be used.
[0123] The market processing method used in this example greatly reduces the number and amount of calculations in option pricing and trading, and improves the accuracy and timeliness of calculations, which has a great benefit effect on option pricing.
[0124] The present application discloses a method and device for efficiently and quickly processing market data in option pricing. Specifically, it includes four submodules: basic data, data integration, validity check, and whole-frame check. Among them, the basic data module realizes the contract basic data loading function; the data integration module completes the multi-source market data integration and filtering function; the validity check module screens out valid market data through the validity check algorithm; the whole-frame check module uses a whole-frame check algorithm to ensure that the whole-frame market data is collected and available for external use. The previous technology of processing market data one by one has a huge amount of calculation, and is relatively lacking in the integrity and accuracy check of the market data of option contracts in the same expiration month. In view of this, the present invention proposes a method and device for processing market data more accurately and efficiently, which greatly reduces the number and amount of calculations in option pricing and trading, and improves the accuracy and timeliness of calculations.
[0125] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the accompanying drawings may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.
[0126] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store market data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a market data processing method is implemented.
[0127] Those skilled in the art will understand that Figure 6The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0128] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0129] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0130] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0131] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0132] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for processing option data, characterized in that: The method comprises: Obtaining market data and performing validity verification on the market data; In response to the market data being derived from a same data source, determining the validity of the contract data based on a timestamp and a transaction volume of the same contract data in the market data; In response to the market data being derived from multiple data sources, determining a corresponding verification method based on a sending order of contract data in the market data, and verifying the market data based on the determined verification method; In response to the contract data satisfying the verification result, data calculation is performed based on the verified contract data.
2. The method according to claim 1, characterized in that In response to the market data being derived from multiple data sources, determining a corresponding verification method based on a sending order of contract data in the market data, and verifying the market data based on the determined verification method, including: In response to the contract data in the market data being sent in a deterministic order, determining the expiration month of the contract data, and performing validity verification on the contract data based on a comparison result between the contract month of the currently received contract data and the expiration month; In response to the contract data in the market data being sent in an uncertain order, the validity of the contract data is checked based on time information of the currently received contract data.
3. The method according to claim 2, characterized in that In response to the fact that the contract data in the market data is sent in a deterministic order, determining the expiration month of the contract data, and performing validity verification on the contract data based on a comparison result between the contract month of the currently received contract data and the expiration month, including: Determine the expiration month of the contract data in the market data; Obtaining a contract code of contract data in the currently received market data, wherein the contract code is determined based on the contract month of the contract data; In response to the currently received contract code being greater than the expiration month, it is determined that the entire market data has been successfully verified.
4. The method according to claim 2, characterized in that: In response to the contract data in the market data being sent in an uncertain order, performing validity verification on the contract data based on time information of the currently received contract data, including: Determine the first starting time point of the first batch of snapshot quotations and the first ending time point of the first batch of snapshot quotations receiving the entire snapshot; Determine the second starting time point for the second batch of snapshot quotes; Based on the time relationship between the first starting time point, the first ending time point and the second starting time point, it is determined whether the entire market data is successfully verified.
5. The method according to claim 4, characterized in that The determining whether the entire market data is successfully verified based on the time relationship between the first starting time point, the first ending time point, and the second starting time point includes: In response to the second starting time point being greater than the sum of the first starting time point and the first ending time point, it is determined that the verification of the entire market data is successful.
6. The method according to claim 1, characterized in that In response to the market data being derived from the same data source, judging the validity of the contract data based on the timestamp and transaction volume of the same contract data in the market data includes: In response to the timestamp of the same contract data satisfying T2>T1, and the trading volume satisfying Vt2>=Vt1, the contract data is judged to be valid, wherein T1 and T2 represent the timestamps of the two market data, and Vt1 and Vt2 represent the cumulative trading volume of the market on the same day in the two market data.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: The contract data in the market data is hashed and stored according to the contract month and exercise price; The validity checking of the market data includes: Based on the contract month, the contract data of the corresponding month is obtained from the pre-stored market data.
8. An option data processing system, characterized in that: The system includes: a real-time market data module, a data integration module, a validity inspection module, a basic data module, a contract data module and a whole-frame inspection module; The real-time market data module is used to obtain market data in real time; Data integration module, used to merge and filter multiple market data; The validity check module is used to realize the validity judgment of the market data. Through the pre-configured validity check algorithm, the received market data is judged for validity, and the valid market data is filtered out and loaded into the system; Basic data module, used to select and load basic contract data; The contract data module is used to specify the expiration month of the option contract data as the parameter input of the module, filter the entire input data through the parameters, and select the option contract data that meets the expiration month as the basic data to be loaded into the system. The basic data of the contract includes one or more of the contract code, transaction code, contract execution price and contract expiration date; The whole-frame inspection module is used to realize the whole-frame judgment of the market.
9. The system according to claim 8, characterized in that The basic data module obtains the basic transaction contract data corresponding to the preset time from the data source, filters the contract information to be processed from the basic transaction contract data according to the filtering information configured by the user, and constructs the filtered contract information in the memory in the form of a hash table as static data for use by subsequent modules.
10. The system according to claim 8, characterized in that The whole frame inspection module is used for judging the validity of the contract data based on the timestamp and transaction volume of the same contract data in the market data in response to the market data being derived from the same data source; In response to the market data being derived from multiple data sources, determining a corresponding verification method based on a sending order of contract data in the market data, and verifying the market data based on the determined verification method; In response to the contract data satisfying the verification result, data calculation is performed based on the verified contract data.
