 |
peter109
資深會員
註冊日期: Dec 2004
來 自: Taipei
文章數量: 1893 |
CC:=C; CC:=CC[DATACOUNT];
X01:=CROSS(C,MA(C,20));
X02:REF(L,BARSLAST(X01));
計算
最近(最後)的30個 X02<>REF(X02,1)的對應值X02 並和CC經排序後做逐行列出
__________________
至誠能勝天下至偽
至拙能勝天下至巧
|
|
向版主報告此篇 |  |
|
2019-01-08 10:16 |
|
|
|  |
 |
peter109
資深會員
註冊日期: Dec 2004
來 自: Taipei
文章數量: 1893 |
引用: 最初由 cgjj 發表
原碼: Note:='AAAA\nBBBB\nCCCC\nDDDD\nEEEE\nGGGG\nHHHH\nIIII\nJJJJ\nKKKK\nLLLL\nMMMM';
MaxRowNum:=5; //設定最大Row數,超過此值切割顯示
ColMaxNo:=999; //設定Col數處理極限值
VARIABLE: NextColP[ColMaxNo]=0;
ColNo:=1; NowFindP:=1; OldFindP:=1; FindLineNum:=0;
WHILE 1 do begin
FindP:=strfind(Note,'\n',NowFindP);
if FindP=0 then break;
NowFindP:=FindP+strlen('\n'); FindLineNum:=FindLineNum+1;
if FindLineNum=MaxRowNum then begin
FindLineNum:=0; NextColP[ColNo]:=NowFindP;
if ColNo=ColMaxNo then break;
ColNo:=ColNo+1;
end;
end;
if strmid(Note,NowFindP,0)>'' then begin
NextColP[ColNo]:=strlen(Note)+1;
end else begin
ColNo:=ColNo-1;
end;
MSP:=40; //設定每個Col的寬度
if NextColP[1]>0 then DRAWTEXTEX(1,0,3+MSP*0,0,Strmid(Note,1,NextColP[1]-1)) coloryellow;
if NextColP[2]>0 then DRAWTEXTEX(1,0,3+MSP*1,0,Strmid(Note,NextColP[1],NextColP[2]-NextColP[1])) coloryellow;
if NextColP[3]>0 then DRAWTEXTEX(1,0,3+MSP*2,0,Strmid(Note,NextColP[2],NextColP[3]-NextColP[2])) coloryellow;
//依此類推....
盤中觀察到目前為止 時常會只列出前30個數據後 沒有換行就嘎然而止 但有些時候又會列出到第60個數據 換市場/商品 觀看列出的速度 顯示的又很快 不像很吃資源 不懂原因為何
__________________
至誠能勝天下至偽
至拙能勝天下至巧
|
|
向版主報告此篇 |  |
|
2019-01-08 15:58 |
|
|
|  |
 |
peter109
資深會員
註冊日期: Dec 2004
來 自: Taipei
文章數量: 1893 |
引用: 最初由 peter109 發表
CC:=C; CC:=CC[DATACOUNT];
X01:=CROSS(C,MA(C,20));
X02:REF(L,BARSLAST(X01));
計算
最近(最後)的30個 X02<>REF(X02,1)的對應值X02 並和CC經排序後做逐行列出
當 StNo:=lbound(BARSSINCE(DE=DE[datacount]-5));
列出的結果(尚未加入CC做排序)如下 只有一列 第2列就會呈現時有時沒
//垂直線 左邊(晶紅色)是第一個數據 右邊(綠色)是第30個數據
peter109 附帶上了此圖片:
__________________
至誠能勝天下至偽
至拙能勝天下至巧
|
|
向版主報告此篇 |  |
|
2019-01-08 16:16 |
|
|
|  |
 |
peter109
資深會員
註冊日期: Dec 2004
來 自: Taipei
文章數量: 1893 |
引用: 最初由 cgjj 發表
只列出價嗎? 還有無其它資訊要一同列出?
麻煩給個列出的樣本
此處列出方式只需要價
__________________
至誠能勝天下至偽
至拙能勝天下至巧
|
|
向版主報告此篇 |  |
|
2019-01-09 08:29 |
|
|
|  |
 |
cgjj
總版主

