2012-05-08
加入路徑
~/.profile
加入路徑
~/.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
沒有留言:
張貼留言