聚宽策略:获取最热门股票,计算5天涨幅大于25%的股票和10天涨幅大于50%的股票

2023-6-22 9:21 morefun 股票量化

聚宽策略:获取最热门股票,计算5天涨幅大于25%的股票和10天涨幅大于50%的股票代码如下:
from jqdata import *
import numpy as np
import pandas as pd
from six import BytesIO

# 读取股票代码列表
body = read_file("hot_stocks.csv")
data = pd.read_csv(BytesIO(body))
column1 = data.iloc[:, 2]
column2 = data.iloc[:, 1]
stocks = column1.tolist()

# 获取10天前和5天前的日期
end_date = '2023-06-19'
trade_days_10 = get_trade_days(end_date=end_date, count=10)
start_date_10 = trade_days_10[0]
trade_days_5 = get_trade_days(end_date=end_date, count=5)
start_date_5 = trade_days_5[0]

# 初始化空列表,存储涨幅超过50%和25%的股票代码和名称
selected_10 = []
selected_5 = []

# 遍历股票代码列表
for name, code in zip(column1, column2):
    # 获取历史行情数据
    df = get_price(code, start_date=start_date_10, end_date=end_date, frequency='daily')
    # 计算10天涨幅和5天涨幅
    change_10 = (df['close'][-1] - df['close'][0]) / df['close'][0] * 100
    df = get_price(code, start_date=start_date_5, end_date=end_date, frequency='daily')
    change_5 = (df['close'][-1] - df['close'][0]) / df['close'][0] * 100
    # 打印结果
    print("{} {} 10天涨幅: {:.2f}%, 5天涨幅: {:.2f}%".format(code, name, change_10, change_5))
    # 判断涨幅是否超过50%和25%
    if change_10 > 50:
        selected_10.append(code + ' ' + name)
    if change_5 > 25:
        selected_5.append(code + ' ' + name)

# 打印符合条件的股票代码和名称列表
print("10天涨幅大于50%的股票: {}".format(selected_10))
print("5天涨幅大于25%的股票: {}".format(selected_5))

运行结果如下:

微信截图_20230622092803.png

附用到的文件:hot_stocks.csv

标签: 股票量化

评论(0) 浏览(177)

模特提示词prompt

2023-6-22 1:17 morefun Stable Diffution

模特prompt:

positive: (8k, RAW photo, best quality, masterpiece:1.2), (realistic, photo-realistic:1.4), (depth of field), highres, absurdres, lora:taiwanDollLikeness_v10:0.4, ulzzang-6500-v1.1, 1girl, solo, nude, ((naked body)), realistic skin texture, skin pores, cute, smile, laughing, (grin), (brown hair , (eyelashes:1.1), medium straight hair, ((small breasts:1.0)), symmetrical eyes, detailed eyeshadow, thigh gap, (looking at viewer:1.3), front, full body,

negative:easynegative, ng_deepnegative_v1_75t, paintings, sketches, ((monochrome)), ((grayscale)), (worst quality:2), (low quality:2), (normal quality:2), lowres, skin spots, acnes, skin blemishes, age spot, penis, glans, dick, text, error, extra digits, fewer digits, cropped, watermark, blurry, words, word, logo, cropped, mutation, deformed, jpeg artifacts, twisted hands, fused fingers, poorly drawn hand, poorly drawn face, poorly drawn lowre, poorly drawn finger, poorly drawn leg, extra fingers, extra limbs, extra arms, extra legs, extra leg, extra arm, extra hand, extra limb, malformed limbs, fused fingers, long neck, cross-eyed, mutated hands, bad body, bad proportions, bad feet, bad nipple, bad anatomy, bad hands, gross proportions, missing finger, missing arm, missing leg, picasso, amputee, deformed, blurry, disfigured, mutated, ugly, blurry face, out of frame, border, bra, panties, clothes, cloth, pants, lace, door, light, lamp, necklace, mirror, paint, animal, chiffon, grenadine, gimp, purfle, disabled body,

标签: AI 提示词

评论(1) 浏览(249)

Powered by MoreFun.CN 粤ICP备2025398508号