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

Building a US Stock Automated Trading Program 2.0

Created: 2024-04-20

Created: 2024-04-20 08:36

It's been 2 years since I wrote the content below. If you're curious about the results, please check out the retrospective post first.


In the previous post, I thought I should create a US stock automated trading program version 2.

It was around 12/19 (Sun) morning when I had that thought, and I started preparing from that evening after dinner.

Since I had created version 1 once and the basic environment was already in place, I was able to prepare quickly.

However, I encountered a few trial-and-error processes, so I'd like to summarize the details.


MVP Summary

I've summarized the essential features that need to be prepared.

Version 1 was running on a PC with slightly lower performance, but fortunately, I was able to choose a better one for version 2.


PC Specifications

Intel(R) Core(TM) i5-4590 CPU @ 330GHz
8.0GB DDR3
SSD 240GB

Building a US Stock Automated Trading Program 2.0


[Securities Account]

Creating a securities account for overseas stock trading
Condition: Kiwoom Securities' Hero Engine Global must be used (Currently, the automated trading program is developed for Hero Engine Global)
Hero Engine Global Installation and Settings
The digital certificate is also saved and configured on the hard drive so that it can continue to run on this PC.
After logging in to Hero Engine Global, some environment settings are also made.
Investment Fund Transfer and Exchange
The initial seed money was set to 3 million KRW, and since the exchange rate was high, I exchanged $2,500.
Since the work was done on a Sunday, I'm not sure if it was because of that, but the exchange was only possible on Monday.
(3 million KRW is reflected in the available funds, but the exchange amount wasn't reflected when doing it on Sunday.)


[UiPath - RPA]

UiPath Studio Installation and Settings
After installing UiPath Studio, it must be set to standalone and community version.
Importing and Setting up Version 1's Project
The project that was running on version 1 is imported to run as is.
(DB and other settings are changed.)
Project Execution Test
Due to the logic that checks for a long time, I couldn't test the operation, but
I confirmed that the imported project is running normally.
Scheduling Settings
The project is set to run at 23:31 on Monday, Tuesday, Wednesday, Thursday, and Friday.


[DB]

Since the core settings of the investment methodology were handled through the DB, DB settings were essential.

SQL Server Express Installation and Settings
If it was a completely new setup, installation would have been necessary, but since there was a DB that version 1 was using, I didn't install it.
Database Creation
The database was backed up and restored with a different name, and the data in the table was deleted.
The table structure is too simple, but I'll organize the related content later.
Setting Values
Starting with 3 million KRW - $2,500, and I decided to invest in the FNGU ETF that had fallen significantly in version 1.
It's set to a total of 30 tiers, with both DOWN_RT and UP_RT set to 1%.
This account will invest in FNGU from tier 1 to -30%.
Although the investment principal is small, $2,500 was divided into 30 parts. (Tier 1: $470, other tiers: $70)


With these preparations, I thought it would be possible to run automated trading basically,

and I confirmed that it ran at 23:31 on 12/20 (Mon).

Of course, to do the same as in version 1, such as (1) analyzing charts for each stock and (2) posting on the blog, I need to configure some more settings.

However, I considered those parts to be additional and since it's now running normally, I can prepare for the next steps gradually.

Actually, I should move on to the next steps, but to receive notifications about the start of the automated trading program and buy/sell orders,

I created a Telegram chat room and configured the settings.

Building a US Stock Automated Trading Program 2.0

12/20(Mon) Performance of Program 2.0


Next Steps

Analysis of Charts for Each Stock
I install Python and set up the environment, copy the source code from version 1, and change the DB settings.
I also copy the source code for the mosaic processing function and prepare it.
Once it's ready and working correctly, I'll set up the schedule. (6:10 AM)
Blog Posting
I will either separate the blog account or add a category to the current blog and change the RPA posting settings.
I will also import and configure the blog posting project and test its operation.
Once it's ready and working correctly, I'll set up the schedule. (6:20 AM)


Conclusion

Although this automated trading program is tailored to the investment methodology I've set up and use,

I plan to create a guide document to make it easy to install and use, and to share the installation files.

If you are interested in automated trading, please feel free to ask any questions you may have through comments or email.

My email address is listed in the top left corner. (ssjokelife@naver.com)

Comments0