請選擇 進入手機版 | 繼續訪問電腦版

COCO研究院

 找回密碼
 註冊
搜索
查看: 3389|回復: 9

請問如何當天出場後要再突破當天高低點再進場呢

[複製鏈接]
發表於 16-12-13 09:40 | 顯示全部樓層 |閱讀模式
50金錢
請問如何當天出場後要再突破當天高低點再進場呢?
以下引用阿政大大寫的
{Action switch...start}
var:BB(99999),SS(0);
var:MP(0),lastWay(0);
var:toDO(true);
MP= marketposition;
if time_s>=091000 and time_s<=125000 and condition6 and EntriesToday(D)<1 and c>TR1[0]+10 then begin
       BB = highD(0);
       SS = lowD(0);
end;
if time_s>=091000 and time_s<=125000 and condition7 and EntriesToday(D)<1 and c<TR2[0]-10 then begin
       BB = highD(0);
       SS = lowD(0);
end;
if MP[1]<>0 and MP=0 then begin
       toDo = false;
       if MP[1]>0 then lastWay=1;
       if MP[1]<0 then lastWay=-1;
end;
if C<BB and lastWay>0 then
       toDO= true;
if C>SS and lastWay<0 then
       toDO= true;
{Action switch...end}
請問以下的程式如何修改才能達到當天出場後要再突破當天高低點再進場呢?
if (minlist(TR2[0],varL)-TR2[lowerP[1]])>(opend(0)*0.009) and (c<varL) then begin
              sellshort("S") next bar  at LL-1 stop;
       end else
if (minlist(TR2[0],varL)-TR2[lowerP[1]])<(opend(0)*0.009) and (c<varL) and (c<TR2[j]-15) then begin
              sellshort("S1") next bar  at (TR2[j]-15)[1]-1 stop;
end;

最佳答案

查看完整內容

最好多看前後幾根K棒 if date >= 1040429 and date
發表於 16-12-13 09:40 | 顯示全部樓層
最好多看前後幾根K棒

if date >= 1040429 and date <= 1040502 then
  messagelog(date,time,marketposition,exitstoday(date)) ;

回復

使用道具 舉報

發表於 16-12-13 10:13 | 顯示全部樓層
EntriesToday(D)<1 拿掉,試試看.

回復

使用道具 舉報

 樓主| 發表於 16-12-13 10:25 | 顯示全部樓層

大大你好~~主要是以下這段
if (minlist(TR2[0],varL)-TR2[lowerP[1]])>(opend(0)*0.009) and (c<varL) then begin
              sellshort("S") next bar  at LL-1 stop;
       end else
if (minlist(TR2[0],varL)-TR2[lowerP[1]])<(opend(0)*0.009) and (c<varL) and (c<TR2[j]-15) then begin
              sellshort("S1") next bar  at (TR2[j]-15)[1]-1 stop;
end;


我想要的是如果當天沒有出場的情況下,他會按照上面的方式進場
但如果當天有出場的情況下,若要買進就要突破當天的高點才會買進,如果要放空就要跌破當天的低點才會進場
回復

使用道具 舉報

 樓主| 發表於 16-12-13 11:58 | 顯示全部樓層
不知道為何改成ExitsToday(D)=0 這樣後,當天明明有buytocover出場過1次,S1這個訊號還是會觸發....請問有人知道哪裡有問題嗎?
       
if ExitsToday(D)=0 and (minlist(TR2[0],varL)-TR2[lowerP[1]])>(opend(0)*0.009) and (c<varL) then begin
                sellshort("S") next bar at LL-1 stop;
end else
if ExitsToday(D)>0 and toDo=true and (minlist(TR2[0],varL)-TR2[lowerP[1]])>(opend(0)*0.009) and (c<varL) then begin
                sellshort("SS") next bar at SS-1 stop;
end;
if ExitsToday(D)=0 and (minlist(TR2[0],varL)-TR2[lowerP[1]])<(opend(0)*0.009) and (c<varL) and (c<TR2[j]-15) then begin
                sellshort("S1") next bar at (TR2[j]-15)[1]-1 stop;
end else
if ExitsToday(D)>0 and toDo=true and (minlist(TR2[0],varL)-TR2[lowerP[1]])<(opend(0)*0.009) and (c<varL) and (c<TR2[j]-15) then begin
                sellshort("SS1") next bar at SS-1 stop;
end;

回復

使用道具 舉報

發表於 16-12-13 14:34 來自手機 | 顯示全部樓層
用print(date,time,market position,exitstoday(date));檢查S1會進場當根是否符合條件限制
回復

使用道具 舉報

 樓主| 發表於 16-12-13 15:38 | 顯示全部樓層
easytrader788 發表於 16-12-13 14:34
用print(date,time,market position,exitstoday(date));檢查S1會進場當根是否符合條件限制

用print(date,time,market,position,exitstoday(date));檢查S1會進場當根是否符合條件限制
大大請問一下,我是要檢查2004/04/30這天的11:25分這根S1怎麼會進場
是否是用以下這樣呢? 這樣會跑出錯誤
Messagelog(1040430,1125,market,position,exitstoday(date));
回復

使用道具 舉報

發表於 16-12-14 19:32 來自手機 | 顯示全部樓層
Marketposition中間不需逗點
回復

使用道具 舉報

發表於 16-12-14 19:34 來自手機 | 顯示全部樓層
我用手機打字,沒注意
回復

使用道具 舉報

 樓主| 發表於 16-12-15 09:15 | 顯示全部樓層
easytrader788 發表於 16-12-14 19:44
最好多看前後幾根K棒

if date >= 1040429 and date

感謝大大的幫助~~問題已經解決了
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

手機版|Archiver|站長信箱|廣告洽詢|COCO研究院

GMT+8, 24-3-28 18:55

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 | AI繪圖AI超擬真美女AI beauty AI Stable DiffusionAI正妹AI Lookbook