2012年8月3日 星期五

安裝 geniustrader

2012-05-08

加入路徑

~/.profile
# set PATH so it includes user's geniustrader if it exists
if [ -d "$HOME/geniustrader/Scripts" ] ; then
PATH="$PATH:$HOME/geniustrader/Scripts"
fi

perl 相關 modules 安裝


  • Date::Manip (debian package: libdate-manip-perl)
  • Date::Calc (debian package: libdate-calc-perl)
  • Getopt::Long (debian package: libgetopt-long-descriptive-perl)
  • XML::LibXML (debian package: libxml-libxml-perl)
  • Compress::Zlib (debian package: wheezy/libcompress-zlib-perl)
  • Storable (standard in Perl 5.14, debian package for wheezy/perl 5.14: libstorable-perl)
  • GD (debian package: wheezy/libgd-gd2-perl)
  • Data::Dumper
  • HTML::Mason
  • Math::Trig
  • POSIX
  • Pod::Simple
  • Pod::Usage
  • Pod::Parser

其他 modules


modules (程式) 備註
File::Find
File::Spec
IO::Handle
Perl core 一部份
GD (backtest.pl) perl 圖形套件隨著 c gd 程式庫 libgd
DBI
DBD::Pg
DBD::mysql
DBD::SQLite
DBD::SQLite2
DBD::File
DBD::ODBC
若有用 SQL 後端儲存價格資料
Finance::BeanCounter 推薦的股票價格數據庫應用程序
Time::Local 使用 CSV (GT/DB/CSV.pm) 基礎價格資料
與 GT/DB/Text.pm text based prices data 不同
List::Util 用在 future max/min 方法
Test::More Test::Differences tool kit modules 執行測試
LWP 若有使用 GT/DB/HTTP.pm
XML::Simple 只在 backtest_multi.pl 用到, 其他 GT 應用程式使用 XML::LibXML
perldoc 不一定需要


測試

  • script 在 <geniustrader>/Scripts
  • RSI txf2012 (txf 201201 - 20120703)
    cd Scripts
    ./display_indicator.pl I:RSI txf2012 | less

結果

