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