 |
Markchu7
資深會員
註冊日期: Nov 2007
來 自:
文章數量: 1518 |
請求協助變更起點後的空停損與多停損
S:=WMA(C,111);
X:=WMA(C,223);
多空:IF(BARSLAST(CROSS(S,X))<BARSLAST(CROSS(X,S)),1,-1);
DD:REF(H,BARSLAST(CROSS(0.8,H=HHV(H,5)))+1)+4.25,COLORBLUE,LINEDOT;
UU:REF(L,BARSLAST(CROSS(0.8,L=LLV(L,5)))+1)-4.25,COLORRED,LINEDOT;
/////////////////////////////////////////
CC:=C;
StDD:=lbound(DD);
空停損:=DD*0 linethick0 colorblue;
空停損[StDD]:=DD[StDD]; DDF:=0;
DDSNo:=空停損;
for i=StDD+1 to datacount do begin
空停損[i]:=空停損[i-1]; DDSNo[i]:=DDSNo[i-1];
if CC[i]>空停損[i-1] then DDF:=1;
if DD[i]<DD[i-1] then begin
if DD[i]<空停損[i-1] then begin
空停損[i]:=DD[i]; DDF:=0;
end else if DD[i]<DD[i-1] and DDF=1 then begin
空停損[i]:=DD[i]; DDF:=0; DDSNo[i]:=DDSNo[i]+1;
end;
end;
end;
StUU:=lbound(UU);
多停損:=UU*0 linethick0 colorRED;
多停損[StUU]:=UU[StUU]; UUF:=0;
UUSNo:=多停損;
for i=StUU+1 to datacount do begin
多停損[i]:=多停損[i-1]; UUSNo[i]:=UUSNo[i-1];
if CC[i]<多停損[i-1] then UUF:=1;
if UU[i]>UU[i-1] then begin
if UU[i]>多停損[i-1] then begin
多停損[i]:=UU[i]; UUF:=0;
end else if UU[i]>UU[i-1] and UUF=1 then begin
多停損[i]:=UU[i]; UUF:=0; UUSNo[i]:=UUSNo[i]+1;
end;
end;
end;
PARTLINE(DDSNo=ref(DDSNo,1),空停損) colorblue linethick2;
PARTLINE(UUSNo=ref(UUSNo,1),多停損) colorRED linethick2;
以上源碼請求協助變更起點後的空停損與多停損!
做空起點:CROSS(空,0.8);
做多起點:CROSS(多,0.8);
感恩!
|
|
向版主報告此篇 |  |
|
2015-05-22 16:43 |
|
|
|  |
 |
cgjj
總版主

註冊日期: Oct 2003
來 自:
文章數量: 18196 |
回覆: 請求協助變更起點後的空停損與多停損
引用: 最初由 Markchu7 發表
S:=WMA(C,111);
X:=WMA(C,223);
多空:IF(BARSLAST(CROSS(S,X))<BARSLAST(CROSS(X,S)),1,-1);
DD:REF(H,BARSLAST(CROSS(0.8,H=HHV(H,5)))+1)+4.25,COLORBLUE,LINEDOT;
UU:REF(L,BARSLAST(CROSS(0.8,L=LLV(L,5)))+1)-4.25,COLORRED,LINEDOT;
/////////////////////////////////////////
CC:=C;
StDD:=lbound(DD);
空停損:=DD*0 linethick0 colorblue;
空停損[StDD]:=DD[StDD]; DDF:=0;
DDSNo:=空停損;
for i=StDD+1 to datacount do begin
空停損[i]:=空停損[i-1]; DDSNo[i]:=DDSNo[i-1];
if CC[i]>空停損[i-1] then DDF:=1;
if DD[i]<DD[i-1] then begin
if DD[i]<空停損[i-1] then begin
空停損[i]:=DD[i]; DDF:=0;
end else if DD[i]<DD[i-1] and DDF=1 then begin
空停損[i]:=DD[i]; DDF:=0; DDSNo[i]:=DDSNo[i]+1;
end;
end;
end;
StUU:=lbound(UU);
多停損:=UU*0 linethick0 colorRED;
多停損[StUU]:=UU[StUU]; UUF:=0;
UUSNo:=多停損;
for i=StUU+1 to datacount do begin
多停損[i]:=多停損[i-1]; UUSNo[i]:=UUSNo[i-1];
if CC[i]<多停損[i-1] then UUF:=1;
if UU[i]>UU[i-1] then begin
if UU[i]>多停損[i-1] then begin
多停損[i]:=UU[i]; UUF:=0;
end else if UU[i]>UU[i-1] and UUF=1 then begin
多停損[i]:=UU[i]; UUF:=0; UUSNo[i]:=UUSNo[i]+1;
end;
end;
end;
PARTLINE(DDSNo=ref(DDSNo,1),空停損) colorblue linethick2;
PARTLINE(UUSNo=ref(UUSNo,1),多停損) colorRED linethick2;
以上源碼請求協助變更起點後的空停損與多停損!
做空起點:CROSS(空,0.8);
做多起點:CROSS(多,0.8);
感恩!
Sorry 不太懂您意思, 要變更成怎樣?
|
|
向版主報告此篇 |  |
|
2015-05-22 18:11 |
|
|
|  |
本站所有內容未經作者授權禁止轉貼節錄, 發表言論僅供參考勿作為投資決策依據。瀏覽本站請使用 IE 5.5 以上版本, 最佳瀏覽解析度 1024 x 768 全彩。
|
Powered by: vBulletin Version 2.3.0 - Copyright©2000-, Jelsoft Enterprises Limited.
簡愛洋行 製作 Copyright 2003-. All Rights Reserved. 聯絡我們
|