奇狐社區論壇 總頁數 (2): « 1 [2]
在這個頁面顯示本主題全部的 23 個文章

奇狐社區論壇 (http://www.chiefox.com.tw/bbs/index.php)
- 問題交流 (http://www.chiefox.com.tw/bbs/forumdisplay.php?forumid=28)
-- 請問後一次條件成立位置如何取得 (http://www.chiefox.com.tw/bbs/showthread.php?threadid=4116)


由 peter109 在 2005-10-27 20:37 發表:

互相 互相啦
希望能加減有所幫助

條件句咱沒法
哪位改善吧
感恩唷

__________________
至誠能勝天下至偽
至拙能勝天下至巧


由 hwyhon 在 2006-05-16 11:25 發表:

引用:
最初由 cgjj 發表
原碼:

a
:MA(CLOSE,10)COLORGREEN;
b:MA(CLOSE,30)COLORBLUE;
金叉:IF(CROSS(a,b),CLOSE,0);
前金叉:ref(金叉,ref(BARSLAST(金叉),1)+1LINETHICK0;
後金叉:c*0;
for 
NPos=lbound(金叉to ubound(金叉) do begin 
  
if 金叉[NPos]>1 then begin
    
for ZPos=NPos+1 to ubound(金叉) do begin 
      
if 金叉[ZPos]>0 then begin
        
for S=NPos to ZPos-do begin
          後金叉
[S]:=金叉[ZPos];
        
end;
        break;
      
end;
    
end;
  
end;
end;






如此例
我若要再多加上顯示出
此金叉到後金叉的週期數該如何寫
也就是
當此金叉位置處,十字線往後金叉位置右移一週期
顯示的數字(天數)相對减少一
後金叉成立的前一天該是顯示為 1
移到後金叉成立的位置處該是顯示為 0
程式語言不會
請版大幫忙
謝謝


由 hwyhon 在 2006-05-16 14:24 發表:

再次煩請
cgjj 總版主幫忙一下

謝謝


由 kkkkkk 在 2006-05-17 08:32 發表:

且學習一下總版主的循環

a:MA(CLOSE,10)COLORwhite;
b:MA(CLOSE,30)COLORyellow;
金叉:IF(CROSS(a,b),barpos,0),linethick0;
前金叉:ref(金叉,ref(BARSLAST(金叉),1)+1) LINETHICK0;
後金叉:c*0,linethick0;
for NPos=lbound(金叉) to ubound(金叉) do begin
if 金叉[NPos]>1 then begin
for ZPos=NPos+1 to ubound(金叉) do begin
if 金叉[ZPos]>0 then begin
for S=NPos to ZPos-1 do begin
後金叉[S]:=金叉[ZPos];
end;
break;
end;
end;
end;
end;


vertline(cross(a,b));
ba:=barslast(cross(a,b)),linethick0,colorwhite;
n:=if(後金叉=0,0,ref((後金叉-金叉)*(ba=0),barslast((後金叉-金叉)*(ba=0))));
x:if(後金叉=0,0,if(ba=0,0,n-ba)),linethick0,colorwhite;


由 hwyhon 在 2006-05-17 13:26 發表:

感謝K 大的解答

vertline(cross(a,b));
ba:=barslast(cross(a,b)),linethick0,colorwhite;
n:=if(後金叉=0,0,ref((後金叉-金叉)*(ba=0),barslast((後金叉-金叉)*(ba=0))));
x:if(後金叉=0,0,if(ba=0,0,n-ba)),linethick0,colorwhite;

奇狐內建函數就差這函數
簡單的幾句
解答了用奇狐來的多年困惑
您真是強
不輸專業人員
謝謝


由 hwyhon 在 2006-05-17 14:10 發表:

a:MA(CLOSE,10)COLORGREEN;
b:MA(CLOSE,30)COLORBLUE;
金叉:IF(CROSS(a,b),CLOSE,0);
前金叉:ref(金叉,ref(BARSLAST(金叉),1)+1) LINETHICK0;
後金叉:c*0;
for NPos=lbound(金叉) to ubound(金叉) do begin
if 金叉[NPos]>1 then begin
for ZPos=NPos+1 to ubound(金叉) do begin
if 金叉[ZPos]>0 then begin
for S=NPos to ZPos-1 do begin
後金叉[S]:=金叉[ZPos];
end;
break;
end;
end;
end;
end;

請問奇狐
把未來成立的數據拿到當下位置用
除了這方法外
有沒其他運算較快的寫法
感謝


由 hwyhon 在 2006-05-20 15:56 發表:

?????
!!!!!


由 cgjj 在 2006-05-20 17:19 發表:

方法是人想出來的, 我相信有!
就是要多動腦啦


全部時間均為台灣時間, 現在時間為17:51 總頁數 (2): « 1 [2]
在這個頁面顯示本主題全部的 23 個文章


Powered by: vBulletin Version 2.3.0 - Copyright©2000-, Jelsoft Enterprises Limited.

簡愛洋行 製作 Copyright 2003-. All Rights Reserved.