請各位老師幫忙把文華的公式轉換成TB的,多謝了! [開拓者 TB]
-
咨詢內容:
DIFF : =EMA(CLOSE,12) - EMA(CLOSE,26);//短周期與長周期的收盤價的指數(shù)平滑移動平均值做差。
DEA??: =EMA(DIFF,9);//DIFF的M個周期指數(shù)平滑移動平均
MACD:=2*(DIFF-DEA),COLORSTICK;//DIFF減DEA的2倍畫柱狀線
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;?
?來源:CXH99.COM
-
TB技術人員:
這個公式在文華已經(jīng)用了幾年了,請各位老師幫個忙吧
?
-
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("零線",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
編譯顯示錯誤:? ?? ? 無法識別的字符串NumericSeries MACDValue
請版主幫忙看看是什么原因?
多謝!
有思路,想編寫各種指標公式,交易模型,選股公式,還原公式的朋友
可聯(lián)系技術人員 QQ: 262069696 或微信號:cxh99cxh99 進行 有償收費 編寫!
(注:由于人數(shù)限制,QQ或微信請選擇方便的一個聯(lián)系我們就行,加好友時請簡單備注下您的需求,否則無法通過。謝謝您!)
相關文章
-
沒有相關內容