2010年1月18日 星期一

當沖留意

轉貼:

寫當沖程式要處理的事情比留倉程式要多很很多,這裡提出一些我的心得,有疏漏之處還請高人補足

1.平常的日子何時出場,何時開始進場
2.每日收盤前多久宜出不宜進
3.結算日何時出場(不處理的話,期商也會在結算前自動結算掉,但你的回測紀錄會失真)
4.漲跌停何時出場
5.靠近漲跌停何處宜出不宜進

//---------------------------------------------------------每日出場

Condition0=dayofweek(date)=3 and dayofmonth(date)>14 and 22>dayofmonth(date) and Time=133000-Barinterval*100

if time< time[1] then
 Close_1=C[1]
end if

ExitLong ("出漲停") this bar Close_1*1.07-10 limit //沖漲停
ExitShort("出跌停") this bar Close_1*0.93+10 limit //沖跌停

if time=(134500-barinterval*100) then //當沖不留倉
 exitlong ("多收") next bar market
 exitshort("空收") next bar market
end if

if time>=133000-barinterval*100 and Condition0 then //結算不轉倉
 exitlong ("多結") next bar market
 exitshort("空結") next bar market
end if
請尊重版權,轉載請註明出處
http://dkbb.freeforum.tw/read.php?tid=4642&page=1&toread=1

只要使用THIS BAR在條件的判斷上絕對不要使用正在發生的K線的資料去作為判斷的依據 --- 阿政



Close of 1 Bar Ago  表示前一天的收盤價。
ExitShort this bar on close   現在bar當中,在收盤價清算賣出部位的意思

沒有留言: