You are on page 1of 16

策略架構

For TMBA 20#$


第二組
環境設置
使用標的:台指期30分鐘K

樣本:2012~2019

手續費及滑價 : 600
指標解釋
• 均線:過去一段時間市場的「平均成交價格」
為何使用此指標
因符合限定範圍

指標概念:
反應最近股價波動趨勢
策略發想
策略主軸:
KD在低於20時黃金交叉做空,在高於80時死亡交叉做多
在K值介於20~80間時,以布林通道作為主要買賣依據
• 濾網:
9:00am之後才開始進場,最晚13:00pm進場
視窗範例
程式碼
• Inputs:len1(2.6),len2(1.5),len3(9);
• Vars:Kvalue(0),Dvalue(0);
• Kvalue=slowK(len3);
• Dvalue=slowD(len3);
• If Time >=915 and Time <=1300 then begin
• If Kvalue cross over Dvalue And Kvalue<=20 then sellshort next bar market;
• If Kvalue cross under Dvalue And Kvalue>=80 then buy next bar market;
• If c>BollingerBand(c,20,len1) And Kvalue>20 And Kvalue<80 Then buy next bar market;
• If c <BollingerBand(c,20,-len2) And Kvalue>20 And Kvalue<80 Then sellshort next bar market;
• If c> BollingerBand(c,20,len1) And Kvalue >80 then buy next bar market;
• If c> BollingerBand(c,20,len1) And Kvalue <20 then sellshort next bar market;
• If c<BollingerBand(c,20,-len2) And Kvalue >80 then sellshort next bar market;
• If marketposition>0 and entryprice-close>(entryprice*0.03) then sell next bar market;
• If marketposition<0 and close-entryprice>(entryprice*0.03)then buytocover next bar market;
• End;
最佳化3D圖

You might also like