问财量化选股策略逻辑
高点为两日最高,涨幅<2.6且涨幅>-5,未清偿可转债简称不可为空
选股逻辑分析
这个策略的逻辑是基于股票价格和可转债的情况来筛选股票。首先,需要找到股票的高点,即过去两天中最高的价格。然后,需要筛选出在这两天内涨幅小于2.6并且涨幅大于-5的股票。最后,需要确保这些股票没有未清偿的可转债简称。
有何风险?
这个策略的风险在于它可能会漏掉一些股票,因为它的筛选条件比较严格。如果股票的价格在两天内没有达到高点,或者涨幅超过了2.6或低于-5,那么它就会被筛选掉。此外,如果股票有未清偿的可转债简称,那么它也会被筛选掉,这可能会导致错过一些有潜力的股票。
如何优化?
为了优化这个策略,可以考虑放宽一些筛选条件。例如,可以将涨幅放宽到小于5,或者将可转债简称的限制放宽到可选。这样可以增加策略的适用范围,但也可能会增加一些风险。
最终的选股逻辑
def select_stock():
# Find the highest price of the past two days
high_prices = get_high_prices()
high_price = max(high_prices)
# Filter out stocks with a price change of less than 2.6% or more than -5%
filtered_stocks = [stock for stock in stocks if stock['price'] > high_price - 0.026 * high_price and stock['price'] < high_price + 0.05 * high_price]
# Filter out stocks with an uncleared convertible bond
filtered_stocks = [stock for stock in filtered_stocks if 'convertible_bond' not in stock]
return filtered_stocks
python代码参考
def get_high_prices():
# Get the prices of the past two days
prices = get_prices()
high_prices = [price for price in prices[-2:]]
return high_prices
def get_prices():
# Get the prices of all stocks
stocks = get_stocks()
prices = [stock['price'] for stock in stocks]
return prices
def get_stocks():
# Get the list of all stocks
# This code assumes that
## 如何进行量化策略实盘?
请把您优化好的选股语句放入文章最下面模板的选股语句中即可。
select_sentence = '市值小于100亿' #选股语句。
模板如何使用?
点击图标右上方的复制按钮,复制到自己的账户即可使用模板进行回测。
## 如果有任何问题请添加 下方的二维码进群提问。
