奇狐社區論壇
在這個頁面顯示本主題全部的 7 個文章

奇狐社區論壇 (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=4841)


由 海參威 在 2006-03-23 11:06 發表:

發現 [求助]均線排序

我需要將9均線排序後按大小標示在解盤上
請教如何編寫公式
感恩.............

__________________
.....大道至簡.....
真言一句話....
不傳千編文.....
http://hcw8845.blogspot.com


由 peter109 在 2006-03-23 12:38 發表:

提供參考

收盤:C;A:MA(C,5);
B:MA(C,10);CC:MA(C,20);
D:MA(C,55);gb:=SYSPARAM(1);
p[1]:=收盤[gb];p[2]:=a[gb];
p[3]:=b[gb];p[4]:=cc[gb];
p[5]:=d[gb];
s[1]:=收盤[gb];s[2]:=a[gb];
s[3]:=b[gb];s[4]:=cc[gb];
s[5]:=d[gb];
VARIABLE: ptr[5]='';//由於出現符號 請自行調整到位
ptr[1]:='收盤';ptr[2]:='a';
ptr[3]:='b';ptr[4]:='cc';
ptr[5]:='d';px:=SORTPOS(p,1,1,5);
EXPLAINEX(barpos=gb,ptr[p[1]]+': ',s[p[1]],3,0);
EXPLAINEX(barpos=gb,ptr[p[2]]+': ',s[p[2]],3,0);
EXPLAINEX(barpos=gb,ptr[p[3]]+': ',s[p[3]],3,0);
EXPLAINEX(barpos=gb,ptr[p[4]]+': ',s[p[4]],3,0);
EXPLAINEX(barpos=gb,ptr[p[5]]+': ',s[p[5]],3,0);

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


由 cgjj 在 2006-03-23 13:45 發表:

M1:MA(c,1); M2:MA(c,2); M3:MA(c,3);
M4:MA(c,4); M5:MA(c,5); M6:MA(c,6);
M7:MA(c,7); M8:MA(c,8); M9:MA(c,9);
PP:=SYSPARAM(1);
MM:=C*0;
MM[1]:=M1[PP]; MM[2]:=M2[PP]; MM[3]:=M3[PP];
MM[4]:=M4[PP]; MM[5]:=M5[PP]; MM[6]:=M6[PP];
MM[7]:=M7[PP]; MM[8]:=M8[PP]; MM[9]:=M9[PP];
MMP:=MM;
x:=SORTPOS(MMP,0,1,9);
EXPLAINEX(1,'M'+NUMTOSTR(MMP[1],0)+': ',MM[MMP[1]],2,0);
EXPLAINEX(1,'M'+NUMTOSTR(MMP[2],0)+': ',MM[MMP[2]],2,0);
EXPLAINEX(1,'M'+NUMTOSTR(MMP[3],0)+': ',MM[MMP[3]],2,0);
EXPLAINEX(1,'M'+NUMTOSTR(MMP[4],0)+': ',MM[MMP[4]],2,0);
EXPLAINEX(1,'M'+NUMTOSTR(MMP[5],0)+': ',MM[MMP[5]],2,0);
EXPLAINEX(1,'M'+NUMTOSTR(MMP[6],0)+': ',MM[MMP[6]],2,0);
EXPLAINEX(1,'M'+NUMTOSTR(MMP[7],0)+': ',MM[MMP[7]],2,0);
EXPLAINEX(1,'M'+NUMTOSTR(MMP[8],0)+': ',MM[MMP[8]],2,0);
EXPLAINEX(1,'M'+NUMTOSTR(MMP[9],0)+': ',MM[MMP[9]],2,0);


由 海參威 在 2006-03-23 15:39 發表:

非常的感謝倆位大大的幫助
感恩................
感恩................

__________________
.....大道至簡.....
真言一句話....
不傳千編文.....
http://hcw8845.blogspot.com


由 founders008 在 2014-01-22 11:54 發表:

如果是
ma(c,2)-----ma(c,datacount)

未知條數的均線,又如何選出最大最小及均線參數呢?


謝謝


由 cgjj 在 2014-01-22 17:51 發表:

引用:
最初由 founders008 發表
如果是
ma(c,2)-----ma(c,datacount)

未知條數的均線,又如何選出最大最小及均線參數呢?


謝謝



警告!!!
此公式計算量非常龐大, K棒數越多算的越費時
若無此需求, 不建議拿它來做測試


因計算量太龐大
故僅求算最未根之 ma(c,2) 至 ma(c,datacount) 結果


原碼:

MM
:=C*0;
for 
i=1 to datacount do begin
  CC
:=Cx:=SETLBOUND(CC,datacount-i+1); //僅取需要的部分
  
tmp:=MA(CC,i); MM[i]:=tmp[datacount];
end;
PM:=MMx:=SORTPOS(PM,0,2,datacount);
最未根之最小MA參數:PM[2];
最未根之最大MA參數:PM[datacount];
最未根之最小MA數值:MM[PM[2]];
最未根之最大MA數值:MM[PM[datacount]];


由 founders008 在 2014-01-23 15:16 發表:

引用:
最初由 cgjj 發表
警告!!!
此公式計算量非常龐大, K棒數越多算的越費時
若無此需求, 不建議拿它來做測試


因計算量太龐大
故僅求算最未根之 ma(c,2) 至 ma(c,datacount) 結果


原碼:

MM
:=C*0;
for 
i=1 to datacount do begin
  CC
:=Cx:=SETLBOUND(CC,datacount-i+1); //僅取需要的部分
  
tmp:=MA(CC,i); MM[i]:=tmp[datacount];
end;
PM:=MMx:=SORTPOS(PM,0,2,datacount);
最未根之最小MA參數:PM[2];
最未根之最大MA參數:PM[datacount];
最未根之最小MA數值:MM[PM[2]];
最未根之最大MA數值:MM[PM[datacount]];




多謝!


全部時間均為台灣時間, 現在時間為23:18
在這個頁面顯示本主題全部的 7 個文章


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

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