当前位置:网站首页>How much money have I made by sticking to fixed investment for 3 years?
How much money have I made by sticking to fixed investment for 3 years?
2022-06-25 09:28:00 【Maoningyi】
hello , Hello everyone , I'm Ning Yi , A senior leek .
Recently I heard that the bull market is coming , Some people even say that the bull market has come . I don't know what your friends are like , I have several colleagues and friends around me. Recently, the God of wealth has possessed me , One day I will earn more than 100000 yuan , Sevenoreight thousand , There are even assets that have doubled directly .
It's OK to look at this kind of thing on the Internet at ordinary times , But if it really happens to colleagues and friends around you , It had a great impact on my young mind , I am such a person who doesn't hear about the world at ordinary times. I have become a lemon essence .
What about myself , yes 18 year 1 Fixed investment started in January , Fixed vote 4 Only index funds , Namely
18 In the year , The market is still 3300.3400 Wandering around , Then it vibrates down , Fall through 3000 spot . It seems that my account is green most of the time
from 2018 year 1 Months to now , For two and a half years , Once every two weeks , Every time 4000 Yuan , The amount allocated to each fund is 1000 element . My account has finally turned red with the recent surge , Let's take a look at the fixed investment until now , How much profit have I made in my account
I recorded it in the form
Let's take a look at Shanghai and Shenzhen 300 This fund , from 18 year 1 Fixed investment started in January , Once every two weeks , Every time 1000 element , In the end, the total investment is 66000 element , It's profitable 14216.58 element . Yield 21%
Then there is the Chinese certificate 500, Yield 19%, Medical yield 43%, Media profitability 18%, Does this yield look good
But unfortunately, it is not my actual income , I use it. Python Captured the net value data of these funds on Tiantian fund network , Then simulate the actual fixed investment to calculate , Export these excel data .
# coding: utf-8
from selenium.webdriver.support.ui import WebDriverWait
from selenium import webdriver
from threading import Thread,Lock
import pyquery as pq # Parse web pages
import os
import datetime # Time module
import time
import xlwt # Generate excel
# Processing web data
datalist = dict()
def getItem(doc):
for item in doc.items():
# print("item",item)
datas = pq.PyQuery(item).find("td").items()
index = 0
date = ""
net = ""
for data in datas:
index += 1
if(index == 1):
date = data.text()
elif(index == 2):
net = data.text()
else:
break
if net:
datalist[date] = net
# Initialization function
def initSpider():
path = os.getcwd()
driver = webdriver.Chrome(executable_path=(path+"/chromedriver"))
# GF China Securities media ETF join A (004752)
# driver.get("http://fundf10.eastmoney.com/jjjz_004752.html")
# The index across Shanghai and Shenzhen stock markets E Fonda Shanghai and Shenzhen 300ETF join A (110020)
# driver.get("http://fundf10.eastmoney.com/jjjz_110020.html")
# GF medical and health connection A(001180)
# driver.get("http://fundf10.eastmoney.com/jjjz_001180.html")
# personal witness 500 It is the most representative small cap index Southern China Securities 500ETF join A (160119)
driver.get("http://fundf10.eastmoney.com/jjjz_160119.html")
# find " The next page " Button , You can get the one in front of it label, Is the total number of pages
getPage_text = driver.find_element_by_id("pagebar").find_element_by_xpath(
"div[@class='pagebtns']/label[text()=' The next page ']/preceding-sibling::label[1]").get_attribute("innerHTML")
# Get the total number of pages
total_page = int("".join(filter(str.isdigit, getPage_text)))
# return
return (driver,total_page)
# obtain html Content
def getData(myrange,driver,lock):
for x in myrange:
# Lock the
lock.acquire()
tonum = driver.find_element_by_id("pagebar").find_element_by_xpath(
"div[@class='pagebtns']/input[@class='pnum']") # obtain Page number text box
jumpbtn = driver.find_element_by_id("pagebar").find_element_by_xpath(
"div[@class='pagebtns']/input[@class='pgo']") # Jump to button
tonum.clear() # The first x page Input box
tonum.send_keys(str(x)) # Go to the second x page
jumpbtn.click() # Click button
# Grab
WebDriverWait(driver, 30).until(lambda driver: driver.find_element_by_id("pagebar").find_element_by_xpath("div[@class='pagebtns']/label[@value={0} and @class='cur']".format(x)) != None)
doc = pq.PyQuery(driver.page_source).find("#jztable").find("tr")
getItem(doc)
lock.release()
# Start grabbing functions
def beginSpider():
# Initialize crawler
(driver, total_page) = initSpider()
# Create a lock
lock = Lock()
r = range(1, int(total_page)+1)
step = 10
range_list = [r[x:x + step] for x in range(0, len(r), step)] # Divide the page numbers
thread_list = []
for r in range_list:
t = Thread(target=getData, args=(r,driver,lock))
thread_list.append(t)
t.start()
for t in thread_list:
t.join() # This step is needed , Wait for the thread to complete its execution
print(" Grab complete ")
def init(dates):
# Total fixed investment amount
sum_money = 0.0
# Total share
sum_share = 0.0
price = 0.0
wb = xlwt.Workbook()
ws = wb.add_sheet(u' Fixed investment income ',cell_overwrite_ok=True)
arr = [u" Fixed investment date " ,u" Net worth " , u" share " , u" Current total share " ,u" Amount invested " , u" Current profits ( element )" , u" Yield "]
row = 0
for index,col_name in enumerate(arr):
ws.write(0,index,col_name)
for date in dates:
row += 1
ws.write(row,0,str(date))
price = get_price(date,data)
ws.write(row,1,str(price))
sum_money += 1000
share = "%.2f" % (1000/float(price))
ws.write(row,2,str(share))
sum_share += float(share)
ws.write(row,3,("%.2f" % sum_share))
ws.write(row,4,str(int(sum_money)))
cur_profit = "%.2f" % (float(price)*sum_share - sum_money)
ws.write(row,5,str(cur_profit))
cur_yield = "%.2f" % (float(cur_profit)*100/sum_money)
ws.write(row,6,str(cur_yield)+"%")
# earnings
get_money = sum_share*float(price)-sum_money
# Save the results to excel in
path = os.getcwd() + "/dingtou.xls"
wb.save(path)
print(" Total fixed investment amount :","%.2f" % sum_money," element ")
print(" Total share :","%.2f" % sum_share)
print(" Current benefits :","%.2f" % get_money," element ")
print(" Yield :","%.2f" %(get_money*100/sum_money) ,"%")
print(" Annualized rate of return :","%.2f" %(get_money*100/sum_money/2.5),"%")
# Compare time
def compare_time(times):
s_time = time.mktime(time.strptime(times,'%Y-%m-%d'))
e_time = time.mktime(time.strptime(str(datetime.date.today()),'%Y-%m-%d'))
return int(s_time) - int(e_time)
# Format date
def format_time(date):
new_date = datetime.datetime.strptime(date,'%Y-%m-%d')
tomorrow = new_date + datetime.timedelta(days=1)
return str(tomorrow).strip('00:00:00').strip()
# Get the price of the trading time
def get_price(start_day,data):
# If you can get the price , Continue to get the price of the next fixed investment day
if(start_day in data):
price = data[start_day]
print(" Fixed investment date :",start_day,' Net worth :',price)
return price
# If you can't get the price , Explain that the day is not a trading day , Need to get the price of the next trading day
else:
date = format_time(start_day)
return get_price(date,data)
# Get the next Friday
def get_friday(start_day):
next_friday = datetime.datetime.strptime(start_day,'%Y-%m-%d') + datetime.timedelta(days=14)
return str(next_friday).strip('00:00:00').strip()
if __name__ == "__main__":
beginSpider()
data = datalist
print("data",data)
start_day = "2018-01-05"
# Save the fixed investment date to dates in
dates = []
while True:
dates.append(start_day)
start_day = get_friday(start_day)
if(compare_time(start_day) >= 0):
break
init(dates)
I didn't follow the fixed casting record to make the fixed casting , But according to my own ideas , If you want to increase your position, increase your position , When you want to reduce your position, reduce your position .
Fall to 3000 Below the dot , My position is very heavy , The more you throw , The more you lose .
I was going to make a fixed investment , Beat inflation , It can even be annualized 10% Revenue , But at the end of the pitch, I just want to get my money back .
My actual situation , Take the media for example , Because I didn't increase my position at the low point , The cost is very high . If we stick to the fixed investment, it will be 19 year 3 In fact, it will be released in June , But my account has arrived 20 year 7 It was only after the big rise in October that it was released , And the table has already gained 18 A little bit .
I actually did 2 ten thousand , I sold it some time ago when I just returned to my hometown , Make a 1000 about ,2 Ten thousand yuan in two and a half years 1000, Annualized 2.x% Revenue .. It's better to buy bank financing .. I'm afraid all day .
Recently, I feel like God has given everyone a pie , I was left behind ..
After calculating by yourself , I know that fixed investment can really make money , But follow the rules , It's time for fixed investment , Whatever the net worth , Put money into it . Even if you look at yourself from profit 3000 Many turn into losses 3000 many , We should also unswervingly throw in .
The more you fall, the more you invest , Anti human operation . If you invest according to your own preferences , It is easy to be led by the market and become a leek chasing after the fall and killing the rise .
If you want to rush into the stock market now , Be prepared psychologically , Take investment as a way of financial management , Don't take it as a way to get rich overnight .
If you want to make more money, you have to take more risks , I hope you can sell the likes to the highest point in the bull market ~
Stick to fixed investment 3 year , How much money did I make ?
边栏推荐
- [zufe school competition] difficulty classification and competition suggestions of common competitions in the school (taking Zhejiang University of Finance and economics as an example)
- 处理图片类库
- Is it safe to open a stock account through the account opening QR code of the account manager? Or is it safe to open an account in a securities company?
- 备战2022年金九银十必问的1000道Android面试题及答案整理,彻底解决面试的烦恼
- Prepare for the 1000 Android interview questions and answers that golden nine silver ten must ask in 2022, and completely solve the interview problems
- Compare and explain common i/o models
- Use Navicat to compare data differences and structure differences of multi environment databases, and automatic DML and DDL scripts
- matplotlib matplotlib中plt.grid()
- matplotlib matplotlib中决策边界绘制函数plot_decision_boundary和plt.contourf函数详解
- 《乔布斯传》英文原著重点词汇笔记(二)【 chapter one】
猜你喜欢
Numpy numpy中的meshgrid()函数
Prepare for the 1000 Android interview questions and answers that golden nine silver ten must ask in 2022, and completely solve the interview problems
Summarize two methods of configuring pytorch GPU environment
22 mathematical modeling contest 22 contest C
[competition -kab micro entrepreneurship competition] KAB National College Students' micro entrepreneurship action participation experience sharing (including the idea of writing the application form)
5、 Project practice --- identifying man and horse
C # startup program loses double quotation marks for parameters passed. How to solve it?
Oracle-单行函数大全
Le labyrinthe des huit diagrammes de la bataille de cazy Chang'an
Mapping mode of cache
随机推荐
《乔布斯传》英文原著重点词汇笔记(三)【 chapter one】
sklearn 高维数据集制作make_circles 和 make_moons
On the underlying index principle of MySQL
SQL高级
A game WP
《乔布斯传》英文原著重点词汇笔记(六)【 chapter three 】
[zero foundation understanding innovation and entrepreneurship competition] overall cognition and introduction of mass entrepreneurship and innovation competition (including FAQs and integration of bl
Atguigu---17-life cycle
在指南针上面开户好不好,安不安全?
socket编程——epoll模型
Is it safe for Huatai Securities to open a stock account on it?
Matplotlib plt Axis() usage
[competition - Rural Revitalization] experience sharing of Zhejiang Rural Revitalization creative competition
Oracle one line function Encyclopedia
《乔布斯传》英文原著重点词汇笔记(五)【 chapter three 】
Title B of the certification cup of the pistar cluster in the Ibagu catalog
4、 Convolution neural networks
Voiceprint Technology (I): the past and present life of voiceprint Technology
2、 Training fashion_ MNIST dataset
Le labyrinthe des huit diagrammes de la bataille de cazy Chang'an