translation

This is an AI translated post.

(로또 사는 아빠) 살림 하는 엄마

A record of the development trials and tribulations of Korea Investment & Securities API

Select Language

  • English
  • 汉语
  • Español
  • Bahasa Indonesia
  • Português
  • Русский
  • 日本語
  • 한국어
  • Deutsch
  • Français
  • Italiano
  • Türkçe
  • Tiếng Việt
  • ไทย
  • Polski
  • Nederlands
  • हिन्दी
  • Magyar

Summarized by durumis AI

  • This article shares the difficulties encountered in developing an automated trading program using Korea Investment & Securities API, particularly explaining the process of solving the Websockets problem for receiving real-time data.
  • The difficulties encountered in the development process were mainly due to the developer's lack of skills and experience. However, searching the github repository, we found Soju06's python-kis repository and got a clue to solve the problem.
  • There are still difficulties with the trading methodology, but we were able to gain a lot of experience in understanding and implementing the client's trading criteria.

I have almost finished developing the Korea Investment & Securities API. It's becoming a real series, isn't it? I'm feeling self-loathing and sad because of the tough process, even though no one said anything. I guess those who are good at this will create something like this in one go. I envy their intelligence and talent. Still, I remind myself that life is not made up of only good people and comfort myself.


This is the 5th article, but there's nothing special. It's a cynical story about the process of creating an automatic trading program using the Korea Investment & Securities API. Still, I'm really grateful to those who read it. +_+

When you can't solve the problem, try the solutions you've prepared until you solve it. try except


I've written about the difficulties I've encountered while developing the Korea Investment & Securities API. Some of them are not due to Korea Investment & Securities, some of them are right, but if I summarize the difficulties again, they are as follows.


  • Opening a Korea Investment & Securities account (ISA account transfer failure case)
  • Mock trading not supported
  • Websockets - Receiving real-time data
  • Trading methodology

I opened an account by visiting a nearby branch. Luckily, there was a branch 40 minutes away, so I was able to open it. If you are not in the metropolitan area...not in a metropolitan city...and you live in a place where the water and air are clean, I really hope that you can open an account non-face-to-face. Anyway, you need to open an account to try developing using the API, so open it according to your situation.

The lack of mock trading isn't really a critical issue. It's just a little uncomfortable. What if I get a margin call when I buy? What if I keep creating real-time investment tokens and my account gets blocked? ... It's a feeling of nervousness. But those who are good at developing wouldn't worry too much about this. It's due to my lack of skill and experience in stock programming. Also, Websockets didn't work as I expected because of my lack of programming skills. It's all my fault. ㅠ_ㅠ

Websockets were the problem. My lack of skills was caused by Websockets!! But it was really hard to get a feel for how to solve it with the existing examples provided. In this situation, I thought there were "several options for the next action."


  • Learn Websockets to smash this problem!!
  • Find out how others solved this problem!!


The easy way is to search. Of course, I chose option 2. I searched on the Korea Investment & Securities KIS Developer site using several keywords, but I couldn't find a good answer. (Almost all of them were secret questions. What the heck..) Next is ChatGPT's turn. But I don't know what to ask. "I'm using Websockets to receive real-time data while developing the Korea Investment & Securities API. The following is the source code currently being applied. But in this state, I want to add and delete the transaction price, bid price, and transaction information in real time. What should I do?"


I can't do anything without ChatGPT...


It's so good to have sample code... But the sample code seems to have the same result...


As a last resort, I searched the Github repository.

I love github. It's so lucky that there are so many people who practice sharing in the world.


I searched for "koreainvestment" and a lot of repositories came up. The first one is Korea Investment & Securities' official Github, so I passed it. The second one is JoCoding's repository, which you can naturally pass if you've watched the 20-minute YouTube video earlier. The third name is really appealing. Soju06's python-kis!! (I don't know if you like Soju or if your name is Soju, but I'd like to thank you again for your kindness. ❤️) I went into this repository and explored it, and it seemed like work was done on domestic stocks, but it seemed like overseas stocks hadn't been worked on, so I was going to skip it, but I saw a clue to solving the Websockets problem right now. No, no. After testing it with domestic stocks, I realized that the Websockets problem was solved and working. +_+ I decided to take this and make it work for overseas stocks as well. And I tried to see the source, but my Python skills were not enough to understand what Soju06 had done. But I found out that it uses websocket, websocket-client instead of Websockets, and I was able to solve the problem by using only this part. It's great to know deeply, but not knowing deeply doesn't mean you can't create something. I felt that again. (Life is beautiful because of that~ 🎶)

