关于股票均线是否站稳的问题,我们总结了以下几点,给你解答:
股票均线是否站稳
def is_ma_stable(self, stock_code, ma_list=[5, 10, 20]):
df = self.get_k_data(stock_code, ktype='D', autype='qfq', start='2015-01-01')
df = df.sort_index(ascending=False)
df['ma5'] = df['close'].rolling(window=5).mean()
df['ma10'] = df['close'].rolling(window=10).mean()
df['ma20'] = df['close'].rolling(window=20).mean()
df = df.sort_index(ascending=True)
df = df.dropna()
df['ma5_diff'] = df['ma5'] - df['ma5'].shift(1)
df['ma10_diff'] = df['ma10'] - df['ma10'].shift(1)
df['ma20_diff'] = df['ma20'] - df['ma20'].shift(1)
df = df.dropna()
df['ma5_diff_mean'] = df['ma5_diff'].rolling(window=5).mean()
df['ma10_diff_mean'] = df['ma10_diff'].rolling(window=5).mean()
df['ma20_diff_mean'] = df['ma20_diff'].rolling(window=5).mean()
df = df.dropna()
if df['ma5_diff_mean'].iloc[-1] > 0 and df['ma10_diff_mean'].iloc[-1] > 0 and df['ma20_diff_mean'].iloc[-1] > 0:
return True
else:
return False
# 判断股票是否在上涨趋势
def is_trend_up(self, stock_code):
df = self.get_k_data(stock_code, ktype='D', autype='qfq', start='2015-01-01')
df = df.sort_index(ascending=False)
df['ma5'] = df['close'].rolling(window=5).mean()
df['ma10'] = df['close'].rolling(window=10).mean()
df['ma20'] = df['close'].rolling(window=20).mean()
df = df.sort_index(ascending=True)
df = df.dropna()
if df['ma5'].iloc[-1] > df['ma10'].iloc[-1] and df['ma10'].iloc[-1] > df['ma20'].iloc[-1]:
return True
else:
return False
# 判断股票是否在下跌趋势
def is_trend_down(self, stock_code):
df = self.get_k_data(stock_code, ktype='D', autype='qfq', start='2015-01-01')
df = df.sort_index(ascending=False)
df['ma5'] = df['close'].rolling(window=5).mean()
df['ma10'] = df['close'].rolling(window=10).mean()
df['ma20'] = df['close'].rolling(window=20).mean()
df = df.sort_index(ascending=True)
df = df.dropna()
if df['ma5'].iloc[-1] < df['ma10'].iloc[-1] and df['ma10'].iloc[-1] < df['ma20'].iloc[-1]:
return True
else:
return False
# 判断股票是否在震荡趋势
def is_trend_shock(self, stock_code):
df = self.get_k_data(stock_code, ktype='D', autype='qfq', start='2015-01-01')
df = df.sort_index(ascending=False)
df['ma5'] = df['close'].rolling(window=5).mean()
df['ma10'] = df['close'].rolling(window=10).mean()
df['ma20'] = df['close'].rolling(window=20).mean()
df = df.sort_index(ascending=True)
df = df.dropna()
if df['ma5'].iloc[-1] > df['ma10'].iloc[-1] and df['ma10'].iloc[-1] < df['ma20'].iloc[-1]:
return True
elif df['ma5'].iloc[-1] < df['ma10'].iloc[-1] and df['ma10'].iloc[-1] > df['ma20'].iloc[-1]:
return True
else:
return False
# 判断股票是否在金叉趋势
def is_trend_golden_cross(self, stock_code):
df = self.get_k_data(stock_code, ktype='D', autype='qfq', start='2015-01-01')
df = df.sort_index(ascending=False)
df['ma5'] = df['close'].rolling(window=5).mean()
df['ma10'] = df['close'].rolling(window=10).mean()
df['ma20'] = df['close'].rolling(window=20).mean()
df = df.sort_index(ascending=True)
df = df.dropna()
if df['ma5'].iloc[-1] > df['ma10'].iloc[-1] and df['ma10'].iloc[-1] < df['ma20'].iloc[-1] and df['ma5'].iloc[-2] < df['ma10'].iloc[-2] and df['ma10'].iloc[-2] > df['ma20'].iloc[-2]:
return True
else:
return False
# 判断股票是否在死叉趋势
def is_trend_dead_cross(self, stock_code):
df = self.get_k_data(stock_code, ktype='D', autype='qfq', start='2015-01-01')
df = df.sort_index(ascending=False)
df['ma5'] = df['close'].rolling(window=5).mean()
df['ma10'] = df['close'].rolling(window=10).mean()
df['ma20'] = df['close'].rolling(window=20).mean()
df = df.sort_index(ascending=True)
df = df.dropna()
if df['ma5'].iloc[-1] < df['ma10'].iloc[-1] and df['ma10'].iloc[-1] > df['ma20'].iloc[-1] and df['ma5'].iloc[-2] > df['ma10'].iloc[-2] and df['ma10'].iloc[-2] < df['ma20'].iloc[-2]:
return True
else:
return False
# 判断股票是否在金叉趋势
def is_trend_golden_cross_2(self, stock_code):
df = self.get_k_data(stock_code, ktype='D', autype='qfq', start='2015-01-01')
df = df.sort_index(ascending=False)
df['ma5'] = df['close'].rolling(window=5).mean()
df['ma10'] = df['close'].rolling(window=10).mean()
df['ma20'] = df['close'].rolling(window=20).mean()
df = df.sort_index(ascending=True)
df = df.dropna()
if df['ma5'].iloc[-1] > df['ma10'].iloc[-1] and df['ma10'
股票的均线战法
5天10天买入的平均成本,如果主力也是这些天买进,股价和两条均线向上,那跌回这个位置就会拉起。
这是教科书的说法
但是实话实说,所有指标包括kd macd均线,是根据已有价格计算得出,看指标落后于看价格分析,也就是k线。而价格是根据成交量变化,看k线分析落后看成交量分析,而成交量根据盘面结构变化,看成交量分析慢于看结构分析。
你看大涨的股票的均线,这些均线战法都对,但如果你统计所有出现均线战法买点的股票,之后会涨得不到30%.会大涨的不到10%.
所以只用所谓的均线战法是无法判断买卖点的,正确的方法要会用比较法则选择主流板块主流股,懂得利用正确的技术分析筹码分析知识来针对不同主力类型的股票用量价,趋势,波浪位置计算合理买卖点,
股票分析软件不同,均线颜色也会不同,没有统一的规定,你可以根据你所使用的行情软件来分辨。具体是在k线图上,看日k线图上方与工具条下方之间的一排日k线数字,如 ma5、ma10、ma30……所对应的颜色,分别代表 5日、10日、30日、60日、120日、250日均线。。。。。
均线的用法
k线图通常有分为日、周、月、季、年k线图,平时最多用日k线图,里面有5日(ma5)、10日(ma10)、20日(ma20)、30日(ma30)、60日(ma60)等均线,分别用白、黄、紫、绿、蓝等颜色在图中显示,其各线参数和颜色可以改变的。从各均线可看出股票的运行趋势。在股票市场所讲的趋势,就是股票k线连续组合的总体运行方向。
比如日k线在5、10、20、30日均线的上方,且各均线是向上,虽然其中有升有跌(均线在k线下方时都起着一定的支撑作用),这时的趋势是向上没有改变。