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

Basic Structure of Automated Stock Trading (Updating...)

Created: 2024-04-22

Created: 2024-04-22 23:56

It feels like it's becoming a series somehow. However, this time, I'd like to summarize what kind of development I've considered for automated stock trading. (This is a simple listing for organizational purposes and may be subject to change at any time.) Regardless of which brokerage firm you develop with or which trading method you apply, the basic mechanism seems to be similar. I believe that a good automated stock trading program can be created if these basic functions work well, and then features specific to the brokerage firm are implemented or the functionally deficient parts are filled in.

  • Prepare the development environment
    • Open an account
    • Install HTS, MTS, and related APIs
    • Apply for API
    • Apply for paper trading
    • Apply for overseas securities trading
    • Programming language selection - python
  • Development
    • Account
      • Login (real / paper)
      • Setting value management
      • (If necessary) Token management
    • Implement basic functions (domestic / overseas)
      • Account inquiry
        • Available funds
        • Balance
      • Basic inquiry
        • Per stock - current value, chart data inquiry
      • Real-time inquiry
        • Execution price
        • Order book
        • Execution
      • Trading
        • Buy/Sell
        • Modification/Cancellation
        • Order execution
        • Unfilled orders
      • Report (Notification)
        • Period profit/loss
        • Messenger notification
      • UI
        • Library selection - qt5
        • Components
          • Table (grid)
          • Combo box
          • Radio button
          • Button
      • Other utilities
        • Timezone - overseas stock trading related time / Korean time - daylight saving time
        • Log
        • Information storage - file, DB
    • Core logic implementation
      • Stock selection
        • Stock selection method for monitoring
      • Trading method
        • Whether to use partial trading
      • Trading conditions
        • Buy/Sell conditions
  • Operation
    • Test
      • Simulation (paper trading)
    • Automation
      • PC (or server) settings
    • Prayer/Hope
    • Feedback / Detailed logic adjustment

By performing these steps, you can create and operate an automated stock trading program. Sometimes, items may be omitted or items that need to be focused on may arise, but I think it will not be outside this framework.

Basic Structure of Automated Stock Trading (Updating...)

May it help us avoid being swayed by the highs and lows.


The important thing is that you have chosen stock investing as your investment method, and your primary goal should be to make a profit. (We must make sure that automated trading does not become the goal itself. Automated trading is merely a means to an end.) The trading method I chose has been profitable recently, but looking at the results, 2022 was truly bleak. Nevertheless, it's the methodology I chose, so I just let it run. Furthermore, recently I've not only recovered my principal but also made a profit, but that still doesn't feel like a truly joyous occasion. It just has to be that way. So, when entering the operation phase, while there's a desire to pray/hope for profits, there's an even greater desire for my own mind not to "rejoice and grieve excessively." I hope you all can continue investing with a strong mind.

Comments0