![translation](https://cdn.durumis.com/common/trans.png)
This is an AI translated post.
Difficulties Encountered While Developing the Korea Investment & Securities API
- Writing language: Korean
- •
-
Base country: All countries
- •
- Information Technology
Select Language
Summarized by durumis AI
- This post details the difficulties experienced during the development of the Korea Investment & Securities API. Specifically, it candidly discusses challenges related to account opening, ISA account transfer, lack of mock trading support, real-time data reception via websockets, and understanding trading methodologies.
- It highlights the lack of familiarity with ISA account characteristics, the psychological burden felt even without actual trading on a live trading account, the difficulties caused by insufficient understanding of websockets, and fundamental questions about trading methodologies, sharing the challenges encountered throughout the development process.
- This article is based on the experience of opening a Hana Securities account about two weeks ago (as of May 30, 2024). It honestly shares the challenges faced during development and expresses a determination to find solutions in the future.
I wrote less about developing the Korean Investment & Securities API than I expected. While the previous posts were general and basic, this post describes the process of how I overcame the difficulties and trial and error I encountered during the process. Let's start with the difficulties, shall we?
Stock trading is difficult, but creating a program that does it automatically is even more challenging.
Opening a Korean Investment & Securities Account
The first difficulty I faced when I decided to develop was one that may have been unique to me. ㅠ_ㅠ It was opening a Korean Investment & Securities account. I had opened a Hana Securities account about two weeks ago for a similar reason, so I was unable to create a non-face-to-face account immediately. I forgot that there was a 20-day restriction period. Still, I needed to open an account, so I looked for a branch of Korean Investment & Securities in the area. Luckily, there was one about 40 minutes away (?) and I was able to visit and open an account.
ISA Account Transfer Failure +_+
Actually, I tried to create a non-face-to-face account first, but it was written as if transferring an ISA account opened at another bank would work immediately. I should have checked more carefully, but I agreed hastily because I needed to open an account quickly. The account was created easily, the API application was processed, and I was happy to see that the domestic API test was working well...
I found out that overseas stock trading requires a separate application. I thought it would be done automatically since I had created an account. ㅋㅋㅋㅋ I found out that I couldn't trade overseas stocks with an ISA account. It was obvious because of the nature of the ISA account, but I didn't know much about ISA accounts and I still don't. I just learned for sure this time that you can't trade overseas stocks with an ISA account.
Anyway, I visited the branch and opened an account, and the ISA account was transferred back to the previous bank. (The previous bank also called me and said that it would be returned if I didn't agree... Anyway, the ISA account seemed to be special.)
Anyway, stock trading is always easy, but the process of opening an account, installing HTS, MTS, and setting it up to trade is really difficult. Still, I created it and was able to develop through it.
Mock Trading Not Supported
REST API was really easy because it had a postman example. You could immediately check the data being requested and received, and you could convert it directly into python code through postman. However, there were quite a few functions that didn't support mock trading. While these features were not critical, it was inconvenient to have to check them in a live trading account. Checking in a live trading account wouldn't be a problem if you weren't actually trading, but I felt psychologically uneasy and the situation was uncomfortable. I hope Korean Investment & Securities will improve these aspects over time.
Websockets - Real-time Data Reception
The next difficult part was receiving real-time data through websockets.
In this part, the logic that continuously receives data is executed. I think I need to modify it so that I can send additional commands without being affected, but I couldn't find a way. This seems to be due to my lack of understanding of websockets, but also my lack of general understanding of programming languages. I will update it again when I find a solution in the future.
I don't understand websockets... Is it an infinite loop...? How do I properly connect events...? Threads... Ugh...
Trading Methodology - Molu?!
Finally, it was difficult to understand the trading methodology that users want. My trading methodology, the grid trading method, does not involve buy/sell techniques. This is because I buy/sell according to the values I set. However, typical trading methods are designed to move according to various situations, so they make buy/sell decisions based on conditional values. They gather minute data, place moving averages, and make buy/sell decisions based on ranges such as Bollinger bands. Technically, calculating conditional values is just a matter of applying a set formula, but I have a fundamental question about why we trade using this method. And I haven't gotten a good answer yet. The more I study stocks, the more difficult it seems. ^^;; (It should be 50/50 up and down, but why am I always on the downside?!)
I don't know... why it goes up and down... when to buy and sell...
I think there were many other difficulties besides these. But isn't it life to roll around and find a way to solve it? Next, I'll write about the trial and error process and alternatives for those difficulties. Fighting!!