 |
co2
中級會員
註冊日期: Feb 2004
來 自: 南台灣
文章數量: 65 |
引用: 最初由 cgjj 發表
原碼:
StDoTime:=085000;
多進:=多進 and time>=StDoTime or barpos=0;
空進:=空進 and time>=StDoTime or barpos=0;
進場:=多進-空進;
強出:=time>=133500;
限進:=time>=131000;
限停損次:=2; //每日
損控點數:=18;
黑五:=sum(C<O,5)=5;
OO:=O; CC:=C; HH:=H; LL:=L;
StDE:=barpos=1 or time=StDoTime;
DoBS:C*0 NOAXIS;
多空:=0; //1.多 -1.空 0.無
for i=1 to datacount do begin
if StDE[i] then 累停損次:=0;
if 多空=0 and 強出[i]=0 and 限進[i]=0 and 累停損次<限停損次 then begin
多空:=進場[i]*2;
if 多空<>0 then begin
進價:=OO[i]; Max盈:=0; PreTN:=0;
end;
end else if 多空<>0 then begin
NowDir:=SGN(多空);
if 強出[i] then begin
多空:=0;
end else if NowDir=-進場[i] then begin
多空:=-NowDir*2*(限進[i]=0); //反手
if 多空<>0 then begin
進價:=OO[i]; Max盈:=0; PreTN:=0;
end;
end else begin
損HL:=LL[i]*(NowDir=1)+HH[i]*(NowDir=-1);
盈HL:=HH[i]*(NowDir=1)+LL[i]*(NowDir=-1);
盈利L:=(損HL-進價)*NowDir;
if (損HL-進價)*NowDir<=-損控點數 then begin
多空:=0; 累停損次:=累停損次+1; //停損
end else if Max盈>=61 then begin
if 黑五[i] or 盈利L<Max盈*0.75 then 多空:=0;
end else if Max盈>=41 then begin
if 盈利L<=Max盈*0.4 then begin
多空:=0;
end else if 盈利L<=Max盈*0.7 and PreTN<>0.7 then begin
多空:=多空-NowDir; PreTN:=0.7;
end;
end else if Max盈>=21 then begin
if 盈利L<=Max盈-32 then begin
多空:=0;
end else if 盈利L<Max盈-16 and PreTN<>16 then begin
多空:=多空-NowDir; PreTN:=16;
end;
end;
盈利H:=(盈HL-進價)*NowDir;
if 盈利H>Max盈 then Max盈:=盈利H;
end;
end;
DoBS[i]:=多空;
end;
請自行帶入 多進 和空進 訊號於前( 盤中訊號不可浮動)
此段程式其以開盤價在訊號成立當根進場
(請自行視需要決定帶入訊號是否要右偏一根)
DoBS 變數
其為該根動作完成後所持有的口數
感謝 總版主,辛苦了!
經套用約略檢查一下,初步發現:以作多為例,如果作多,第二次停利之後的下一根K還會再進場作一次多單(DOBS=2),不知我有沒有看錯?請 總版主指教。謝謝!
|
|
向版主報告此篇 |  |
|
2012-10-02 16:49 |
|
|
|  |
 |
co2
中級會員
註冊日期: Feb 2004
來 自: 南台灣
文章數量: 65 |
引用: 最初由 cgjj 發表
圖中的 (5) 是因為該根K棒有 [多進] 訊號成立, 所以又進場做多
您希望的意思是
做多停利兩次後, 等待 [空進] 的訊號, 等待途中若觸及 [多進] 訊號不理它嗎?
其他 "等待反轉訊號" 也都是如此處理嗎?
也就是 多空多空多空.... 反向輪流做
不會有 多多空多空空多 這種狀態囉??
是的,當作多時若停利後(不管是一次停或兩次停)又遇上多訊也不再作多,因為目前所使用的買賣訊似乎不太適合這樣做。
另外,能否麻煩將 "DOBS" 執行訊號以 類似 下列方式呈現,方便檢視之用:
//DoLS (DOBS)意義:
1=多進 (空手時作多),
2=多出 (作多停利二口後空手),
3=空翻多 (作空停損二口同時作多二口),
4=多盈衰出 (作多時停利一口),
5=多損出 (停損二口,出清空手),
6=時間到 (出清所有手中多單),
-1=空進 (空手時作空),
-2=空出 (作空停利二口後空手),
-3=多翻空 (作多停損二口同時作空二口),
-4=空盈衰出 (作空時停利一口),
-5=空損出 (停損二口,出清空手),
-6=時間到 (出清所有手中空單),
當然,其中若有重疊或多餘的,就麻煩 總版主費神處理了。
|
|
向版主報告此篇 |  |
|
2012-10-03 11:11 |
|
|
|  |
 |
cgjj
總版主

