![]() |
在這個頁面顯示本主題全部的 5 個文章 |
奇狐社區論壇 (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=15113)
[求救]请教版主和各位高手,谢谢!!!!!
请把下面这段源码里的红绿竖线去掉,如图所示,谢谢!
input:kv(0.382,0,5),lenth(20,5,20),risk(3,1,20),money(2,1,20);
smax:=0*c;smin:=0*c;bsmax:=0*c;bsmin:=0*c;
HI:=0*h;LO:=0*l;Range1:=0*c;Range2:=0*c;
fc:=c; UpTrendBuffer:=0*c;DownTrendBuffer:=0*c;
m:=max(108,datacount-1000);
HI:=hhv(h,9);
LO:=llv(l,9);
Range1:=ma(tr,lenth);
Range2:=ma(tr,100);
for i=m to datacount do
begin
if Range1[i]< Range2[i] then Range1[i]:= Range2[i];
smin[i]:=LO[i] + 0.1*(HI[i]-LO[i]);
smax[i]:=HI[i]- 0.1*(HI[i]-LO[i]);
bsmax[i]:=HI[i]+(1.0+0.1*Risk)*Range1[i];////max=hi+1.3range
bsmin[i]:=LO[i]-(1.0+0.1*Risk)*Range1[i];///min=lo-1.3range
if fc[i]>smax[i] then trend:=1;
if fc[i]<smin[i] then trend:=-1;
if trend>0 then
begin
if LO[i]-Kv*Money*Range1[i]<bsmin[i] then bsmin[i]:=LO[i]-Kv*Money*Range1[i];///min=lo-0.764range;
if bsmin[i]<bsmin[i-1] then bsmin[i]:=bsmin[i-1];
end;
if trend<0 then
begin
if bsmax[i]<HI[i]+Kv*Money*Range1[i] then bsmax[i]:=HI[i]+Kv*Money*Range1[i] ;///max=hi+0.764range;
if bsmax[i]>bsmax[i-1] then bsmax[i]:=bsmax[i-1];
end ;
if trend>0 then
begin
if UpTrendBuffer[i-1]=-1.0 then
begin
bsmin[i]:=LO[i]-0.1*Risk*Range1[i];
UpTrendBuffer[i]:=bsmin[i];
end;
else UpTrendBuffer[i]:=bsmin[i];
DownTrendBuffer[i]:=-1.0;
end;
if trend<0 then
begin
if DownTrendBuffer[i-1]=-1.0 then
begin
bsmax[i]:=HI[i]+0.1*Risk*Range1[i];
DownTrendBuffer[i]:=bsmax[i];
end;
else DownTrendBuffer[i]:=bsmax[i];
UpTrendBuffer[i]:=-1.0;
end;
end;
stops:=if(UpTrendBuffer>0,UpTrendBuffer,DownTrendBuffer);
PARTLINE(stops>c,DownTrendBuffer),pointdot,linethick1,colorgreen;
PARTLINE(stops<c,UpTrendBuffer),pointdot,linethick2,colorred;
回覆: [求救]请教版主和各位高手,谢谢!!!!!
引用:
最初由 lxfyyylrx 發表
请把下面这段源码里的红绿竖线去掉,如图所示,谢谢!
input:kv(0.382,0,5),lenth(20,5,20),risk(3,1,20),money(2,1,20);
smax:=0*c;smin:=0*c;bsmax:=0*c;bsmin:=0*c;
HI:=0*h;LO:=0*l;Range1:=0*c;Range2:=0*c;
fc:=c; UpTrendBuffer:=0*c;DownTrendBuffer:=0*c;
m:=max(108,datacount-1000);
HI:=hhv(h,9);
LO:=llv(l,9);
Range1:=ma(tr,lenth);
Range2:=ma(tr,100);
for i=m to datacount do
begin
if Range1[i]< Range2[i] then Range1[i]:= Range2[i];
smin[i]:=LO[i] + 0.1*(HI[i]-LO[i]);
smax[i]:=HI[i]- 0.1*(HI[i]-LO[i]);
bsmax[i]:=HI[i]+(1.0+0.1*Risk)*Range1[i];////max=hi+1.3range
bsmin[i]:=LO[i]-(1.0+0.1*Risk)*Range1[i];///min=lo-1.3range
if fc[i]>smax[i] then trend:=1;
if fc[i]<smin[i] then trend:=-1;
if trend>0 then
begin
if LO[i]-Kv*Money*Range1[i]<bsmin[i] then bsmin[i]:=LO[i]-Kv*Money*Range1[i];///min=lo-0.764range;
if bsmin[i]<bsmin[i-1] then bsmin[i]:=bsmin[i-1];
end;
if trend<0 then
begin
if bsmax[i]<HI[i]+Kv*Money*Range1[i] then bsmax[i]:=HI[i]+Kv*Money*Range1[i] ;///max=hi+0.764range;
if bsmax[i]>bsmax[i-1] then bsmax[i]:=bsmax[i-1];
end ;
if trend>0 then
begin
if UpTrendBuffer[i-1]=-1.0 then
begin
bsmin[i]:=LO[i]-0.1*Risk*Range1[i];
UpTrendBuffer[i]:=bsmin[i];
end;
else UpTrendBuffer[i]:=bsmin[i];
DownTrendBuffer[i]:=-1.0;
end;
if trend<0 then
begin
if DownTrendBuffer[i-1]=-1.0 then
begin
bsmax[i]:=HI[i]+0.1*Risk*Range1[i];
DownTrendBuffer[i]:=bsmax[i];
end;
else DownTrendBuffer[i]:=bsmax[i];
UpTrendBuffer[i]:=-1.0;
end;
end;
stops:=if(UpTrendBuffer>0,UpTrendBuffer,DownTrendBuffer);
PARTLINE(stops>c,DownTrendBuffer),pointdot,linethick1,colorgreen;
PARTLINE(stops<c,UpTrendBuffer),pointdot,linethick2,colorred;
回覆: 回覆: [求救]请教版主和各位高手,谢谢!!!!!
引用:
最初由 cgjj 發表
PARTLINE(stops>c,DownTrendBuffer),pointdot,linethick1,colorgreen;
PARTLINE(stops<c,UpTrendBuffer),pointdot,linethick2,colorred;
改為
PARTLINE(sum(stops>c,2)=2,DownTrendBuffer),pointdot,linethick1,colorgreen;
PARTLINE(sum(stops<c,2)=2,UpTrendBuffer),pointdot,linethick2,colorred; [/B]
回覆: 回覆: 回覆: [求救]请教版主和各位高手,谢谢!!!!!
引用:
最初由 lxfyyylrx 發表
谢谢版主帮助,但问题没有完全解决,还请费心看看,谢谢!!!
回覆: 回覆: 回覆: 回覆: [求救]请教版主和各位高手,谢谢!!!!!
引用:
最初由 cgjj 發表
您的問題可能不是在於 PARTLINE 的處理
而是在於該處 UpTrendBuffer 的數值異常
請 check 有問題的地方, 該處的 UpTrendBuffer 值
看看是否有 UpTrendBuffer <=0 的這種狀況
這應該是此公式本身邏輯造成的結果
要修正請自邏輯下手(可能只依賴 stops<c 來決定畫, 是不足的)
| 全部時間均為台灣時間, 現在時間為14:02 | 在這個頁面顯示本主題全部的 5 個文章 |
Powered by: vBulletin Version 2.3.0 - Copyright©2000-, Jelsoft Enterprises Limited.
簡愛洋行 製作 Copyright 2003-. All Rights Reserved.