請(qǐng)各位老師幫忙把文華的公式轉(zhuǎn)換成TB的,多謝了!
作者:開(kāi)拓者 TB 來(lái)源:cxh99.com 發(fā)布時(shí)間:2023年08月04日
-
咨詢(xún)內(nèi)容:
DIFF : =EMA(CLOSE,12) - EMA(CLOSE,26);//短周期與長(zhǎng)周期的收盤(pán)價(jià)的指數(shù)平滑移動(dòng)平均值做差。
DEA??: =EMA(DIFF,9);//DIFF的M個(gè)周期指數(shù)平滑移動(dòng)平均
MACD:=2*(DIFF-DEA),COLORSTICK;//DIFF減DEA的2倍畫(huà)柱狀線(xiàn)
M:=MACD-REF(MACD,1);
A:=EMA(CLOSE,21)-EMA(CLOSE,34);
T1:=A>0&&M>0;
T2:=A<0&&M<0;
T1,BPK;
T2,SPK;
SETALLSIGPRICETYPE(ACTIVE_ORDER);
AUTOFILTER;
?
?來(lái)源:CXH99.COM
-
TB技術(shù)人員:
這個(gè)公式在文華已經(jīng)用了幾年了,請(qǐng)各位老師幫個(gè)忙吧
?
-
TB客服:
Params
? ?? ? Numeric FastLength(12);
? ?? ? Numeric SlowLength(26);
? ?? ? Numeric MACDLength(9);
Vars? ?
? ?? ? NumericSeries MACDValue;
? ?? ? NumericSeries AvgMACD;
? ?? ? NumericSeries MACDDiff;
Begin
? ?? ???MACDValue = XAverage( Close, FastLength ) - XAverage( Close, SlowLength ) ;? ?? ???
? ?? ???AvgMACD = XAverage(MACDValue,MACDLength);
? ?? ???MACDDiff = 2*(MACDValue - AvgMACD);
? ?? ???If (MACDDiff >= 0)? ?? ???
? ?? ?? ?? ?? ? PlotNumeric("MACDDiff",MACDDiff,0,Red);
? ?? ???Else
? ?? ?? ?? ?? ? PlotNumeric("MACDDiff",MACDDiff,0,Green);??
? ?? ???PlotNumeric("零線(xiàn)",0);? ?? ?? ?
? ?? ???If(EMA(CLOSE,21)>EMA(CLOSE,34)&&AvgMACD>AvgMACD[1])
? ?? ???{
? ?? ?? ?? ?? ? BuyToCover(13,CLOSE);
? ?? ?? ?? ?? ? Buy(13,CLOSE);
? ?? ???}
? ?? ???If(EMA(CLOSE,21)<EMA(CLOSE,34)&&AvgMACD<AvgMACD[1])
? ?? ???{
? ?? ?? ?? ?? ? SELL(13,CLOSE);
? ?? ?? ?? ?? ? SELLSHORT(13,CLOSE);
? ?? ???}
? ?? ?? ?
end
編譯顯示錯(cuò)誤:? ?? ? 無(wú)法識(shí)別的字符串NumericSeries MACDValue
請(qǐng)版主幫忙看看是什么原因?
多謝!