2017年9月30日 星期六

光一條線、真的可以賺到錢嗎?當沖篇

源起:

朋友請我回測5MA 當沖交易 站上做多跌破做空, 順勢策略在台指期當沖是否能賺錢?
交易商品台指期,時間週期使用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 均線順勢,在台指期當沖,要賺到錢比登天還要難。





沒有留言:

張貼留言

前進小日經 打造攻城掠地兵器

小日經的特色 1. 所需資金小,適合入門 2.交易時間長,東京時間 8:45 - 15:15   16:30 - 05:30 3.成交量大,適合程式交易。 準備工具: 1) Interactive Brokers 交易戶頭 (手續費低 每口合約 40日幣) 2)...