使用multicharts測試指定日期的績效 - 財經
By Lucy
at 2015-05-24T22:53
at 2015-05-24T22:53
Table of Contents
我想要用multicharts來回測指定某個星期幾的績效
譬如常常有人說周五是台股空軍日
所以我想要回測週一到週五只挑一天
在開盤買進收盤賣出的績效
(ex: 每個禮拜一的時候開盤就買進,收盤就賣出)
我試寫的程式是長這個樣子
Inputs: check_day(1);
var: string1(""),string2(""), day_of_week(0);
day_of_week = DayOfWeek(Date);
if day_of_week = check_day then begin
string1 = "dayBuy => " + NumToStr(day_of_week,0);
string2 = "daySell => " + NumToStr(day_of_week,0);
buy (string1) 1 Contract next bar at market;
sell (string2) 1 Contract next bar at market;
end
但是因為都是在next bar同時做買進賣出的動作
所以根本看不出績效是如何
於是賣出的部分我試著用
sell this bar at close
結果賣出的點位就飛到了四天後
我還試了很多其他的寫法,但是compiler都不給過0rz
想請問版上有沒有人碰過類似的情況
方便指點一下該怎麼處理這個問題比較好?
(或是說MC無法解決這個需求?)
感謝~
--
譬如常常有人說周五是台股空軍日
所以我想要回測週一到週五只挑一天
在開盤買進收盤賣出的績效
(ex: 每個禮拜一的時候開盤就買進,收盤就賣出)
我試寫的程式是長這個樣子
Inputs: check_day(1);
var: string1(""),string2(""), day_of_week(0);
day_of_week = DayOfWeek(Date);
if day_of_week = check_day then begin
string1 = "dayBuy => " + NumToStr(day_of_week,0);
string2 = "daySell => " + NumToStr(day_of_week,0);
buy (string1) 1 Contract next bar at market;
sell (string2) 1 Contract next bar at market;
end
但是因為都是在next bar同時做買進賣出的動作
所以根本看不出績效是如何
於是賣出的部分我試著用
sell this bar at close
結果賣出的點位就飛到了四天後
我還試了很多其他的寫法,但是compiler都不給過0rz
想請問版上有沒有人碰過類似的情況
方便指點一下該怎麼處理這個問題比較好?
(或是說MC無法解決這個需求?)
感謝~
--
Tags:
財經
All Comments
By Caitlin
at 2015-05-25T04:43
at 2015-05-25T04:43
By Frederica
at 2015-05-30T02:27
at 2015-05-30T02:27
By Jacky
at 2015-06-01T21:04
at 2015-06-01T21:04
By Caitlin
at 2015-06-02T10:19
at 2015-06-02T10:19
By Kumar
at 2015-06-03T07:02
at 2015-06-03T07:02
By Iris
at 2015-06-04T03:05
at 2015-06-04T03:05
By Elma
at 2015-06-05T03:31
at 2015-06-05T03:31
By Brianna
at 2015-06-10T01:32
at 2015-06-10T01:32
By Brianna
at 2015-06-14T21:51
at 2015-06-14T21:51
By Ursula
at 2015-06-15T10:00
at 2015-06-15T10:00
By Eartha
at 2015-06-15T20:56
at 2015-06-15T20:56
By Ursula
at 2015-06-18T03:56
at 2015-06-18T03:56
Related Posts
藍玉判決書
By Thomas
at 2015-05-24T20:14
at 2015-05-24T20:14
關於策略轉換
By Zora
at 2015-05-24T14:54
at 2015-05-24T14:54
藍玉判決書
By Kyle
at 2015-05-24T06:04
at 2015-05-24T06:04
群益API抓取大盤參數問題
By Caitlin
at 2015-05-21T15:54
at 2015-05-21T15:54
Quantitative Dev/Researcher/Trader
By Agnes
at 2015-05-19T23:14
at 2015-05-19T23:14