我這語法編輯時,一直卡ema紅字這,初學不知錯在哪,凡請各位幫幫忙謝謝
//Force index
input:slowLen(13),fastLen(2);
Vars: l_FI(0), l_FastAvg(0), l_slowavg(0), l_vol(0);
Vars:TrendBull(false), TrendBear(false);
l_vol = iff(datacompression>1,volume,ticks);
l_FI= l_vol*(C-C[1]);
l_fastavg=ema(l_fi,fastLen);
l_slowavg=ema(l_fi,slowLen);
//---
TrendBull=c-ema(c,13)>0 and l_fastavg<0;
TrendBear=c-ema(c,13)<0 and l_fastavg>0;
If TrendBull then buy next bar at market;
If TrendBear then sellshort next bar at market;
請確認一下,你是否有建立ema這個函數??? 或者你想要的是XAverage???