| 
 | 
 
 本帖最後由 swwang1999 於 14-2-14 08:53 編輯  
 
之前 post 了一個 CoCo 前輩的 RSI 策略, 突然想到曾經研究過另一個別人的 
 RSI 策略 , 程式碼如下  , 個人想有在玩策略經理人的人 , 這也許有用處 
 (負面範本) , 前 10 年賺蠻多的策略  , 後來就 不大賺也不大賠 , 一直到現在 ,  
不知 2010 年之後發生了甚麼事情, 這個策略整個失效 , 但是在 2010 年以前 , 
 不得不承認它是一個還算不錯的策略 , 這讓個人對所有的策略都心存謹慎的心 
情 , 即使回測結果都是還可以的 , 目前模擬還沒加入手續費跟滑價: 
 
目前稱這個策略叫賴活 RSI 策略 , 程式碼如下 : 
 
// 5Min-K , 賴活 RSI 策略  
 
inputs:  Len1(9) , Len2(2.4) ,  val_buy(73.3) , val_short(26.6) , STOPLOSS( 40 );   
vars: RSI_sum(50); 
 
RSI_sum =( rsi(close, Len1   )     + 
                  rsi(close, Len1   )[1] + 
                  rsi(close, Len1   )[2]     )/3; 
                    
if RSI_sum> val_buy   and high<high[1] and time>0930 and time<1300  then Buy       next bar at market; 
if RSI_sum< val_short and low >low [1] and time>0930 and time<1300  then SellShort next bar at market; 
 
if  time=1325  then  BuyToCover next bar at market; 
if  time=1340  then  Sell             next bar at market; 
 
if marketposition <> 0 and (close < closed(1)*0.934 or close > closed(1)*1.066)  then  
  begin  
     Sell             ("SellALL")   next bar at market;  
     BuyToCover ("Buy ALL")  next bar at market;     
  end; 
//setprofittarget(600*BigPointValue); 
setstoploss    (  STOPLOSS*BigPointValue ); 
 
權益曲線 
 
 
 
 
 
策略績效 
 
 
總交易 
 
 
月周期 
 
 
 
年周期 
 
 
 
 
 |   
 
評分
- 
查看全部評分
 
 
 
 
 
 |