註冊日期: Oct 2003
來 自:
文章數量: 18197 |
以 RecDO 數列, 來另外記錄前面提的需求
原碼:
StDoTime:=085000;
多進:=多進 and time>=StDoTime or barpos=0;
空進:=空進 and time>=StDoTime or barpos=0;
進場:=多進-空進;
強出:=time>=133500;
限進:=time>=131000;
限停損次:=2; //每日
損控點數:=18;
黑五:=sum(C<O,5)=5;
OO:=O; CC:=C; HH:=H; LL:=L;
StDE:=barpos=1 or time=StDoTime;
DoBS:C*0 NOAXIS; RecDO:C*0 linethick;
多空:=0; //1.多 -1.空 0.無
for i=1 to datacount do begin
if StDE[i] then begin
累停損次:=0; WaitBS:=0;
end;
if 多空=0 and 強出[i]=0 and 限進[i]=0 and 累停損次<限停損次 then begin
if WaitBS=0 or WaitBS=進場[i] then begin
多空:=進場[i]*2;
if 多空<>0 then begin
進價:=OO[i]; Max盈:=0; PreTN:=0; WaitBS:=-SGN(多空);
RecDO[i]:=SGN(多空);
end;
end;
end else if 多空<>0 then begin
NowDir:=SGN(多空);
if 強出[i] then begin
多空:=0; RecDO[i]:=NowDir*6;
end else if NowDir=-進場[i] then begin
多空:=-NowDir*2*(限進[i]=0); //反手
if 多空<>0 then begin
進價:=OO[i]; Max盈:=0; PreTN:=0; WaitBS:=-SGN(多空);
RecDO[i]:=-NowDir*4;
end;
end else begin
損HL:=LL[i]*(NowDir=1)+HH[i]*(NowDir=-1);
盈HL:=HH[i]*(NowDir=1)+LL[i]*(NowDir=-1);
盈利L:=(損HL-進價)*NowDir;
if (損HL-進價)*NowDir<=-損控點數 then begin
多空:=0; 累停損次:=累停損次+1; //停損
RecDO[i]:=NowDir*5;
end else if Max盈>=61 then begin
if 黑五[i] or 盈利L<Max盈*0.75 then begin
多空:=0; RecDO[i]:=NowDir*2;
end;
end else if Max盈>=41 then begin
if 盈利L<=Max盈*0.4 then begin
多空:=0; RecDO[i]:=NowDir*2;
end else if 盈利L<=Max盈*0.7 and PreTN<>0.7 then begin
多空:=多空-NowDir; PreTN:=0.7; RecDO[i]:=NowDir*3;
end;
end else if Max盈>=21 then begin
if 盈利L<=Max盈-32 then begin
多空:=0; RecDO[i]:=NowDir*2;
end else if 盈利L<Max盈-16 and PreTN<>16 then begin
多空:=多空-NowDir; PreTN:=16; RecDO[i]:=NowDir*3;
end;
end;
盈利H:=(盈HL-進價)*NowDir;
if 盈利H>Max盈 then Max盈:=盈利H;
end;
end;
DoBS[i]:=多空;
end;
RecDO意義:
1 多進, 2 多盈餘出, 3 多盈衰出, 4 空翻多, 5 多損出, 6 多強出
-1 空進,-2 空盈餘出,-3 空盈衰出,-4 多翻空,-5 空損出,-6 空強出
其中 "衰出" 是指達到盈衰之條件停利一口的狀況
其中 "餘出" 是指達到盈衰之條件全部清倉的狀況
DoBS 數列
其仍為該根動作完成後所持有的口數
|
|
向版主報告此篇 |  |
|
2012-10-03 15:41 |
|
|
|  |
 |
