HFT에 필요한 네트워크인 TOE와 RDMA에 관한 분석입니다.
발표자료를 만들어보았습니다.
I made this one for presentation.
This is about TOE, RDMA for HFT.





Optimal asset portfolios

By principles of the Capital Asset Pricing Model (CAPM), the script returns the normalized minimum variance and tangency vectors. These are the optimal portfolio weights for the two efficient portfolios.

How to run the script

Fork or clone
Script is initilized with OptimalPortfolioDiversification(), adding a numpy 2d array with asset returns (Stationary) as est_return_matrix arg and a Risk free return (Often just 0).
Portfolio weights are stored in (self.normalized_min_variance_vector, self.normalized_tangency_vector)
Expected return for the next period and given portfolio is stored in (self.expected_return_of_min_var_portfolio, self.expected_return_of_tangency_portfolio)
Standard deviation (Risk) for the next period and given portfolio is stored in (self.stdOfMinVariancePortfolio, self.stdOfTangencyPortfolio)

Usage examples

Im using the script to monitor daily risk in the danish C20CAP stock index, updated every 15 minutes by scraping data from borsen.dk
Tangency (Largest return given risk) https://plot.ly/~nstaalung/63
Minimum Variance (Lowest risk) https://plot.ly/~nstaalung/65

https://github.com/NicholaiStaalung/Oport.git


Program Structure in Korean


def covMatrix()
"""공분산 matrix 함수"""

