![]() |
總頁數 (4): « 1 [2] 3 4 » 在這個頁面顯示本主題全部的 57 個文章 |
奇狐社區論壇 (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=17082)
原碼:
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;
引用:
最初由 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;
引用:
最初由 co2 發表
感謝 總版主,辛苦了!
經套用約略檢查一下,初步發現:以作多為例,如果作多,第二次停利之後的下一根K還會再進場作一次多單(DOBS=2),不知我有沒有看錯?請 總版主指教。謝謝!
引用:
最初由 cgjj 發表
第二次停利的停利當根 DOBS 會等於 0
若第二次停利的下一根, 有 [多進] 訊號成立, DOBS 才會等於2
請檢查第二次停利的下一根K棒, 其 [多進] 訊號是否成立
若為成立, 其會執行 "多進" 的動作
停利不會影響當日進場次數
停損才會讓當日進場次數受限
引用:
最初由 co2 發表
大家晚安!
引用條件2:
2.盈利 21~40:
(a)設定進場後的高點回檔 16 點(觸價),先平一口單。
(b)若再回檔 16 點(觸價),則全部清倉空手,等待反轉訊號。
(c)若回檔即觸反轉訊,全部平倉並反手二口。
當停利二次後我希望以 (b) 的條件等待反轉訊號再反空,請見附圖說明:
引用:
最初由 cgjj 發表
圖中的 (5) 是因為該根K棒有 [多進] 訊號成立, 所以又進場做多
您希望的意思是
做多停利兩次後, 等待 [空進] 的訊號, 等待途中若觸及 [多進] 訊號不理它嗎?
其他 "等待反轉訊號" 也都是如此處理嗎?
也就是 多空多空多空.... 反向輪流做
不會有 多多空多空空多 這種狀態囉??
引用:
最初由 co2 發表
是的,當作多時若停利後(不管是一次停或兩次停)又遇上多訊也不再作多,因為目前所使用的買賣訊似乎不太適合這樣做。
原碼:
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 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(多空);
end;
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; WaitBS:=-SGN(多空);
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;
引用:
最初由 co2 發表
另外,能否麻煩將 "DOBS" 執行訊號以 類似 下列方式呈現,方便檢視之用
以 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;
引用:
最初由 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;
不好意思,再記一次缺點!是我沒講清楚。
關於:
----------------------------------------------------------------------------------------------------------------
4.若盈利 61點以上:
如果:回檔 25% 或 連續五根黑K 出清所有多單,空手等待反轉訊號。
----------------------------------------------------------------------------------------------------------------
所謂連續五根黑K指的是 在作多情況下逆轉向下時出現連續五根黑K之意。
若是作空,則應該改為連續五根紅K才對,我在條件描述中沒說清楚甚感抱歉。
這一部份我想再做一個小修正:
若是黑K:除了全部是黑K之外還要 5<3<1 (越走越低)
若是紅K:除了全部是紅K之外還要 5>3>1 (越走越高)
以上就麻煩 總版主幫忙修正,多謝!
引用:
最初由 co2 發表
不好意思,再記一次缺點!是我沒講清楚。
關於:
----------------------------------------------------------------------------------------------------------------
4.若盈利 61點以上:
如果:回檔 25% 或 連續五根黑K 出清所有多單,空手等待反轉訊號。
----------------------------------------------------------------------------------------------------------------
所謂連續五根黑K指的是 在作多情況下逆轉向下時出現連續五根黑K之意。
若是作空,則應該改為連續五根紅K才對,我在條件描述中沒說清楚甚感抱歉。
引用:
最初由 co2 發表
這一部份我想再做一個小修正:
若是黑K:除了全部是黑K之外還要 5<3<1 (越走越低)
若是紅K:除了全部是紅K之外還要 5>3>1 (越走越高)
引用:
最初由 cgjj 發表
這部份讓您自己去改了![]()
只需動到 黑五 和 紅五 的條件定義即可
迴圈內的程式不需動到
回覆: 回覆: 回覆: 回覆: 求助 二口單交易
引用:
最初由 cgjj 發表
1.進場後盈利未達20點時:
(a)若回檔,設定賠 18 點(觸價)出場後空手,等待反轉訊號。
(b)若回檔即觸及反轉訊,平倉並反手二口。
2.盈利 21~40:
(a)設定進場後的高點回檔 16 點(觸價),先平一口單。
(b)若再回檔 16 點(觸價),則全部清倉空手,等待反轉訊號。
(c)若回檔即觸反轉訊,全部平倉並反手二口。
回覆: 回覆: 回覆: 回覆: 回覆: 求助 二口單交易
引用:
最初由 co2 發表
總版主,下午安!
觀察數日後,總覺得好像有點問題,不知我有沒有看錯?
當 條件1. 尚未滿足即回檔【 "(a)若回檔,設定賠 18 點(觸價)出場後空手"………】
這個 賠18 點的計算基礎,是以進場價為之,
舉例:若如 7000 作多,那麼 7020 即為 1. 的滿足點,若未達此價而回檔,即以7000-18=6982 為停損價位。
全部時間均為台灣時間, 現在時間為21:17 | 總頁數 (4): « 1 [2] 3 4 » 在這個頁面顯示本主題全部的 57 個文章 |
Powered by: vBulletin Version 2.3.0 - Copyright©2000-, Jelsoft Enterprises Limited.
簡愛洋行 製作 Copyright 2003-. All Rights Reserved.