源起:
朋友請我回測5MA 當沖交易 站上做多跌破做空, 順勢策略在台指期當沖是否能賺錢?
交易商品台指期,時間週期使用5分K
交易商品台指期,時間週期使用5分K
手續費設定:
初步程式碼:
Inputs: length(5); value1 = Average(C,length); if marketposition <= 0 and close cross over value1 then buy next bar market; if marketposition >=0 and close cross below value1 then sell next bar market;
權益圖
改良
1) 降低交易次數2) 在波段大時進場

加入時間參數, 只做波段大的時段
Inputs: length(5),tradetimeStart (0850), tradepireod(100); value1 = Average(C,length); if marketposition <= 0 and time >= tradetimeStart and time <= (tradetimeStart + tradepireod) and close cross over value1 then buy next bar market; if marketposition >=0 and time >= tradetimeStart and time <= (tradetimeStart + tradepireod) and close cross below value1 then sell next bar market; if(marketposition>0) and close cross below value1 then sell next bar market; if(marketposition<0) and close cross over value1 then buytocover next bar market; setexitonclose;
結論
5MA 均線順勢,在台指期當沖,要賺到錢比登天還要難。
沒有留言:
張貼留言