class OptimalPortfolioDiversification()
"""CAPM의 원리에 따라 최적의 portfolio weights를 찾음"""
        def __init__(self, est_return_matrix, risk_free_return, lagrange=False):
        ""생성자"""
        try:
                """수익률 리턴 분석 및 할당(관찰 수, 그룹 수)"""
                """평균 수익률 matrices 생성"""

        """벡터 한개 더하기"""

        """특정 해 찾기, 만약 역변환이 불가능하면 라그랑주가 자동적으로 불려짐"""
     
        def varCovar(self):
                """수익률 매트릭스를 토대로 variance-covariance matrix를 구함"""
        def minVarPortfolio(self):
                """var-covar 매트릭스를 토대로 최소 variance 포트폴리오 weight를 계산,
                       역변환이 불가능 할때만 적용가능, 만약 아니라면 라그랑주"""
        def tangentPortfolio(self):
                """var-covar 매트릭스를 토대로 efficient/tangent 포트폴리오 weight를 계산,
                        역변환이 불가능 할때만 적용가능, 만약 아니라면 라그랑주"""
        def lagVarCovar(self):
                """다른 함수를 위해 매트릭스들을 prepping함"""
        def minVarLagrange(self):
                """라그랑주 사용해서 최소 variance portfolio 계산"""
        def tangentPortfolioLagrange(self):
                """라그랑주 사용해서 최소 variance portfolio 계산"""

1. Welcome to Cisco Networking Basics

By the end of the specialization, you should have progressed through learning what a network is, what makes up that network, and how to connect the various components.
You also learn about the protocols and rules that govern today's IP networks.
By the end of the specialization you will be able to connect all of the components and configure them correctly to create your own functional network.

2. What is the Network?

2-1) Making the Connections


I'm going to hopefully get you started on learning all of the complexities that go on in order for you to be online. Well, online really means that you are connected to a network.
Usually, a network that is participating in the global Internet.
So basically your device, my device, any end-user device is actually connected to another group of devices, so that between me and you there may be 40, 50,100 different paths that my message from me to you can take.

What you see on the table in front of me are some of the devices that might be included.
We have end-user devices.

In any case, all of our communications between source and destination,
you and me, are intermediary devices.
These devices determine the path that your communication is going to take on its way to me,
and mine back to you.

All of these networks are managed independently meaning that different companies and
different carriers and different providers own and manage and maintain their part of the network.

So those networks, the managers and administrators of those networks agree to share a common set of rules and a common set of protocols which is what we call rules in networking,
a common set of protocols that enable communications that originate on one company's network to be able to pass through or go to destinations that are located on another network.

Now, other participants in the global Internet are educational institutions,
governments and corporations and companies of all various sizes.
There's a lot going on between you and me in order to enable us to be online.
One of the goals of this course is to actually help you untangle some of the complexity
that is involved in communications between me and you over the global Internet.
It's also to help you be able to build and understand how small networks work.

2-2) Are You Online?

Normally, when people use the term Internet, they are not referring to the physical connections in the real world. Rather, they tend to think of it as a formless collection of connections. It is the “place” people go to find or share information.

2-3) Who Owns "The Internet"?


The Internet is not owned by any individual or group. The Internet is a worldwide collection of interconnected networks (internetwork or Internet for short), cooperating with each other to exchange information using common standards. Through telephone wires, fiber-optic cables, wireless transmissions, and satellite links, Internet users can exchange information in a variety of forms, as shown in the figure.

Everything that you access online is located somewhere on the global Internet. Social media sites, multi-player games, messaging centers that provide email, online courses – all of these Internet destinations are connected to local networks that send and receive information through the Internet.




2-4) Local Networks

ocal networks come in all sizes. They can range from simple networks consisting of two computers, to networks connecting hundreds of thousands of devices. Networks installed in small offices, or homes and home offices, are referred to as Small Office Home Office (SOHO) networks. SOHO networks enable the sharing of resources, such as printers, documents, pictures and music between a few local users.
In business, large networks can be used to advertise and sell products, order supplies, and communicate with customers. Communication over a network is usually more efficient and less expensive than traditional forms of communication, such as regular mail or long distance phone calls. Networks allow for rapid communication such as email and instant messaging, and provide consolidation and access to information stored on network servers.
Business and SOHO networks usually provide a shared connection to the Internet. The Internet is considered a "network of networks" because it is literally made up of thousands of local networks that are connected to each other.
Review the different types of networks below.



Small Home Networks

Small home networks connect a few computers to each other and the Internet.



The Small Office/Home Office

The Small Office/Home Office or SOHO network enables computers within a home office or a remote office to connect to a corporate network or access centralized, shared resources.



Medium to Large Networks

Medium to large networks, such as those used by corporations and schools, can have many locations with hundreds or thousands of interconnected computers.



World Wide Networks

The Internet is a network of networks that connects hundreds of millions of computers world-wide.

2-4) Making the Connections

The Internet connects more computing devices than just desktop and laptop computers. There are devices all around that you may interact with on a daily basis that are also connected to the Internet.
For example, people are using mobile devices more every day to communicate and accomplish daily tasks, such as checking the weather or sharing pictures.
Many of the things in your home can also be connected to the Internet so that they can be monitored and configured remotely.
There are also many connected devices found in the world outside your home that provide convenience and useful or even vital information.
How many of these devices do you use on a daily basis?
Review the information below to learn more about mobile and commonly found connected devices.



Smart phones are able to connect to the Internet from almost anywhere. Smart phones combine the functions of many different products together, such as a telephone, camera, GPS receiver, media player, and touch screen computer.



Tablets, like smart phones, also have the functionality of multiple devices. With the additional screen size, they are ideal for watching videos and reading magazines or books. With on-screen keyboards, users are able to do many of the things they used to do on their laptop computer, such as composing emails or browsing the web.



A smart watch can connect to a smart phone to provide the user with alerts and messages. Additional functions, such as heart rate monitoring and counting steps, like a pedometer, can help people who are wearing the device to track their health.



Google Glass is a wearable computer in the form of glasses with a tiny screen that displays information to the wearer in a similar fashion to the Head-Up Display (HUD) of a fighter pilot. A small touch pad on the side allows the user to navigate menus while still being able to see through the Google Glass.



Many of the items in a home, such as security systems, lighting, and climate controls, can be monitored and configured remotely using a mobile device.



Television set-top boxes connect to the Internet to provide video, audio, and games on demand. These boxes can often be configured remotely to record selected programs.



Household appliances such as refrigerators, ovens, and water heaters can be connected to the Internet. This allows the homeowner to power them on or off, monitor the status of the appliance, and also be alerted to preset conditions, such as when the temperature in the refrigerator rises above an acceptable level.



A smart TV can be connected to the Internet to access content without the need for TV service provider equipment. Also, a smart TV can allow a user to browse the web, compose email, or display video, audio, or photos stored on a computer.



Many modern cars can connect to the Internet to access maps, audio and video content, or information about a destination. They can even send a text message or email if there is an attempted theft or call for assistance in case of an accident. These cars can also connect to smart phones and tablets to display information about the different engine systems, provide maintenance alerts, or display the status of the security system.



Medical devices such as pacemakers, insulin pumps, and hospital monitors provide users or medical professionals with direct feedback or alerts when vital signs are at specific levels.



Radio frequency identification (RFIDs) tags can be placed in or on objects to track them or monitor sensors for many conditions.



Weather sensors provide temperature, humidity, wind speed, and barometric pressure data.

2-5) Practice Quiz: Lab - My Online Day






3. Transmitting Data on the Network


3-1) What is Data?


Data is its raw form is the information that you input.
Every time you hit send or share or upload, you are sending data that you created somewhere out onto the network.

Now, there are different types of data.

I'm going to talk a little bit first about volunteer data.
Volunteer data is data that you offer yourself.
You realize the data is being collected about you and you are agreeing to share it or to share it somewhere on the network.

The second type of data that you may not realize is actually being collected about you is something we call inferred data.
Inferred data is data that you generate by your activities, for example, your credit card.
Every place that you use your credit card, keeps a record and therefore, if you move about and go to different stores, things are being collected about you like your preferences, the places that you typically eat or shop and also information that helps pinpoint your location.

Now, another type of data is observed data. For example, your phone probably keeps track of your location. Most people have their location services on. That information is also being stored and is being transmitted to your carrier.

hence, the term big data out in  the cloud.

3-2) What Exactly is Data?

We hear about data all of the time. Customer data, personal data, health data, census data, but what exactly is data? Perhaps the simplest definition of data is that data is a value that represents something. In the physical world, we represent data as numbers, formulas, alphabetic characters, and pictures. Think about all of the data that exists just about you. Some examples include birth records, baby pictures, school records, and health records.
Most people use networks to transmit their data in order to share with others or for long-term storage. Every time you hit “send” or “share” in an app or computer application, you are telling your device to send your data to a destination somewhere on the network. Sometimes, data is being sent by your devices and you may not even be aware that this is happening. Examples of this are when you set up an automatic backup utility, or when your device automatically searches for the router in a Wi-Fi hotspot.
Review the three different categories of personal data below.



Volunteered Data

Volunteered data is created and explicitly shared by individuals, such as social network profiles. This type of data might include video files, pictures, text or audio files.



Observed Data

Observed data is captured by recording the actions of individuals, such as location data when using cell phones.



Inferred Data

Inferred data, such as a credit score, is based on analysis of volunteered or observed data.

3-3) How is Data Stored?

When your data is stored on a digital media, the data is not stored in the format that you would think. It's not letters and characters.
What it is it's bits.
Bits is a term that means it's actually an abbreviation for binary digit.

3-4) Activity - The Mighty Bit


Did you know that computers and networks only work with binary digits, zeros and ones? It can be difficult to imagine that all of our data is stored and transmitted as a series of bits. Each bit can only have one of two possible values, 0 or 1. The term bit is an abbreviation of “binary digit” and represents the smallest piece of data. Humans interpret words and pictures, computers interpret only patterns of bits.

A bit is stored and transmitted as one of two possible discrete states. This can include two directions of magnetization, two distinct voltage or current levels, two distinct levels of light intensity, or any other physical system of two discrete states. For example, a light switch can be either On or Off; in binary representation, these states would correspond to 1 and 0 respectively.

Every input device (mouse, keyboard, voice-activated receiver) will translate human interaction into binary code for the CPU to process and store. Every output device (printer, speakers, monitors, etc.) will take binary data and translate it back into human recognizable form. Within the computer itself, all data is processed and stored as binary.

Computers use binary codes to represent and interpret letters, numbers and special characters with bits. A commonly used code is the American Standard Code for Information Interchange (ASCII). With ASCII, each character is represented by eight bits. For example:

Capital letter: A = 01000001

Number: 9 = 00111001

Special character: # = 00100011

Each group of eight bits, such as the representations of letters and numbers, is known as a byte.

3-5) Getting Bits Moving

After the data is transformed into a series of bits, it must be converted into signals that can be sent across the network media to its destination. Media refers to the physical medium on which the signals are transmitted. Examples of media are copper wire, fiber-optic cable, and electromagnetic waves through the air. A signal consists of electrical or optical patterns that are transmitted from one connected device to another. These patterns represent the digital bits (i.e. the data) and travel across the media from source to destination as either a series of pulses of electricity, pulses of light, or radio waves. Signals may be converted many times before ultimately reaching the destination, as corresponding media changes between source and destination.
There are three common methods of signal transmission used in networks:
Electrical signals - Transmission is achieved by representing data as electrical pulses on copper wire.
Optical signals - Transmission is achieved by converting the electrical signals into light pulses.
Wireless signals - Transmission is achieved by using infrared, microwave, or radio waves through the air.
In most homes and small businesses, network signals are transmitted across copper wires (cables) or Wi-Fi enabled wireless connections. Larger networks employ fiber-optic cables in order to reliably carry signals for longer distances.
The animation below is a representation of three different types signals used in networks.



4. It's All about the Speed

4-1) Throughput

In this sections, we're going to demonstrate throughput using the website speedtest.net.
So throughput is the amount of data sent and received over a connection, including any delays that might occur. This includes delays in both directions.

So let's go ahead and take a look using speedtest.net


This is the number of bits per second that is sending.
There are always a good tool to help measure the performance, the amount of data you can send and receive, not just over you network, but also through your internet service provider.

4-2) Measuring Bandwidth


Streaming a movie or playing a multi-player game requires reliable, fast connections. In order to support these “high bandwidth” applications, networks have to be capable of transmitting and receiving bits at a very high rate.

Different physical media support the transfer of bits at different speeds. The rate of data transfer is usually discussed in terms of bandwidth and throughput.

Bandwidth is the capacity of a medium to carry data. Digital bandwidth measures the amount of data that can flow from one place to another in a given amount of time. Bandwidth is typically measured in the number of bits that (theoretically) can be sent across the media in a second. Common bandwidth measurements are:

Thousands of bits per second (kb/s)

Millions of bits per second (Mb/s)

Billions of bits per second (Gb/s)

Physical media properties, current technologies, and the laws of physics all play a role in determining available bandwidth.

The table shows the commonly used units of measure for bandwidth.



4-3) Measuring Throughput


Like bandwidth, throughput is the measure of the transfer of bits across the media over a given period of time. However, due to a number of factors, throughput does not usually match the specified bandwidth. Many factors influence throughput including:
The amount of data being sent and received over the connection
The types of data being transmitted
The latency created by the number of network devices encountered between source and destination
Latency refers to the amount of time, including delays, for data to travel from one given point to another.

Throughput measurements do not take into account the validity or usefulness of the bits being transmitted and received. Many messages received through the network are not destined for specific user applications. An example would be network control messages that regulate traffic and correct errors.

In an internetwork or network with multiple segments, throughput cannot be faster than the slowest link of the path from sending device to the receiving device. Even if all or most of the segments have high bandwidth, it will only take one segment in the path with lower bandwidth to create a slowdown of the throughput of the entire network.

There are many online speed tests that can reveal the throughput of an Internet connection. The figure provides sample results from a speed test.




4-4) Practice Quiz: Activity - Identify Appropriate Definitions


5. Network Components

5-1) Clients and Servers

All computers connected to a network that participate directly in network communication are classified as hosts. Hosts can send and receive messages on the network. In modern networks, computer hosts can act as a client, a server, or both. The software installed on the computer determines which role the computer plays.
Servers are hosts that have software installed that enable them to provide information, like email or web pages, to other hosts on the network. Each service requires separate server software. For example, a host requires web server software in order to provide web services to the network. Every destination that you visit online is provided to you by a server located somewhere on a network that is connected to the global Internet.
Clients are computer hosts that have software installed that enable them to request and display the information obtained from the server. An example of client software is a web browser, such as Internet Explorer, Safari, Mozilla Firefox, or Chrome.
Review more information below on descriptions of the different types of clients and servers.



File Client and Server

The File Server stores corporate end-user files in a central location. The client devices access these files with client software such as Windows Explorer.



Web Client and Server

The Web Server runs web server software and clients use their browser software, such as Windows Internet Explorer, to access web pages on the server.



Email Client and Server

The Email Server runs email server software and clients use their mail client software, such as Microsoft Outlook, to access email on the server.

5-2) Multiple Roles in the Network

A computer with server software can provide services simultaneously to one or many clients, as shown in the figure.
Additionally, a single computer can run multiple types of server software. In a home or small business, it may be necessary for one computer to act as a file server, a web server, and an email server.
A single computer can also run multiple types of client software. There must be client software for every service required. With multiple types of client software installed, a host can connect to multiple servers at the same time. For example, a user can check email and view a web page while instant messaging and listening to Internet radio.



5-3) Practice Quiz: Activity - Match the Network Components


6. Building Blocks of a Network

6-1) Networks Infrastructure Symbols

In this video, we're going to take a look at some of the symbols.
You're going to see throughout the course to represent various types of networking equipment.

In this first screen, we see some of the examples of intermediate devices.
Some of these you may recognize from your own network, such as a router, a wireless router, a switch, and a wireless access point.

Here are some examples of end devices, such as a laptop, printer, smartphone, an IP phone.

And this is example of the symbols that we'll be using for network media, such as LAN media, Local Area Network, most commonly an Ethernet LAN.
WAN media, Wide Area Network media, that's commonly used for internet service provider communications.
Wireless media, and the Cloud which is used to represent another network or the internet.

So you'll see these symbols used throughout this course and other courses.

6-2) Network Infrastructure

The path that a message takes from its source to destination can be as simple as a single cable connecting one computer to another or as complex as a network that literally spans the globe. This network infrastructure is the platform that supports the network. It provides the stable and reliable channel over which our communications can occur.
The network infrastructure contains three categories of hardware components:
  • Intermediate devices
  • End devices
  • Network media
Devices and media are the physical elements, or hardware, of the network. Hardware is often the visible components of the network platform such as a laptop, PC, switch, router, wireless access point, or the cabling used to connect the devices. Occasionally, some components may not be so visible. In the case of wireless media, messages are transmitted through the air using invisible radio frequency or infrared waves.
When documenting your network, it is helpful to make a list of the network infrastructure components installed in your home network. Be sure to include the cables or wireless access points that provide your network connections.







6-3) End Devices

The network devices that people are most familiar with are called end devices, or hosts. These devices form the interface between users and the underlying communication network.
Some examples of end devices are:
  • Computers (work stations, laptops, file servers, web servers)
  • Network printers
  • Telephones and teleconferencing equipment
  • Security cameras
  • Mobile devices (such as smart phones, tablets, PDAs, and wireless debit/credit card readers and barcode scanners)
An end device (or host) is either the source or destination of a message transmitted over the network, as shown in the animation. In order for the intended recipient to receive the message, devices in the network must be uniquely identified. In networks, this is done by assigning each host a unique address. In most networks today, an IP address is used. When a host initiates communication, it uses the address of the destination host to specify where the message should be sent.
Watch the animation of data flowing through a network.



6-4) Quiz: Lab- Exploring My Local Network

7. Week 1 Quiz 


앞서 1편에서 알아보았던 내용을 이어가도록 하겠습니다.
저도 정리하면서 추상적으로 알고있던 내용들을 확실히 알아가서 좋네요.


  • 일반 투자자들의 ELW 주문 등 통상의 전산 처리 과정
  • 스캘퍼가 ELW 시세차익을 확보하기 위한 필요 조건
  • 스캘퍼의 거래방법
  • 알고리즘 매매
  • 증권사의 전산 시스템
  • 일반투자자들의 오해
  • ELW VIP 시스템 구축이 위법한 행위에 해당하는지 여부
  • 결론


증권사의 전산 시스템


전산 시스템 구성 현황도는 위와 같다.

가) 일반 고객 단말과 연결된 주문 처리 시스템

(1) 알고리즘 매매 방식을 이용하지 않는 경우 (ⓓ)


주문 전송 경로 : 

고객이 자신의 컴퓨터에 설치되어 있는 HTS 등을 통하여 주문 지시를 하면 그 주문 정보는 공용망인 인터넷을 통하여 HTS, WTS 서버에 도달한다. 위 HTS, WTS 서버가 바로 공소사실에 기재된 BEP 서버에 해당한다. 접수된 주문 정보는 원장처리시스템이 설치되어 있는 주문 AP 서버로 전달되고, 그곳에서 원장처리절차를 거친 뒤 주문 FEP 서버로 전달된다. 주문 AP 서버에 설치되어 있는 시스템은 주문에 대해 기본적으로 64개 주문유효성 항목에 대한 확인절차를 거친다.
주문 FEP 서버는 거래소 전산 시스템과 증권사 전산 시스템을 연결시켜 주는 '주문 프로세스'가 직접 연결되어 있는 서버로, 고객의 주문을 거래소에 전송하는 마지막 관문에 해당한다.

시세 접수 경로:

먼저 한국거래소가 증권사로부터 접수한 주문 호가 정보와 스스로 체결시킨 매매에 대한 체결 정보를 모두 한국거래소의 자회사인 (주)코스콤으로 전달하면, 코스콤은 그 중 호가 잔량 정보는 '마스터 파일(Master File)'이라고 불리는 원장 파일에 모두 기록한 뒤 위 Master File에 기재되어 있는 정보를 금융상품 별로 분류하여 증권사에 전송하고, 매매 체결 정보는 그대로 증권사에 전송한다.

증권사는 위 정보들을 '시세 수신 스위치(switch)'를 통해 수신한다. 이 때 증권사가 수신한 호가 잔량 정보는 기계어와 각종 프로그래밍언어의 형태로 되어 있는 이른바 미가공 원데이터(raw data)이다. 따라서 증권사는 위 데이터를 고객 컴퓨터에 전송하기 전에 가공하는 절차를 거치는데, 그 과정에서 고객들의 수요에 맞게 시세 정보를 편집하기도 한다.

위와 같은 가공, 편집 절차는 일반적으로 증권사 전산 시스템 내의 '시세 FEP 서버'를 통해 이루어지고, 그 가공, 편집에 소요되는 시간은 평균적으로 0.001초 정도로 알려져 있다.

00증권의 경우 시세 정보가 '한국거래소 - 코스콤 - 00증권 시세수신 스위치 - 시세 FEP 서버 - HTS, WTS 서버 - 인터넷 공용망 - 고객의 컴퓨터 또는 모바일기기'이다.


위 사진은 미가공 데이터의 예시이다.

(2) 알고리즘 매매 방식을 이용하는 경우 (ⓒ)

주문 전송 경로:

알고리즘 매매 방식을 이용하는 경우는 API를 이용하여 개발하는 경우나 증권사에서 제공하는 알고리즘 매매 전용 서버에 고객이 원하는 방식으로 설계된 알고리즘 프로그램을 탑재하는 방식으로 나눠지는데, 전자는 앞서 말한 경우와 같고 여기선 후자에 대해서 설명하겠다. 00증권의 경우에는 'CATS(Computer Aided Trading System) 자동매매 시스템'이라는 전산 시스템을 설치하여 두고 있다. 전산 시스템 구성 현황도의 ⓒ에 해당한다. 
위 CATS 자동매매서버에는 일차적으로 00증권이 개발한 알고리즘 매매 프로그램이 탑재되어 있다. CATS 자동매매시스템을 이용하는 고객들의 주문은 CATS 자동매매서버에서 자체적으로 생성된다. 위 서버에 주문을 내도록 설계된 프로그램이 탑재되어 있기 떄문이다. 따라서 이 경우에는 BEP 서버를 통한 주문 접수 절차가 존재하지 아니한다.
CATS 자동매매서버에서 일단 발주된 주문은 HTS 등을 이용한 주문과 마찬가지로 주문AP 서버로 보내져서 일반적인 원장처리절차를 거쳐 주문 FEP를 통하여 거래소에 전송된다.

시세 접수 경로:

'한국거래소 - 코스콤 - 00증권 시세 수신 스위치 - 시세 FEP 서버 - CATS 자동매매 서버'이다.

나) 기간 FIX 단말과 연결된 주문 처리 시스템 (ⓑ)


주문 전송 경로:

기관 FIX 단말과 연결된 주문 처리 시스템은 개인투자자들을 대상으로 제공되는 시스템이 아니다. 대부분의 증권사들은 기관투자자나 외국인투자자들을 대상으로 그들의 수요에 맞게 설계된 별도의 주문 처리 시스템을 운용하고 있다. 이들의 수요가 개인투자자들과 큰 차이를 보이는 부분은 앞서 본 경쟁려 있는 '주문 집행 알고리즘'에 대한 요구, 대량의 주문을 지연 없이 처리하고 주문 정보를 증권사에 노출시키지 않기 위해 '일반 고객과 구분된 주문 처리 시스템'에 대한 요구, 그리고 기관투자자가 자신들의 대규모 금융자산운용을 위하여 직접 설계하고 운영하고 있는 그들의 전산 시스템과 가장 효율적으로 결합할 수 있는 '맞춤형 시스템'에 대한 요구 등이다.
이 경우 기관 투자자들이 FIX 단말기를 통해 직접 대량의 주문을 위탁하는 지시를 입력하면, 그 지시 내용은 FIX 자동매매서버로 전달된다. 어느 경우이든 FIX 자동매매서버자체에서 주문이 발주되므로 개별 주문에대한 별도의 접수 절차는 존재하지 아니한다.

나아가 FIX 자동매매시스템의 또 다른 특징은, 별도의 사후적인 원장처리절차가 존재하지 아니한다는 것이다. FIX 자동매매시스템은 앞서 본 바와 같이 기관투자자 등을 대상으로 한 시스템으로, 00증권의 경우 위 시스템을 이용하는 고객은 국내 자산운용사, 투자자문사, 외국 금융기관 등으로 구성된 66개의 법인 또는 개인이다. 그런데 이러한 고객들은 한국거래소 파생상품시장 업무규정 제133조에 의하여 사전위탁증거금이 면제되는 투자자들로 각 주문에 대하여 증거금이 충분한지 여부를 원장처리절차에 의하여 확인할 의무가 없다. 또 증권사들을 대체로, 증거금 이외의 주문유효성확인 항목과 관련하여서는 자신들의 주문집행 알고리즘 자체에서 그 유효성 항목에 맞추어 주문이 발주되도록 설계하여 두고 있다. 
결국 00증권에서 FIX 자동매매시스템을 이용하는 고객의 경우 주문 전송 경로는 'FIX 자동매매서버 - 주문 FEP 서버'이다. 그러므로 전산 시스템의 구성 현황도 중 가장 주문 전달 속도가 빠르다.

시세 접수 경로:

'한국거래소 - 코스콤 - 00증권 시세수신 스위치 - FIX 자동매매서버'이다.
시세 FEP 서버를 걸쳐서 시세정보를 가공, 편집하는 절차가 생략되므로 그만큼 시세정보를 받는 시간이 빨라지게 된다.

다) 대신 DMA 시스템 (ⓐ)


주문 전송 경로:

DMA 시스템은 투자자가 금융상품에 대한 자신의 주문을 거래소에 직접 제출하는 방식을 DMA라고 한다. 물리적으로 증권사 전산 시스템을 이용하지 않고 거래소에 주문이 전달되는 보증형 DMA(Sponsored DMA) 방식과 증권사 전산 시스템을 이용하여 거래소에 제출하는 전통적 DMA 방식으로 나뉜다. 원칙적으로 증권사 내부의 업무 처리 절차가 별도로 존재하지 않는다. 

다만 전통적 DMA 방식의 경우에는, 각국의 거래소에서 증권사에게 증권사 전산 시스템 상에 사전에 '일정한 통제장치'를 갖추어 둘 것을 요구하는 경우가 많다. 위와 같은 요구에 따라 증권사는 고객의 주문 중 일정한 요건을 갖추지 못한 주문들이 거래소로 그대로 전달되는 것을 막기 위한 사전적인 통제장치를 두고 있따. 위와 같은 사전적 통제장치의 예가 호가적정성 확인 장치, 리스크 관리 장치 등이다.

전통적 DMA 방식은 고객의 입장에서 증권사에 자신의 주문 정보를 노출시키지 않거나 또는 빠른 속도로 거래소에 자신의 주문을 전달하는 데에 초점을 두고 설계된 것으로, 증권사는 기관투자자 등 DMA 방식을 이용하는 특정고객들과 증권사를 전용회선으로 연결한다. 그 후 고객이 스스로 가지고 있는 수단에 의하여 자신의 주문지시를 그 전용회선을 통해 전송하면, 그 주문시지시는 증권사가 서례해둔 전산 시스템의 상의 일정한 경로를 따라 거래소에 그대로 전달된다.

다만 우리나라의 경우 자본시장법 제388조에서 거래소의 회원 즉 금융기관을 통하지 않고서는 한국거래소에서 거래를 할 수 없도록 규정하고 있으므로 보증형 DMA 방식의 주문은 허용되지 않는다.

위 시스템의 경우 DMA 방식의 주문 서비스를 이용하고자 하는 고객들의 주문 처리를 위하 전용서버인 DMA 서버 자체에 해당 고객들이 직접 개발한 알고리즘 프로그램을 DMA 서버에 탑재할 수 있도록 설계되어 있고, DMA 서버 자체에서 주문이 발주되어 DMA 원장 서버를 거친 뒤 주문 FEP 서버를 통하여 거래소에 주문이 전송되도록 설계되어 있다.

DMA 원장 서버는 기본적으로 주문 AP 서버와 마찬가지로 원장처리절차를 이행하기 위하여 설치된 서버이지만, 주문 AP 서버와 다른 2가지 특징이 있다. 

첫 번째는 주문 AP 서버와는 달리 디스크에 저장되어 있는 정보를 읽어서 주문과 비교하는 방식을 사용하지 않고, '메모리 방식'에 저장되어 이는 정보를 읽는 방식,, 즉 프로세서에 의하여 이미 활성화되어 있는 정보를 읽어서 주문과 비교하는 방식을 사용한다는 것이다.

둘째는 주문과 비교대상이 되는 정보의 양이 다르다. 주문 AP 서버의 디스크에는 모든 고객의 정보가 담겨있지만, DMA 원장 서버에는 DMA 서버를 통해 주문을 전달하기로 증권사와 사전에 약정이 되어있는 해당 고객들의 정보만이 메모리 방식으로 활성화 되어 있다.
이렇게 일반 고객들의 원장처리시스템 보다 간이화되어 있다는 의미에서, 위와 같은 원장처리절차를 '가원장 방식'이라고 부르기도 한다.

시세 접수 경로:

'한국거래소 - 코스콤 - 00증권 시세수신 스위치 - DMA 서버'이다.

라) LP와 ELW 서버의 주문 처리 시스템


(1) 대신 LP 시스템


주문 전송 경로:

위 주문 장치는 블랙숄즈 모델에 의하여 호가를 결정하고 그 호가에 따라 LP의 주문을 발주하는 알고리즘 프로그램이 탑재되어 있다.
LP의 주문은 위 알고리즘 프로그램에 의하여 자동으로 이루어지므로, 물리적으로는 위 ELW-LP에서 주문이 발주된다. 해당 주문은 주문 AP 서버로 전달되어 원장처리절차를 거친 뒤 주문 FEP 서버로 다시 전달된다. 이 경우 원장처리절차와 관련하여 한가지 특징은, 주문 AP 서버에 설치되어 있는 디스크에 저장된 DB를 이용하여 주문유효성 항목을 확인하지만, 총 32개 항목만을 확인하도록 설계되어 있다.

시세 접수 경로:

'ELW-LP' 서버에 탑재되어 있는 알고리즘 프로그램은 미가공 원데이터를 이용하도록 설계되어 있다. 따라서 이 경우 시세정보는 '코스콤으로부터 미가공 원데이터를 직접 수신하도록 설계되어 있다. 따라서 이 경우 시세 정보 접수 경로는
'한국 거래소 - 코스콤 - 00증권 시세수신 스위치 - ELW-LP 서버'이다.


(2) ELW VIP 시스템 (ⓔ) - 이 사건 스캘퍼들에게 제공된 시스템


주문 전송 경로:

위 시스템은 우선 고객이 개발한 알고리즘 매매 프로그램을 ELW 시스템 트레이딩 서버에 직접 탑재할 수 있도록 되어 있다. 따라서 고객이 주문 발주 기능을 갖춘 알고리즘 매매 프로그램을 위 서버에 탑재하면 위 서버 자체에서 주문이 발주가 이루어지게 된다. 
위 서버에 설치된 알고리즘 매매 프로그램에서 직접 발주된 주문은 VIP 주문 서버로 전달되어 원장처리절차를 거치게 된다. VIP 주문 서버는 주문  AP 서버와는 달리 디스크를 사용하지 않고 앞서 본 메모리 방식으로 주문 유효성 항목을 확인하고, 나아가 64가지가 아니라 ELW 거래에 필요한 19가지 항목만 확인하도록 되어 있다.
위와 같은 원장처리절차를 거치고 나면 해당 주문 정보는 주문 FEP 서버로 전달된다. 결국 이 사건 스캘퍼들에게 제공된 시스템에 의한 주문 전송 경로를 요약하면, 
'ELW 시스템 트레이딩 서버 - VIP 주문 서버 - 주문 FEP 서버'가 된다.

시세 접수 경로:

'한국거래소 - 코스콤 - 00증권 시세수신 스위치 - ELW 시스템 트레이딩 서버'이다.

마) 주문프로세스 배분


전산 시스템 구성 현황도에는 나타나 있지 않지만, 주문 FEP 서버로부터 거래소 전산시스템을 연결시켜 주는 전송선을 '주문프로세스'라고 부른다. 주문 프로세스는 거래소 회원관리규정의 요건을 충족하는 증권사들에게 거래소가 배정하도록 되어 있는데, 현재 증권사들은 증권사의 규모에 따라 최대 8개에서 최대 30개까지의 주문프로세스를 배정받아 사용하고 있다.


일반 투자자들의 오해


(1) 일반투자자들 사이에 퍼져 있는 오해의 내용

앞서 본 바와 같이 증권사로부터 속도 관련 서비스를 제공받은 스캘퍼들은 기본적으로 LP 또는 자신들과 마찬가지로 속도 관련 서비스를 제공받은 다른 스캘퍼들과 경쟁하는 관계에 있을 뿐이고, 위 스캘퍼들의 거래로 인하여 일반투자자들이 매매기회를 상실하는 비율은 사실상 무의미할 정도로 미미하다.

(2) 오해의 원인 - 간헐적으로 전송되는 ELW 호가 잔량 정보

LP는 기초자산 가격이 변동된 이후 0.028초 내지 0.036초 사이에 자신의 호가를 변경한다.
코스콤은 '호가 잔량 정보'와 '매매 체결 정보' 두 가지 정보를 각기 다른 방식으로 전송한다.
즉, 호가 잔량 정보는 간헐적으로 전송하는 반면 매매 체결 정보는 모든 정보를 누락 없이 실시간으로 전송한다. 따라서 같은 금융상품 종목에 대한 것이라고 하더라도 증권사가 수신하는 위 두 가지 정보는 일시적으로 차이가 나는 때가 많다. 그러나 증권사는 위 두 가지 정보 사이의 일시적인 불일치를 조정하여 일치시키는 작업을 하지는 아니한다. 

따라서 코스콤에서는 이들 종목의 호가 잔량 정보에 대하여는 소위 '마스터 루핑(Master Looping)'이라는 방식을 이용하여 정보를 전송한다. 
마스터 루핑 반식이란, 일단 모든 호가 잔량 정보를 마스터 파일(Master File)에 기재하여 종목별로 정리한 뒤, 별도의 호가전송 프로세스를 두고 호가전송 프로세스가 다시 위 마스터 파일에 있는 ELW 종목들을 순차로 읽으면서 그 직전에 읽었을 때와 비교하여 호가 잔량 정보가 변경된 종목이 있으면 그 종목만을 인지하여 그에 대한 호가 잔량 정보를 전송하도록 하는 방식이다. 즉 호가전송 프로세스를 통해서 전송하는 정보의 양을 통제하는 것이다.

여기서 중요한 것은 위 호가전송 프로세스의 초당 최대 호가전송 건수가 한정되어 있다는 것이다. 최대 호가전송 건수를 초과하는 나머지 초과 종목들에 대해서는 최초의 변동 시점으로부터 1초가 지난 이후부터 호가 잔량 정보의 전송이 시작되는 것이다. 이런 의미에서 마스터 루핑 방식을 '호가 잔량 정보를 간헐적으로 전송하는 방식'이라고 표헌하는 것이다.


ELW VIP 시스템 구축이 위법한 행위에 해당하는지 여부

문제가 되는 공문의 내용 3가지)

1. 스캘퍼들이 시장을 교란할 가능성이 있으므로 LP의 호가 제출기간을 늘려 위 가능성을 차단하되 LP 자체에 대한 규제 역시 강화하고,
2. 증권사가 스캘퍼들을 우대하는 행위에 대하여 대응하겠다.
3. 거래소 매매체결과 관련한 '시간우선원칙'의 훼손을 우려

3번에 해당하는 공문은 앞서 본 보증명 DMA 중 순수 DMA를 금지하고, 증권사 FEP 서버와 한국거래소 사이의 주문프로세스를 특정 위탁자에게 전용회선으로 배정하는 것을 금지하는 내용이다.

나머지 내용들은 생략하겠습니다. 정리하자면, 문제가 안 된다는 내용입니다.


결론

1. ELW는 동일한 내용의 옵션 상품에 비하여 높은 가격으로 최초에 판매되고(평균 24%이상 고가임.) 그 후로는 시간가치의 감소로 인하여 내가격의 ELW를 제외한 나머지 종목은 모두 만기가 가까워질수록 가격이 0원에 수렴하게 되는 '초고위험 상품'이다. 옵션 상품에 비하여 높은 가격 때문에 기관 투자자들과 외국인투자자들은 ELW 시장에 거의 참여하고 있지 않고, 소액 투자로 큰 이익을 노리는 개인투자자들이 대부분을 차지하고 있다.

2. ELW 시장은 '1(LP) 대 다수(주로 개인투자자들)'의 대향적 관계가 형성되어 있고, LP가 ELW 가격결정력을 행사할 뿐만 아니라 '장 초반 공급독점, 장 중 대량 호가 제출, 장 막판 수요돚ㄱ점'의 형태로 우월적인 지위를 누리고 있다. 이는 다수 대 다수의 대향적 관계가 형성되어 있는 일반 유가증권시장과는 매우 다른 특수한 구조이다. 그런데 내가격의 ELW를 제외한 나머지 ELW 종목의 가격이 만기가 가까워질수록 0원에 수렴하게 되므로, 현재 개인투자자들이 다수 활용하고 있는 '만기가 얼마 남지 않은 저가의 외가격 ELW에 대한 투자 방식'으로는 단기간 내의 기초자산의 가격이 개인투자자들이 원하는 방향으로 급격하게 변동하여 행사가격에 진입'하는 경우 매우 이례적인 경우를 제외하고는 대부분의 개인투자자들이 손실을 보게 된다.

3. 2009년 하반기부터 우리나라 ELW 시장에 등장하기 시작한 것으로 알려져 있는 스캘퍼들은, 딜러인 LP의 호가 제시 과정에 많게는 0.016초 정도의 'LP 지연 효과'가 발생한다는 점을 이용하여 그 틈새를 파고들어 대부분 LP를 상대로 매도, 매수함으로써 수익을 추구하는 투자자들이다. 일반투자자들의 거래 기회를 박탈하는 경우가 거의 없다고 판단되는 이유는
1) LP는 스스로 ELW 호가를 변경하지 않는 경우에는 투자자들을 유인하기 위하여 호가 물량을 지속적으로 재공급해주고,
2) 스스로 ELW 호가를 변경하는 경우에는 인간이 인식할 수 없을 정도의 빠른 속도로 호가를 변경하기 때문이다.

그럼에도 일부 일반투자자들이 스캘퍼가 자신의 거래 기회를 박탈한다고 오해하는 이유는, 한국거래소의 자회사인 코스콤이 증권사를 통해 투자자들에게 전송하는 시세 정보 중 'ELW 호가 잔량 정보'가 지연 전송되거나 누락되기 떄문이다. 코스콤은 마스터 루핑 방식으로 전송하는 'ELW 호가잔량 정보'의 초당 전송건수를 점진적으로 증가시키고 있으나, 코스콤과 시세 FEP 서버를 연결하는 회선 대역폭의 한계로 인하여 현재에도 여전히 평균적으로 1.3 내지 1.4초의 전송 지연이 일어나고 있다. 

4. 이 사건에서 00증권이 스캘퍼에게 제공한 속도 관련 서비스들의 5가지 구성 요소들을 대부분 증권사들이 주로 기관투자자들과 외국인투자자들을 대상으로 기존부터 제공해 온 DMA 서비스의 일부이다. 또 알 고리즘 매매 프로그램을 증권사 내부 서버에 탑재하는 서비스는 증권사가 알고리즘 매매를 원하는 일반투자자들에게 기존에 제공하여 온 서비스와 사실상 동일하다. 위 DMA 서비스 및 알고리즘 매매 서비스에 대하여는 현재까지 법률에서 이를 금지하는 규정을 두거나 금융 감독 기관에서 위 서비스 자체를 제공하지 않도록 규제한 적이 없다. 
나아가 금융위원회, 금융감독원, 한국거래소 등 금융 감독 기관은 현재까지 '주문 처리과정에서 속도의 차이가 없어야 한다.'는 원칙을 명확하게 선언하거나 그 실현가능한 방법과 기준을 제시한 바가 없다.




여기까지 고빈도 매매에 대한 판결문을 분석해보았습니다.
HFT 자료가 부족한 한국 시장에서 이렇게 상세한 정보를 얻기는 쉽지가 않은 것 같습니다.

고빈도 매매의 전체적인 흐름을 알기위해 HFT에 대한 자본시장과 금융투자업에 관한 법류위반 항목에 무죄가 판결된 사건을 분석해보도록 하겠습니다.

2011년 11월 28일에 판결선고가 이루어진 사건입니다.
168페이지에 해당하는 판결문이기 때문에 방대한 양의 분석을 해야 합니다.
판결문 전문을 읽고 싶은 분은 아래의 링크에서 다운받으시면 됩니다.

판결문

저는 이 판결문에서 아래의 항목들에 대해 중점적으로 다뤄보도록 하겠습니다.
앞 부분은 관련 지식에 대한 부분들이 많고 뒷 부분으로 갈수록 점점 시스템에 대한 부분들이 많이 나오니까 전부 알아보시는 것을 추천드립니다.
이번 편에서는 위의 4가지만 알아보도록 하겠습니다.


  • 일반 투자자들의 ELW 주문 등 통상의 전산 처리 과정
  • 스캘퍼가 ELW 시세차익을 확보하기 위한 필요 조건
  • 스캘퍼의 거래방법
  • 알고리즘 매매
  • 증권사의 전산 시스템
  • ELW VIP시스템의 각 구성요소들에 대한 개별적인 검토
  • 일반투자자들의 오해
  • ELW VIP 시스템 구축이 위법한 행위에 해당하는지 여부
  • 결론



일반 투자자들의 ELW 주문 등 통상의 전산 처리 과정

일반 투자자가 ELW를 매매 시, 통상의 경우, 증권회사 전산망 외부에서 일반 투자자 개인 PC의 HTS 프로그램을 이용하여 ELW 매매주문을 발송하는바, 그 매매 주문은 인터넷 통신망을 통하여 
1. 증권회사 내부 접속서버 (일명 BEP 서버)에 접속
2. 증권회사의 상품주문서버에서 원장확인절차(본인확인, 계좌유효성확인, 증거금 확인 등) 금융상품 매매 주문 처리가 이루어진 후
3. 거래소와 직접 연결된 증권회사 내부 대외계 서버(일명 FEP 서버)를 거쳐 매매 주문이 도달된다.

또한 일반 투자자가 특정 ELW 매매의사 결정을 위해 필수적인 정보인 해당 ELW 및 ELW 기초자산과 관련된 시세정보는 
거래소의 자회사인 KOSCOM - 증권회사 시세 FEP 서버 - 시세정보 편집이 이루어지는 증권회사 시세서버 - 증권회사 BEP 서버 - 일반 투자자 PC 의 순서로 전달된다.

스캘퍼가 ELW 시세차익을 확보하기 위한 필요 조건


ELW 시장에서는 스캘퍼가 매매차익을 얻기 위해서는 LP가 ELW 가격변동 요인을 ELW 가격에 반영시키 전에(즉, LP가 기존 매도호가를 취소하고 새로운 매매호가를 제시하기 전에) 기이 형성된 가격으로 매수한 다음 새로운 매매호가가 제시되면 이를 매도하여야 하고, 이를위해서는 LP가 ELW 호가를 변동시킬 것으로 예상되는 특정 ELW 종목에 대한 스캘퍼의 매매 주문이 일반 개미투자자나 다른 스캘퍼보다 빠르게 증권회사를 거쳐 거래소에 도달시켜 매매가 체결되도록 할 필요가 있다.

특히 ELW 시세차익 확보를 위해 컴퓨터 프로그램화된 초단타 매매 전략을 사용하는 스캘퍼의 입장에서는, 자신의 알고리즘 매매 프로그램이 탑재된 컴퓨터에서 이루어진 ELW 매매 주문이 인터넷 통신망을 통하여 증권회사에 전송될 경우에 나타날 수 있는 '매매 정보 등 DATA 전송 속도의 저하'를 방지하고 그 DATA 전송 속도를 가능한 빠르게 하여야 하며, 또한 1초당 수십 건 까지 계속하여 자동으로 발송될 수 있는 스캘퍼의 ELW 매매 주문이 증권회사 내에서 신속히 처리되도록 'ELW 주문 처리속도를 향상'시키는 것이 ELW 시세차익 확보의 필요조건이 된다.

이를 위해서,


(1) DATA 전송 소요시간을 단축시키기 위해, 스캘퍼 컴퓨터와 거래소 사이 전산망의 물리적 총 거리를 단축시키거나 스캘퍼 컴퓨터와 증권회사를 인터넷으로 연결하여 ELW 매매 DATA를 전송하는 경우 반드시 거치게 되는 중계 및 보안장치(라우터, 방화벽 등) 등을 거치지 않도록 하는 방법이 필요하고, 이를 위해서는 스캘퍼의 ELW 알고리즘 매매 프로그램이 탑재된 컴퓨터를 증권회사 내부 전산망에 직접 연결시키고, 

(2) 스캘퍼 전용 증권회사의 BEP · 상품주문처리 서버 · FEP 서버를 설치 및 전용하거나(스캘퍼 전용 증권회사 서버 이용) 

(3) 주문의 유효성 관리 항목을 스캘퍼 주문 ELW 주문에는 

1. 소수의 스캘퍼 정보로만 구성된 DB를 구축, 사용하여 스캘퍼 정보를 검색, 확인하는데 소요되는 시간을 단축시키고 
2. 주문의 유효성 관련 확인 항목 역시 일부를 생략시켜 처리 소요시간을 단축시키거나 (가원장확인) 

(4) 스캘퍼는 증권회사의 시세정보 편집 등의 절차가 생략된 채 시세 정보를 받아야 한다.(시세정보 우선제공)


스캘퍼의 ELW 거래기법

대부분의 LP가 호가를 결정하기 위한 이론가를 계산 할 때 블랙숄즈 모델을 사용한다는 사실은 증권사에는 널리 알려져 있다. 따라서 스캘퍼는 ELW가격에 대한 독립적인 가치평가를하지 않고 LP가 사용하는 블랙숄즈 모델을 이용하여 LP의 호가를 예측하게 된다. 예측방법은 다음과 같다.

블랙숄즈 모델에서 사용되는 6가지 요인 중 내재변동성을 제외한 5가지 요인은 LP와 관계없이 결정되어 있는 것이기 때문에 LP와 동일한 방식으로 ELW 이론가를 계산해내기 위해서는 내재변동성 항목만 알아내면 된다.
LP가 사용한 과거의 내재변동성 수치를 알아내는 일은 어렵지 않다. 당해 ELW 종목의 과거 특정 시점에서의 기초자산 가격과 LP의 매도 · 매수호가를 알면, 앞서 본 블랙숄즈 모델이라는 계산식을 사용하여 역산하는 수학적인 방법을 통해 그 특정 시점의 내재변동성 수치를 추정할 수 있기 떄문이다. 그런데 위 내재변동성 항목은 매분 매초 실시간으로 변경되는 것이 아니고 장 중 수차례 변경되는 것에 불과하다. 

스캘퍼들은 이러한 점에 착안하여, 과거의 기초자산 가격 및 LP의 호가변화와 관련된 충분한 데이터를 인식 · 수집하고 이를 기초로 내재변동성 수치를 추정한 뒤 기초자산 가격을 기초로 LP가 새롭게 제출할 호가를 예측하는 기능을 갖춘 전산 프로그램을 개발한다.

(1) 스캘퍼의 매수방법

스캘퍼는 위와 같이 개발한 전산 프로그램을 통하여 ELW의 매수시기를 포착하게 된다. 기초자산의 가격이 변동된 경우 중 그 변동의 결과로 인하여 LP가 호가를 변경할 것이라고 예측되는 순간, 구체적으로 LP가 호가를 높일 것이라고 예측되는 순간에 앞서 본 LP 지연효과를 이용하여 LP가 호가를 변경하기 직전, 즉 LP이 기존 호가물량이 취소되기 직전에 그 호가물량을 매수한다.


00증권이 LP로 활동하는 경우 약 0.028초 내지 0036초의 LP 지연효과가 발생했다. 그런데 00증권의 전산데이터 확인 결과, 이 사건 스캘퍼들의 주문은 발주에서 거래소 도달까지 소요되는 시간이 LP의 주문보다 0.008초 내지 0.0016초 전 빠른 것으로 나타났다. 그렇다면 스캘퍼들의 주문은 가장 빠를 때에는 기초자산 가격이 변동한 시점으로부터 0.020초가 지난 시점에 거래소에 도달하게 된다. 따라서 이 사건 스캘퍼들은 LP가 자신의 호가를 변경하기 전에 변경 전 매도 호가 물량에 대해서 매수주문을 체결시킬 수 있게 된다.

(2) 스캘퍼의 매도방법

스캘퍼가 위와 같이 ELW를 매수하게 되면 그 직후, 즉 0.008초 내지 0.016초 후에 LP가 호가를 높이게 된다. 그 후 스캘퍼가 확보한 ELW 물량을 매도하는 방법ㅇ로는 다음과 같은 두 가지 방법이 있다.

첫 번째는 스캘퍼가 최소한의 매매차익을 얻을 수 있을 정도로 LP가 ELW 호가를 높일 때까지 기다렸다가 그 정도로 호가가 오르면 바로 차익을 실현하는 방식이다.
이 경우에는 LP의 호가가 스캘퍼의 매수시점보다 2틱 이상 높아져야 한다.

두 번쨰는 LP의 호가가 몇 틱이 오르는지에 대하여는 아무런 관심을 두지 아니하고, 오직 기초자산 가격의 변동으로 인하여 LP가 호가를 하락시킬 것으로 예측되는 시점을 기다렸다가 LP 지연효과를 이용하여 LP가 기존 호가를 취소하기 직전에 매도하는 방식이다.

첫 번째 방식은 LP의 호가가 1틱 상승했다가 다시 하락하는 경우에 손실을 피할 수 없다는 단점이 있는 반면, 두 번째 방식은 1틱 올랐던 LP의 호가가 다시 원상태로 돌아가려고 하는 것으로 예측되는 때에는 그 직전에 ELW를 매도함으로써 수수료부담을 초과하는 매매차손을 회피할 수 있어 위와 같은 단점이 없다.

알고리즘 매매

알로기즘이란 과업을 수반하는 일련의 지시인데, 이렇나 지시 중 인간의 의사표시에 의하지 않고 컴퓨터 프로그램 등과 같이 자동화된 방법으로 이루어지는 지시에 따라 금융상품의 매매 기회를 인지하고 주문을 집행하는 매매유형을 알고리즘 매매라고 한다.

알고리즘 매매에 필요한 요소는 '알고리즘 프로그램', '위 프로그램을 탑재하는 전산 시설' 등이다.

알고리즘 매매는 그 유형을 다시 전략 알고리즘(strategy algorithm)과 주문집행 알고리즘(execution algorithm)으로 분류할 수 있다.

전략 알고리즘이란 매매기회를 인지하고 매수, 매도의 의사결정을 내리는 과정 자체를 자동화 한 매매유형으로, 알고리즘 프로그램으로 하여금 각종 분석지표, 즉 가격의 움직임, 거래량, 일중 시간대 등을 분석하여 매수 또는 매수 주문을 낼 것인지 여부를 자동으로 결정하도록 하는 매매유형이다.

이와 달리 주문집행 알고리즘은 주로 증권사가 기관투자자의 주문 내용을 위탁받아서 그 위탁취지대로 구체적인 주문을 거래소에 전달하는 과정에서 사용되는 알고리즘이다.
통상 기관투자자는 대량의 거래를 하기 때문에 증권사에 자신의 주문 내용을 위탁할 때 '종목, 목표수량, 목표가격' 등을 범위로 지정하는데, 그 지정된 범위 내에서 실제로 기관투자자에게 얼마나 유리하게 대량의 거래를 체결시킬 수 있는지 여부는 증권사가 구체적으로 주문수량을 어떻게 분할하여 어느 시점에 주문을 내느냐에 따라 달라질 수 있다. 이 부분과 관련하여 주문수량 분할 및 주문 시점 등에 의한 의사결정만을 자동화 한 매매유형을 주문집행알고리즘이라고 한다. 주문집행알고리즘 프로그램에 의하여 이루어지는 의사결정의 예로는 시간 분할 (time slice) 주문, 거래량 가중 평균 가격(volume weighted average price) 주문, 시간 가중 평균 가격(time weighted average price) 주문 등이 있다.