co2
中級會員
註冊日期: Feb 2004
來 自: 南台灣
文章數量: 65 |
引用: 最初由 cgjj 發表
以 RecDO 數列, 來另外記錄前面提的需求
原碼:
StDoTime:=085000;
多進:=多進 and time>=StDoTime or barpos=0;
空進:=空進 and time>=StDoTime or barpos=0;
進場:=多進-空進;
強出:=time>=133500;
限進:=time>=131000;
限停損次:=2; //每日
損控點數:=18;
黑五:=sum(C<O,5)=5;
OO:=O; CC:=C; HH:=H; LL:=L;
StDE:=barpos=1 or time=StDoTime;
DoBS:C*0 NOAXIS; RecDO:C*0 linethick;
多空:=0; //1.多 -1.空 0.無
for i=1 to datacount do begin
if StDE[i] then begin
累停損次:=0; WaitBS:=0;
end;
if 多空=0 and 強出[i]=0 and 限進[i]=0 and 累停損次<限停損次 then begin
if WaitBS=0 or WaitBS=進場[i] then begin
多空:=進場[i]*2;
if 多空<>0 then begin
進價:=OO[i]; Max盈:=0; PreTN:=0; WaitBS:=-SGN(多空);
RecDO[i]:=SGN(多空);
end;
end;
end else if 多空<>0 then begin
NowDir:=SGN(多空);
if 強出[i] then begin
多空:=0; RecDO[i]:=NowDir*6;
end else if NowDir=-進場[i] then begin
多空:=-NowDir*2*(限進[i]=0); //反手
if 多空<>0 then begin
進價:=OO[i]; Max盈:=0; PreTN:=0; WaitBS:=-SGN(多空);
RecDO[i]:=-NowDir*4;
end;
end else begin
損HL:=LL[i]*(NowDir=1)+HH[i]*(NowDir=-1);
盈HL:=HH[i]*(NowDir=1)+LL[i]*(NowDir=-1);
盈利L:=(損HL-進價)*NowDir;
if (損HL-進價)*NowDir<=-損控點數 then begin
多空:=0; 累停損次:=累停損次+1; //停損
RecDO[i]:=NowDir*5;
end else if Max盈>=61 then begin
if 黑五[i] or 盈利L<Max盈*0.75 then begin
多空:=0; RecDO[i]:=NowDir*2;
end;
end else if Max盈>=41 then begin
if 盈利L<=Max盈*0.4 then begin
多空:=0; RecDO[i]:=NowDir*2;
end else if 盈利L<=Max盈*0.7 and PreTN<>0.7 then begin
多空:=多空-NowDir; PreTN:=0.7; RecDO[i]:=NowDir*3;
end;
end else if Max盈>=21 then begin
if 盈利L<=Max盈-32 then begin
多空:=0; RecDO[i]:=NowDir*2;
end else if 盈利L<Max盈-16 and PreTN<>16 then begin
多空:=多空-NowDir; PreTN:=16; RecDO[i]:=NowDir*3;
end;
end;
盈利H:=(盈HL-進價)*NowDir;
if 盈利H>Max盈 then Max盈:=盈利H;
end;
end;
DoBS[i]:=多空;
end;
RecDO意義:
1 多進, 2 多盈餘出, 3 多盈衰出, 4 空翻多, 5 多損出, 6 多強出
-1 空進,-2 空盈餘出,-3 空盈衰出,-4 多翻空,-5 空損出,-6 空強出
其中 "衰出" 是指達到盈衰之條件停利一口的狀況
其中 "餘出" 是指達到盈衰之條件全部清倉的狀況
DoBS 數列
其仍為該根動作完成後所持有的口數
總版主,辛苦您了,謝謝您。
|
|
向版主報告此篇 |  |
|
2012-10-03 16:03 |
|
|
|  |
 |
co2
中級會員
註冊日期: Feb 2004
來 自: 南台灣
文章數量: 65 |
不好意思,再記一次缺點!是我沒講清楚。
關於:
----------------------------------------------------------------------------------------------------------------
4.若盈利 61點以上:
如果:回檔 25% 或 連續五根黑K 出清所有多單,空手等待反轉訊號。
----------------------------------------------------------------------------------------------------------------
所謂連續五根黑K指的是 在作多情況下逆轉向下時出現連續五根黑K之意。
若是作空,則應該改為連續五根紅K才對,我在條件描述中沒說清楚甚感抱歉。
這一部份我想再做一個小修正:
若是黑K:除了全部是黑K之外還要 5<3<1 (越走越低)
若是紅K:除了全部是紅K之外還要 5>3>1 (越走越高)
以上就麻煩 總版主幫忙修正,多謝!
|
|
向版主報告此篇 |  |
|
2012-10-03 21:18 |
|
|
|  |
 |
co2
中級會員
註冊日期: Feb 2004
來 自: 南台灣
文章數量: 65 |
回覆: 回覆: 回覆: 回覆: 求助 二口單交易
引用: 最初由 cgjj 發表
1.進場後盈利未達20點時:
(a)若回檔,設定賠 18 點(觸價)出場後空手,等待反轉訊號。
(b)若回檔即觸及反轉訊,平倉並反手二口。
2.盈利 21~40:
(a)設定進場後的高點回檔 16 點(觸價),先平一口單。
(b)若再回檔 16 點(觸價),則全部清倉空手,等待反轉訊號。
(c)若回檔即觸反轉訊,全部平倉並反手二口。
總版主,下午安!
觀察數日後,總覺得好像有點問題,不知我有沒有看錯?
當 條件1. 尚未滿足即回檔【 "(a)若回檔,設定賠 18 點(觸價)出場後空手"………】
這個 賠18 點的計算基礎,是以進場價為之,
舉例:若如 7000 作多,那麼 7020 即為 1. 的滿足點,若未達此價而回檔,即以7000-18=6982 為停損價位。
|
|
向版主報告此篇 |  |
|
2012-10-11 16:24 |
|
|
|  |
本站所有內容未經作者授權禁止轉貼節錄, 發表言論僅供參考勿作為投資決策依據。瀏覽本站請使用 IE 5.5 以上版本, 最佳瀏覽解析度 1024 x 768 全彩。
|
Powered by: vBulletin Version 2.3.0 - Copyright©2000-, Jelsoft Enterprises Limited.
簡愛洋行 製作 Copyright 2003-. All Rights Reserved. 聯絡我們
|