尋找拐點的問題 [金字塔]
- 咨詢內(nèi)容:
我做了一個尋求EMA均線上升中拐點價格或下降途中拐點價格的程序。但while語句中出現(xiàn)問題,而且不讓在while中使用ema函數(shù),不知如何修改,請高手指教。謝謝
VARIABLE: i=0,x=0,y=0.2; //y為當(dāng)前品種最小的變動價位,今日值>昨日值x=-1,否則x=1,
c0:= c;c1:= ema(c0,5);c2:= ref(c1,1);
if c1>c2 then x:=-1; //x為-1,c1上升中,需遞減找到轉(zhuǎn)折點價格if c1<c2 then x:=1; //x=1,c1處于下降中,需要滴增找到轉(zhuǎn)折點價格
while x=-1 and c1>c2 do begin i:=i+1; c0:=c+y*x*i; c1:=ema(c0,5);end
while x=1 and c1<c2 do begin i:=i+1; c0:=c+y*x*i; c1:=ema(c0,5);end
mm: x; - 金字塔客服:
處理中,請稍等
- 用戶回復(fù):
把ema放while外面
VARIABLE: i=0,x=0,y=0.2; //y為當(dāng)前品種最小的變動價位,今日值>昨日值x=-1,否則x=1,
c0:= c;
c1:= ema(c0,5);
c2:= ref(c1,1);
if c1>c2 then x:=-1; //x為-1,c1上升中,需遞減找到轉(zhuǎn)折點價格
if c1<c2 then x:=1; //x=1,c1處于下降中,需要滴增找到轉(zhuǎn)折點價格
s:ema(c0,5);while x=-1 and c1>c2 do begin
i:=i+1;
c0:=c+y*x*i;
c1:=s;
end
while x=1 and c1<c2 do begin
i:=i+1;
c0:=c+y*x*i;
c1:=s;
end
mm: x; - 網(wǎng)友回復(fù):
編譯過不去呀,死機(jī)了。
另原來我已經(jīng)用c1:= ema(c0,5); 若再定義s:ema(c0,5); 那 循環(huán)語句中c1:= c1 和 c1:=s, 有差別嗎? - 網(wǎng)友回復(fù):
VARIABLE: i=0,x=0,y=0.2; //y為當(dāng)前品種最小的變動價位,今日值>昨日值x=-1,否則x=1,
c0:= c;
c1:= ema(c0,5);
c2:= ref(c1,1);
if c1>c2 then x:=-1; //x為-1,c1上升中,需遞減找到轉(zhuǎn)折點價格
if c1<c2 then x:=1; //x=1,c1處于下降中,需要滴增找到轉(zhuǎn)折點價格
if x=-1 and c1>c2 then begin
i:=i+1;
c0:=c+y*x*i;
c1:=c1;
end
if x=1 and c1<c2 then begin
i:=i+1;
c0:=c+y*x*i;
c1:=c1;
end
mm: x;
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫!(不貴!點擊查看價格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容