![translation](https://cdn.durumis.com/common/trans.png)
This is an AI translated post.
Building a US Stock Auto Trading Program Version 2.0
- Writing language: Korean
- •
-
Base country: All countries
- •
- Information Technology
Select Language
Summarized by durumis AI
- In December 2021, we built a US stock auto trading program version 2.0, leveraging the system used in version 1.0 for quick development.
- We built an automated trading system utilizing UiPath RPA, SQL Server Express, Telegram chatrooms, and more, setting it up to receive buy/sell notifications.
- The auto trading system is currently operating normally, and we plan to add features for stock chart analysis and blog posting in the future.
It's been 2 years since I wrote the content below. For those of you who are curious about the results, please check out the retrospective post first.
In the previous post, I thought that I should create a second automatic trading program for US stocks.
The thought came to me at 12/19(Sun) morning, and I started preparing for it after having dinner that day.
Even though I had created the first program once and the base environment was set up, I was able to prepare quickly.
However, there were some trial and error processes, so I'm going to summarize the contents.
MVP Summary
I've summarized the features that must be prepared.
The first program was on a PC with poor performance, but luckily I was able to choose a better PC for the second one.
PC Specs
Intel(R) Core(TM) i5-4590 CPU @ 330GHz
8.0GB DDR3
SSD 240GB
[Securities Account]
Creating a securities account for overseas stock trading
Condition: You need to use Kiwoom Securities' Youngwoong Global (Currently, the automatic trading program is developed for Youngwoong Global)
Install and set up Youngwoong Global
Save and set up the certificate on the hard drive so that it can continue to run on this PC.
Log in to Youngwoong Global and set up some environment settings.
Investment funds transfer and exchange
I set the initial seed to 3 million won, and I exchanged $2,500 because the exchange rate is high.
I don't know if it's because the working time is Sunday, or if the exchange is not possible immediately after the transfer, but the exchange was only possible on Monday.
(3 million won appears in the available balance, but when I did it on Sunday, 3 million won did not appear in the exchange amount.)
[UiPath - RPA]
Install and set up UiPath Studio
After installing UiPath Studio, you need to set it up as a stand-alone & community version.
Import and set up the project from the first program
Import the project that is running on the first program and make it work.
(Change settings for DB, etc.)
Project execution test
Although I couldn't test the operation due to the logic that checks for a long time,
I confirmed that the imported project is running normally.
Scheduling setting
Set the project to run at 23:31 on Mon, Tue, Wed, Thu, and Fri.
[DB]
DB settings were essential because I made it so that the core settings of the investment methodology were handled through the DB.
Install and set up SQL Server Express
If I had set it up from scratch, I would have had to install it, but I didn't have to install it because the DB used by the first program was already there.
Create a database
I backed up the database and restored it with a different name, and deleted the data from the table.
I'm using a very simple table structure, but I'll summarize the related information later.
Setting settings
I decided to invest in the FNGU ETF, which has fallen a lot in the first program, starting with 3 million won - $2,500.
I set up a total of 30 tiers, and set both DOWN_RT and UP_RT to 1%.
This account will invest from FNGU tier 1 to -30%.
Although the investment principal is small, I divided $2,500 into 30 well. (Tier 1: $470, other tiers: $70)
I thought that I could run automatic trading with these preparations,
and I confirmed that it worked at 23:31 on 12/20 (Mon).
Of course, just like the first program, I need to do more settings to perform (1) stock chart analysis and (2) blog posting after execution.
However, I thought those parts were additional, so I'll prepare for the next step gradually because it's now working properly.
In fact, I should move on to the next step, but I made a telegram chat room and set it up so that I could receive notifications of automatic trading program start and buy/sell alerts.
Execution history of Version 2.0 on December 20th (Mon)
Next Step
Stock chart analysis
I install Python and set up the environment, copy the source code of the first program, and change the DB settings.
I also prepare the function for mosaic processing by copying the source code.
If the preparation is complete and it works properly, I set up the schedule. (6:10 AM)
Blog posting
I separate the blog account or add a category to the current blog, and change the posting settings of RPA.
I also import and set up the blog posting project and test its operation.
If the preparation is complete and it works properly, I set up the schedule. (6:20 AM)
Conclusion
This automatic trading program is customized for the investment methodology I use and set up, but
I'm going to prepare to share the installation files and create a guide document so that it can be easily installed and used.
If you are interested in automatic trading, please feel free to contact me via comments or email if you have any questions.
My email is on the top left. (ssjokelife@naver.com)