Out of the difficulties mentioned earlier, the trading methodology remains. Trading methodology is still difficult. And if there was an answer, the person who knew the answer would have taken all the wealth in the world. This doesn't mean that we should look at trading methodology pessimistically. We need a buying/selling criteria to automate stock trading. That's what the trading methodology is. There's no right answer, but it's something logical that's needed. What the heck, the words are getting strange. Anyway, it's still difficult to understand the trading methodology. Still, it's good to think about why the person who requested it wants to take this criteria, because it gives me a lot of experience.

I've gone through this kind of trial and error, and I'll continue to go through it, but I hope it helps if you're having similar worries. Or if you know a better way, please help a foolish being with a mind to enlighten him. I welcome any comments, emails, or open chats.



In addition, I accept requests to create automated stock trading programs. In order to implement your own trading strategy that you've been thinking about, you need to implement the logic, which is a really difficult process to learn programming. That's why you end up covering it with money. But even if you want to cover it with money, it's difficult to find someone who will create it exactly as you think. I'm not saying I'm that kind of person, but if you feel like I have some potential, feel free to ask. The cost will be determined when we decide to actually develop after discussing the trading methodology thoroughly. One of the good ways to organize your trading strategy in your head is to explain it to someone. That way, you can be more specific. I'll help you. I'll be getting help too. ❤️



김진혁
(로또 사는 아빠) 살림 하는 엄마
아빠는 로또를 사면서 대박을 기원합니다. 엄마가 살림 하면서 얻은 정보를 공유합니다.
김진혁
Difficulties Encountered While Developing the Korea Investment & Securities API This blog post delves into the challenges and solutions encountered during the development process of the Korea Investment & Securities API. It shares a developer's experiences and tips, covering topics like account opening, ISA account transfer, unsuppor

April 23, 2024

Korea Investment & Securities API Development Reference This blog post describes the process of collecting information needed to develop an automated trading program using the Korea Investment & Securities API. You can get the information needed for automated trading program development using various material

April 22, 2024

Building an Automated Trading Program Using Korea Investment & Securities API Korea Investment & Securities API is the only one in Korea that supports overseas stock investment, and it is possible to develop in various environments such as Windows, Mac, and Linux without installing a program through REST API and Websocket methods.

April 22, 2024

3 Things to Tell a First-Time Individual Investor This is advice for individual investors who are starting to invest in stocks, focusing on value investing strategy and a positive mindset. Value investing is a strategy that finds the probability that the market will be wrong in the short term, buys it, a
고집스런가치투자
고집스런가치투자
고집스런가치투자
고집스런가치투자

April 3, 2024

Why You Should Approach Investment with a Probabilistic Mindset: You’ll Never Know the Exact Cause of Investment Outcomes Investment outcomes are significantly influenced by luck, not just skill, and it is impossible to determine the exact cause. Therefore, investment should be approached with a probabilistic mindset, fighting as much as possible in favorable situations and
고집스런가치투자
고집스런가치투자
고집스런가치투자
고집스런가치투자

April 3, 2024

Where Individual Investors Have an Advantage Over Private Equity: Cash Can Be Used As Quickly As Possible, and Not All of It Needs to Be Used Private Equity tends to invest fund capital quickly to achieve high returns, which can lead to reckless deals. Especially in the case of Blind Funds, where the investment targets are not determined, quick investment is even more important, and the rush to
고집스런가치투자
고집스런가치투자
고집스런가치투자
고집스런가치투자

April 3, 2024

[Non-major, Survive as a Developer] 16. New Developer Portfolio Writing Tips New developers (especially non-majors) need to clearly explain not only the technology but also the developed services or functions when writing a portfolio. For example, if the project is a "job seeker community", you need to include specific job descrip
투잡뛰는 개발 노동자
투잡뛰는 개발 노동자
투잡뛰는 개발 노동자
투잡뛰는 개발 노동자

April 3, 2024

How to Increase Your Investment Win Rate: 1) Don’t Get Caught Up in the Majority Opinion, 2) Be Strict with the Results To increase your investment success rate, you shouldn’t get caught up in the majority opinion, and you need to be strict with the results. Through humility about success and a cold analysis of failure, you can improve your investment skills.
고집스런가치투자
고집스런가치투자
고집스런가치투자
고집스런가치투자

April 3, 2024

An Alien Application Developer's First Story This is the story of a developer who started a global blog by choosing durumis. The goal is to promote an international dating application using 38 language support and automated YouTube translation tools. He is also the operator of an international coupl
Alien Story
Alien Story
Alien Story
Alien Story
Alien Story

April 21, 2024