关于顾比均线指标公式源码的问题,我们总结了以下几点,给你解答:
顾比均线公式代码
在保证能运行的情况下,应该等于48D15H
顾比均线指标公式源码
# 计算MA
def MA(df, n):
MA = pd.Series(pd.rolling_mean(df['Close'], n), name = 'MA_' + str(n))
df = df.join(MA)
return df
# 计算MACD
def MACD(df, n_fast, n_slow):
EMAfast = pd.Series(pd.ewma(df['Close'], span = n_fast, min_periods = n_slow - 1))
EMAslow = pd.Series(pd.ewma(df['Close'], span = n_slow, min_periods = n_slow - 1))
MACD = pd.Series(EMAfast - EMAslow, name = 'MACD_' + str(n_fast) + '_' + str(n_slow))
MACDsign = pd.Series(pd.ewma(MACD, span = 9, min_periods = 8), name = 'MACDsign_' + str(n_fast) + '_' + str(n_slow))
MACDdiff = pd.Series(MACD - MACDsign, name = 'MACDdiff_' + str(n_fast) + '_' + str(n_slow))
df = df.join(MACD)
df = df.join(MACDsign)
df = df.join(MACDdiff)
return df
顾比均线指标代码超准
现在软件没有自带的“顾比”。
但是顾比均线所有软件都支持,自己可以在指标里自编。
源码很简单:
{顾比均线}主图
MA1:EMA(CLOSE,3),COLORYELLOW;
MA2:EMA(CLOSE,5),COLORYELLOW;
MA3:EMA(来自CLOSE,8),COLORYELLOW;
MA4:EMA(CLOSE,10),COLORRED;
MA5:EMA(步题配族CLOSE,12),COLORRED;
MA6:EMA(CLOSE,15),C汽画欢界苦原危牛圆OLORRED;
MA7:EMA(CLOSE,30专余),COLORGRE每自革培EN;
短买: DRAWICON(CROSS(MA1记级元时必器,MA2),l-0.2,4),COLORRED;
短卖: DRAWICON(CROSS(MA2,MA1),h+0.1,5),COLORGREEN;
红三角买入: DRAWICON( CROSS(MA4,MA7),l-0.25,8),COLORRED;
MA8:EMA(CLOSE,35),COLO作轮里为括冷整源杀结底RGREEN;
MA9:EMA(CLOSE,40),COLORGREEN;
MA10:EMA(CL写新及激OSE,45),COLORBLUE;
MA11:EMA(CLOSE,50),COLORBLUE州点策的刑;
MA12:EMA(CLOS吧脚E,60),COLORBLUE;