註冊日期: Oct 2003
來 自:
文章數量: 18117 |
根據您的需求,重新架構程式了
原碼: CC:C linethick0 colorred; CC:=CC[DATACOUNT]; //最新價
XX:=CROSS(C,MA(C,20)) or barpos=0; LL:=L;
MaxItem:=100; //設定僅統計近期n組XX
ItemNum:0 linethick0; //累計XX組數
PN:=0; //設定顯示價的小數位數
MaxRowNum:=10; //設定最大Row數,超過此值切割顯示
RecXP:=C*0; RecXN:=RecXP;
RecNum:1 linethick0; //價位數(含最新價)
RecXP[1]:=CC; RecXN[1]:=1; RN:=0;
ColWidth:=' '; //設定Col寬度(增減空白字元調整)
//註:沒有顯示Col數量的限制,視窗寬度決定能顯示的範圍。
for i=datacount downto 1 do begin
if XX[i] then begin
ItemNum:=ItemNum+1;
for j=1 to RecNum do begin
if LL[i]=RecXP[j] then begin
RecXN[j]:=RecXN[j]+1;
NL:=strlen(numtostr(RecXN[j],0)); if NL>RN then RN:=NL;
break;
end;
end;
if j=RecNum+1 then begin
RecXP[j]:=LL[i]; RecXN[j]:=1; RecNum:=RecNum+1;
end;
end;
if ItemNum=MaxItem then break;
end;
PP:=RecXP; x:=SORTPOS(PP,0,1,RecNum);
VARIABLE:PR[MaxRowNum]=''; RN:=RN+1;
for i=1 to RecNum do begin
RowN:=mod(i-1,MaxRowNum)+1;
if PP[i]=1 then begin
RedRowN:=RowN; RedColN:=floor((i-1)/MaxRowNum)+1; iRed:=i;
end;
UStr:=numtostr(RecXP[PP[i]],PN);
NAdd:=''; if RecXN[PP[i]]>1 then NAdd:='*'+numtostr(RecXN[PP[i]],0);
RAdd:=strleft(ColWidth,RN-strlen(NAdd));
PR[RowN]:=PR[RowN]+strright(ColWidth+UStr+NAdd+RAdd,strlen(ColWidth));
end;
PrStr:=''; PrRed:='';
for i=1 to MaxRowNum do PrStr:=PrStr+PR[i]+'\n';
for i=2 to RedRowN do PrRed:=PrRed+' \n';
for j=2 to RedColN do PrRed:=PrRed+ColWidth;
RedStr:=numtostr(RecXP[PP[iRed]],PN);
NAdd:=''; if RecXN[PP[iRed]]>1 then NAdd:='*'+numtostr(RecXN[PP[iRed]],0);
RAdd:=strleft(ColWidth,RN-strlen(NAdd));
PrRed:=PrRed+strright(ColWidth+RedStr+NAdd+RAdd,strlen(ColWidth));
DRAWTEXTEX(1,0,3,0,PrStr) coloryellow;
DRAWTEXTEX(1,0,3,0,PrRed) colorred;
|
|
向版主報告此篇 |  |
|
2019-01-09 14:08 |
|
|
|  |
 |
peter109
資深會員
註冊日期: Dec 2004
來 自: Taipei
文章數量: 1893 |
引用: 最初由 cgjj 發表
根據您的需求,重新架構程式了
原碼: CC:C linethick0 colorred; CC:=CC[DATACOUNT]; //最新價
XX:=CROSS(C,MA(C,20)) or barpos=0; LL:=L;
MaxItem:=100; //設定僅統計近期n組XX
ItemNum:0 linethick0; //累計XX組數
PN:=0; //設定顯示價的小數位數
MaxRowNum:=10; //設定最大Row數,超過此值切割顯示
RecXP:=C*0; RecXN:=RecXP;
RecNum:1 linethick0; //價位數(含最新價)
RecXP[1]:=CC; RecXN[1]:=1; RN:=0;
ColWidth:=' '; //設定Col寬度(增減空白字元調整)
//註:沒有顯示Col數量的限制,視窗寬度決定能顯示的範圍。
for i=datacount downto 1 do begin
if XX[i] then begin
ItemNum:=ItemNum+1;
for j=1 to RecNum do begin
if LL[i]=RecXP[j] then begin
RecXN[j]:=RecXN[j]+1;
NL:=strlen(numtostr(RecXN[j],0)); if NL>RN then RN:=NL;
break;
end;
end;
if j=RecNum+1 then begin
RecXP[j]:=LL[i]; RecXN[j]:=1; RecNum:=RecNum+1;
end;
end;
if ItemNum=MaxItem then break;
end;
PP:=RecXP; x:=SORTPOS(PP,0,1,RecNum);
VARIABLE:PR[MaxRowNum]=''; RN:=RN+1;
for i=1 to RecNum do begin
RowN:=mod(i-1,MaxRowNum)+1;
if PP[i]=1 then begin
RedRowN:=RowN; RedColN:=floor((i-1)/MaxRowNum)+1; iRed:=i;
end;
UStr:=numtostr(RecXP[PP[i]],PN);
NAdd:=''; if RecXN[PP[i]]>1 then NAdd:='*'+numtostr(RecXN[PP[i]],0);
RAdd:=strleft(ColWidth,RN-strlen(NAdd));
PR[RowN]:=PR[RowN]+strright(ColWidth+UStr+NAdd+RAdd,strlen(ColWidth));
end;
PrStr:=''; PrRed:='';
for i=1 to MaxRowNum do PrStr:=PrStr+PR[i]+'\n';
for i=2 to RedRowN do PrRed:=PrRed+' \n';
for j=2 to RedColN do PrRed:=PrRed+ColWidth;
RedStr:=numtostr(RecXP[PP[iRed]],PN);
NAdd:=''; if RecXN[PP[iRed]]>1 then NAdd:='*'+numtostr(RecXN[PP[iRed]],0);
RAdd:=strleft(ColWidth,RN-strlen(NAdd));
PrRed:=PrRed+strright(ColWidth+RedStr+NAdd+RAdd,strlen(ColWidth));
DRAWTEXTEX(1,0,3,0,PrStr) coloryellow;
DRAWTEXTEX(1,0,3,0,PrRed) colorred;
先收下 若有問題再請您協助 感恩
__________________
至誠能勝天下至偽
至拙能勝天下至巧
|
|
向版主報告此篇 |  |
|
2019-01-09 14:22 |
|
|
|  |
本站所有內容未經作者授權禁止轉貼節錄, 發表言論僅供參考勿作為投資決策依據。瀏覽本站請使用 IE 5.5 以上版本, 最佳瀏覽解析度 1024 x 768 全彩。
|
Powered by: vBulletin Version 2.3.0 - Copyright©2000-, Jelsoft Enterprises Limited.
簡愛洋行 製作 Copyright 2003-. All Rights Reserved. 聯絡我們
|