Calculating indicator RSI[14, {I:Prices CLOSE}] ...
RSI[14, {I:Prices CLOSE}][2012/01/31] = 79.7701
RSI[14, {I:Prices CLOSE}][2012/02/01] = 78.6667
RSI[14, {I:Prices CLOSE}][2012/02/02] = 80.8903
RSI[14, {I:Prices CLOSE}][2012/02/03] = 79.8857
RSI[14, {I:Prices CLOSE}][2012/02/04] = 84.7966
RSI[14, {I:Prices CLOSE}][2012/02/06] = 83.0189
RSI[14, {I:Prices CLOSE}][2012/02/07] = 81.4645
RSI[14, {I:Prices CLOSE}][2012/02/08] = 84.3478
RSI[14, {I:Prices CLOSE}][2012/02/09] = 84.7458
RSI[14, {I:Prices CLOSE}][2012/02/10] = 81.8926
RSI[14, {I:Prices CLOSE}][2012/02/13] = 88.1086
RSI[14, {I:Prices CLOSE}][2012/02/14] = 83.4540
RSI[14, {I:Prices CLOSE}][2012/02/15] = 87.0250
RSI[14, {I:Prices CLOSE}][2012/02/16] = 75.9036
RSI[14, {I:Prices CLOSE}][2012/02/17] = 74.6032
RSI[14, {I:Prices CLOSE}][2012/02/20] = 73.7418
RSI[14, {I:Prices CLOSE}][2012/02/21] = 68.9913
RSI[14, {I:Prices CLOSE}][2012/02/22] = 71.0465
RSI[14, {I:Prices CLOSE}][2012/02/23] = 64.1089
RSI[14, {I:Prices CLOSE}][2012/02/24] = 66.4103
RSI[14, {I:Prices CLOSE}][2012/02/29] = 71.3974
RSI[14, {I:Prices CLOSE}][2012/03/01] = 66.0622
RSI[14, {I:Prices CLOSE}][2012/03/02] = 65.2058
RSI[14, {I:Prices CLOSE}][2012/03/03] = 67.4451
RSI[14, {I:Prices CLOSE}][2012/03/05] = 58.6701
RSI[14, {I:Prices CLOSE}][2012/03/06] = 54.3478
RSI[14, {I:Prices CLOSE}][2012/03/07] = 42.5703
RSI[14, {I:Prices CLOSE}][2012/03/08] = 54.8077
RSI[14, {I:Prices CLOSE}][2012/03/09] = 54.9932
RSI[14, {I:Prices CLOSE}][2012/03/12] = 47.7876
RSI[14, {I:Prices CLOSE}][2012/03/13] = 54.8098
RSI[14, {I:Prices CLOSE}][2012/03/14] = 57.2939
RSI[14, {I:Prices CLOSE}][2012/03/15] = 59.3647
RSI[14, {I:Prices CLOSE}][2012/03/16] = 56.3996
RSI[14, {I:Prices CLOSE}][2012/03/19] = 46.1827
RSI[14, {I:Prices CLOSE}][2012/03/20] = 40.8768
RSI[14, {I:Prices CLOSE}][2012/03/21] = 39.6882
RSI[14, {I:Prices CLOSE}][2012/03/22] = 48.0132
RSI[14, {I:Prices CLOSE}][2012/03/23] = 52.4096
RSI[14, {I:Prices CLOSE}][2012/03/26] = 50.6993
RSI[14, {I:Prices CLOSE}][2012/03/27] = 56.6938
RSI[14, {I:Prices CLOSE}][2012/03/28] = 53.3835
RSI[14, {I:Prices CLOSE}][2012/03/29] = 41.6143
RSI[14, {I:Prices CLOSE}][2012/03/30] = 47.9075
RSI[14, {I:Prices CLOSE}][2012/04/02] = 39.7294
RSI[14, {I:Prices CLOSE}][2012/04/03] = 27.0886
RSI[14, {I:Prices CLOSE}][2012/04/05] = 22.6695
RSI[14, {I:Prices CLOSE}][2012/04/06] = 28.9559
RSI[14, {I:Prices CLOSE}][2012/04/09] = 26.5286
RSI[14, {I:Prices CLOSE}][2012/04/10] = 30.8086
RSI[14, {I:Prices CLOSE}][2012/04/11] = 33.1343
RSI[14, {I:Prices CLOSE}][2012/04/12] = 25.2759
RSI[14, {I:Prices CLOSE}][2012/04/13] = 34.1487
RSI[14, {I:Prices CLOSE}][2012/04/16] = 36.9703
RSI[14, {I:Prices CLOSE}][2012/04/17] = 29.3478
RSI[14, {I:Prices CLOSE}][2012/04/18] = 29.9020
RSI[14, {I:Prices CLOSE}][2012/04/19] = 36.2663
RSI[14, {I:Prices CLOSE}][2012/04/20] = 29.6009
RSI[14, {I:Prices CLOSE}][2012/04/23] = 28.9902
RSI[14, {I:Prices CLOSE}][2012/04/24] = 32.7014
RSI[14, {I:Prices CLOSE}][2012/04/25] = 44.6112
RSI[14, {I:Prices CLOSE}][2012/04/26] = 37.5691
RSI[14, {I:Prices CLOSE}][2012/04/27] = 40.2963
RSI[14, {I:Prices CLOSE}][2012/04/30] = 39.0318
RSI[14, {I:Prices CLOSE}][2012/05/02] = 52.1945
RSI[14, {I:Prices CLOSE}][2012/05/03] = 51.2224
RSI[14, {I:Prices CLOSE}][2012/05/04] = 43.6828
RSI[14, {I:Prices CLOSE}][2012/05/07] = 37.7030
RSI[14, {I:Prices CLOSE}][2012/05/08] = 45.4902
RSI[14, {I:Prices CLOSE}][2012/05/09] = 40.0000
RSI[14, {I:Prices CLOSE}][2012/05/10] = 41.9118
RSI[14, {I:Prices CLOSE}][2012/05/11] = 41.1058
RSI[14, {I:Prices CLOSE}][2012/05/14] = 43.1078
RSI[14, {I:Prices CLOSE}][2012/05/15] = 43.6025
RSI[14, {I:Prices CLOSE}][2012/05/16] = 33.9367
RSI[14, {I:Prices CLOSE}][2012/05/17] = 40.1557
RSI[14, {I:Prices CLOSE}][2012/05/18] = 34.8120
RSI[14, {I:Prices CLOSE}][2012/05/21] = 37.1747
RSI[14, {I:Prices CLOSE}][2012/05/22] = 25.7958
RSI[14, {I:Prices CLOSE}][2012/05/23] = 23.7374
RSI[14, {I:Prices CLOSE}][2012/05/24] = 23.2089
RSI[14, {I:Prices CLOSE}][2012/05/25] = 25.4425
RSI[14, {I:Prices CLOSE}][2012/05/28] = 28.3741
RSI[14, {I:Prices CLOSE}][2012/05/29] = 42.0304
RSI[14, {I:Prices CLOSE}][2012/05/30] = 38.6239
RSI[14, {I:Prices CLOSE}][2012/05/31] = 42.3968
RSI[14, {I:Prices CLOSE}][2012/06/01] = 37.8500
RSI[14, {I:Prices CLOSE}][2012/06/04] = 30.4151
RSI[14, {I:Prices CLOSE}][2012/06/05] = 39.1705
RSI[14, {I:Prices CLOSE}][2012/06/06] = 38.1733
RSI[14, {I:Prices CLOSE}][2012/06/07] = 46.1879
RSI[14, {I:Prices CLOSE}][2012/06/08] = 39.8968
RSI[14, {I:Prices CLOSE}][2012/06/11] = 44.2584
RSI[14, {I:Prices CLOSE}][2012/06/12] = 45.1954
RSI[14, {I:Prices CLOSE}][2012/06/13] = 46.7678
RSI[14, {I:Prices CLOSE}][2012/06/14] = 50.4603
RSI[14, {I:Prices CLOSE}][2012/06/15] = 51.7129
RSI[14, {I:Prices CLOSE}][2012/06/18] = 48.7889
RSI[14, {I:Prices CLOSE}][2012/06/19] = 51.4986
RSI[14, {I:Prices CLOSE}][2012/06/20] = 54.2147
RSI[14, {I:Prices CLOSE}][2012/06/21] = 50.6633
RSI[14, {I:Prices CLOSE}][2012/06/22] = 58.1905
RSI[14, {I:Prices CLOSE}][2012/06/25] = 48.7899
RSI[14, {I:Prices CLOSE}][2012/06/26] = 46.3074
RSI[14, {I:Prices CLOSE}][2012/06/27] = 47.0993
RSI[14, {I:Prices CLOSE}][2012/06/28] = 52.4520
RSI[14, {I:Prices CLOSE}][2012/06/29] = 51.1501
RSI[14, {I:Prices CLOSE}][2012/07/02] = 56.7442
RSI[14, {I:Prices CLOSE}][2012/07/03] = 59.6529
:
  • ./backtest.pl TFS 13000 | less
  • ./backtest.pl 'TFS[30,7,7]' 13000 | less

