带域名的网站打不开,城乡建设厅官方网站,常州市做网站,中国住房城乡建设厅网站有许多投资者喜欢在股票涨停封盘后#xff0c;跟进买入。普通股民会认为一个能在今日涨停封盘的股票#xff0c;证明其上市公司正有十分重大的利好信息#xff0c;只需要跟进购买便可以获取短期利益。
我们用数据来看一下在当日涨停封盘后#xff0c;第二次交易日是上涨还…有许多投资者喜欢在股票涨停封盘后跟进买入。普通股民会认为一个能在今日涨停封盘的股票证明其上市公司正有十分重大的利好信息只需要跟进购买便可以获取短期利益。
我们用数据来看一下在当日涨停封盘后第二次交易日是上涨还是下跌
import efinance as ef
import numpy as np
import pandas as pd
from tqdm import tqdmall_stocks ef.stock.get_realtime_quotes()
stock_codes np.array(all_stocks[股票代码])stock_rise_fall_arr []for stock_code in tqdm(stock_codes):# 获取股票历史行情数据df ef.stock.get_quote_history(stock_code)if len(df) 0:continuestock_rise_fall {}stock_rise_fall[股票代码] stock_codestock_rise_fall[股票名称] df[股票名称].loc[0]stock_rise_fall[涨停天数] 0stock_rise_fall[涨停后涨] 0stock_rise_fall[涨停后跌] 0stock_rise_fall[涨停后开盘涨] 0stock_rise_fall[涨停后开盘跌] 0stock_rise_fall[涨停后最高涨] 0stock_rise_fall[涨停后最高跌] 0is_limit_up Falseis_first Falselast_price 0for i in df.index[:]:line df.loc[i]# 如果昨日涨停if is_limit_up and is_first:if line[涨跌幅] 0:stock_rise_fall[涨停后涨] 1else:stock_rise_fall[涨停后跌] 1if line[开盘] last_price:stock_rise_fall[涨停后开盘涨] 1else:stock_rise_fall[涨停后开盘跌] 1if line[最高] last_price:stock_rise_fall[涨停后最高涨] 1else:stock_rise_fall[涨停后最高跌] 1# 如果当日涨停if line[涨跌幅]9.9:# 如果昨天也涨停if is_limit_up:is_first Falseelse:last_price line[收盘]is_first Trueis_limit_up Truestock_rise_fall[涨停天数] 1else:is_limit_up Falseif stock_rise_fall[涨停后涨] stock_rise_fall[涨停后跌] 0:stock_rise_fall[涨停后涨概率] stock_rise_fall[涨停后涨] / (stock_rise_fall[涨停后涨]stock_rise_fall[涨停后跌])if stock_rise_fall[涨停后开盘涨] stock_rise_fall[涨停后开盘跌] 0:stock_rise_fall[涨停后开盘涨概率] stock_rise_fall[涨停后开盘涨] / (stock_rise_fall[涨停后开盘涨]stock_rise_fall[涨停后开盘跌])if stock_rise_fall[涨停后最高涨] stock_rise_fall[涨停后最高跌] 0:stock_rise_fall[涨停后最高涨概率] stock_rise_fall[涨停后最高涨] / (stock_rise_fall[涨停后最高涨]stock_rise_fall[涨停后最高跌])stock_rise_fall_arr.append(stock_rise_fall)
stock_rise_fall_df pd.DataFrame(stock_rise_fall_arr)
stock_rise_fall_df.to_excel(output.xlsx, index False)
stock_rise_fall_df100%|██████████| 5649/5649 [43:0200:00, 2.19it/s] 股票代码股票名称涨停天数涨停后涨涨停后跌涨停后开盘涨涨停后开盘跌涨停后最高涨涨停后最高跌涨停后涨概率涨停后开盘涨概率涨停后最高涨概率0300120经纬辉开72321836144280.6400000.7200000.8400001300284苏交科58311125173840.7380950.5952380.9047622300052中青宝914625442758130.6478870.6197180.8169013300045华力创通65332139154950.6111110.7222220.9074074300865大宏立21891071520.4705880.5882350.882353.......................................5637300047天源迪科49242128174230.5333330.6222220.9333335638872953国子软件123618630.3333330.1111110.6666675639300598诚迈科技104372435265470.6065570.5737700.8852465640001279C强邦10101010.0000000.0000000.0000005641837592华信永道601738144125300.3090910.2545450.454545
5642 rows × 12 columns
将导出excel文件下载到本地并对数据进行统计整理到最后一行计算各个概率可以得到如图所示 可以看出涨停后收盘涨和涨停后开盘涨的概率均在0.5左右可以认为首日涨停与第二日是否涨停无关。故某只股在今日涨停并不意味着该股公司有什么重大利好信息也无法作为买进的支撑。