geniustrader 交易系統

geniustrader - perl 語言寫的 open source 的交易系統(可回測)

主頁 - http://geniustrader.org/

最近在寫新策略以及回測, 使用 perl 來找最佳化及整理資料, 真是方便太多了

----

2012年2月13日 星期一

台灣期貨交易所最近30天交易檔

記一下, 有時要查, 會忘了。

台灣期貨交易所最近30天交易檔位置 :
台灣期貨交易所 -> 交易資訊 -> 盤後資料 -> 期貨 -> 前30個交易日期貨每筆成交資料

下載
  1. 使用 wget 抓取 - wget http://www.taifex.com.tw/DailyDownload/Daily_yyyy_mm_dd.zip
  2. 用瀏覽器打開 - http://www.taifex.com.tw/DailyDownload/Daily_yyyy_mm_dd.zip

最後 Daily_yyyy_mm_dd.zip 中, yyyy是四位數西元年, mm為兩位數月份, dd為
位數日期
, 例西元2012年01月15日, 即為 Daily_2012_01_15.zip


-

2012年1月12日 星期四

2012年台期所期貨最後交易日檔

有用的人補一下吧, 2012(中華民國101年)台期所期貨最後交易日檔

2012-01-13

2012台期所期貨最後交易日檔(結算日)

資訊來源 - 期貨交易所 - 交易制度 - 台灣行事曆


20120118
20120215
20120321


20120418
20120516
20120620
20120718
20120815
20120919
20121017
20121121
20121219
20130119



--

AutoHotkey_L 已知的問題

版本 AutoHotkey_L 1.1.05.05 及 1.1.05.06, 檔案要存成UTF-8格式 。

問題:在INI檔中, 用中文Section及Key會抓不到資料, 現ERROR。

用舊版及AutoHotkey 1.0.48.05是正常的, 檔案要存成ANSI格式。

  • ini檔內容
    [期貨商品]
    交易所 = TW
    商品數 = 3

    商品1 = txf




  • 程式碼
    iniFile = ./jcmp.ini
    IfNotExist, %iniFile%
    {
    MsgBox, IniFile %iniFile% not Exist.
    ExitApp
    }

    IniRead, exchange, %iniFile%, 期貨商品, 交易所
    IniRead, pNumber, %iniFile%, 期貨商品, 商品數
    IniRead, fExt, %iniFile%, 期貨商品, 副檔名


    msgbox ahk version:%A_AhkVersion%`n`n商品數=%pNumber% \
    `n副檔名=%fExt%`n交易所=%exchange%

  • 結果出現ERROR
註:這是舊程式, 以前跑起來是正常的。

聯絡表單

名稱

以電子郵件傳送 *

訊息 *