顯示具有 期貨 標籤的文章。 顯示所有文章
顯示具有 期貨 標籤的文章。 顯示所有文章

2018年1月5日 星期五

使用 bash tick

程式碼 ( Bash Code )

#!/bin/sh

# V 1.2.0 2016-02-27 change url
# V 1.1.1 2015-04-24 change prg dir ( tick -> trade )
# V 1.1   2009-10-10 change Last-Trading-Days

# tick K 

# Get Tick
# Use Argv

# if [ $1 = ]; then
if [ $# -lt 1 ]; then
  echo "Argv number is less  than 1."
  echo "EX:  $0  20090610"
  exit 1
fi

year=`echo $1 | cut -c 1-4`
month=`echo $1 | cut -c 5-6`
day=`echo $1 | cut -c 7-8`

workFile=`printf "%s_%s_%s" $year $month $day`
workday=`printf "%s%s%s" $year $month $day`
workMonth=`printf "%s%s" $year $month`

url_zipDailyFile=http://www.taifex.com.tw/DailyDownload/DailyDownload/Daily_$workFile.zip
dailyStoreDir=/home/redjoe/trade/prg_bash/daily/
tickStoreDir=/home/redjoe/trade/prg_bash/tick/
log_File=/home/redjoe/trade/prg_bash/rj_crontab.log
ltd=`tac /home/redjoe/trade/last-trading-days/last-trading-days`

wget -c -a $log_File -P $dailyStoreDir $url_zipDailyFile


# Process Tick

cd $dailyStoreDir

zip_DailyFile=Daily_$workFile.zip
rpt_DailyFile=Daily_$workFile.rpt

workmonth=./tmp1

wkproduct=`ls -l $zip_DailyFile | cut -d ' ' -f 5 `

# echo $wkproduct

if [ "$wkproduct" -ne '93' ]; then

  unzip $zip_DailyFile

  # echo $rpt_DailyFile
  # echo $workFile.TX

  for td in $ltd
  do
    #echo "$td="$td , "$workday="$workday
    if [ "$td" -ge "$workday" ]; then
      #echo " $td > $workday "
      wkmonth=`echo $td`
    fi
  done

  echo $wkmonth > $workmonth

  wkproduct=`cut -c 1-6 $workmonth`
  # echo $wkproduct


  # TX 台指
  head -n 1 $rpt_DailyFile > $workFile.TX
  sed '/MTX/d' $rpt_DailyFile | sed -n '/TX/p' | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $1,$2,$3,$4,$5,$6/2 }' >> $workFile.TX
  echo "TickTime,Price,Vol" > txf$workday.csv
  sed '/MTX/d' $rpt_DailyFile | sed -n '/TX/p' | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $4,$5,$6/2 }' >> txf$workday.csv

  # MTX 小台
  head -n 1 $rpt_DailyFile > $workFile.MTX
  sed -n '/MTX/p' $rpt_DailyFile | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $1,$2,$3,$4,$5,$6/2 }' >> $workFile.MTX
  echo "TickTime,Price,Vol" > mxf$workday.csv
  sed -n '/MTX/p' $rpt_DailyFile | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $4,$5,$6/2 }' >> mxf$workday.csv

  # TE 電指期
  head -n 1 $rpt_DailyFile > $workFile.TE
  sed -n '/TE/p' $rpt_DailyFile | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $1,$2,$3,$4,$5,$6/2 }' >> $workFile.TE
  echo "TickTime,Price,Vol" > exf$workday.csv
  sed -n '/TE/p' $rpt_DailyFile | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $4,$5,$6/2 }' >> exf$workday.csv

  ## TF 金指期
  head -n 1 $rpt_DailyFile > $workFile.TF
  sed '/GTF/d' $rpt_DailyFile | sed -n '/TF/p' | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $1,$2,$3,$4,$5,$6/2 }' >> $workFile.TF
  echo "TickTime,Price,Vol" > fxf$workday.csv
  sed '/GTF/d' $rpt_DailyFile | sed -n '/TF/p' | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $4,$5,$6/2 }' >> fxf$workday.csv

  rm $workmonth


  if [ ! -d $workMonth ]; then
    mkdir $workMonth
  fi
  mv $rpt_DailyFile $zip_DailyFile  $workMonth/

  if [ ! -d "/home/redjoe/trade/prg_bash/tick/$workMonth" ]; then
    mkdir /home/redjoe/trade/prg_bash/tick/$workMonth
  fi
  mv $workFile.TX txf$workday.csv $workFile.MTX mxf$workday.csv $workFile.TE exf$workday.csv $workFile.TF fxf$workday.csv $tickStoreDir$workMonth/


fi

2017年4月1日 星期六

使用BASH下載期貨交易記錄,並轉成tick檔

環境 : Linux Bash 

說明 : 到期交所下載期貨交易記錄轉成 tick


程式碼 ( Bash Code )

#!/bin/sh

# Get Tick

# V 1.2.0 2016-02-27 change url
# V 1.1.1 2015-04-24 change prg dir ( tick -> trade )
# V 1.1   2009-10-10

# 2016-02-26 change url
# url_zipDailyFile=http://www.taifex.com.tw/DailyDownload/Daily_`date +%Y_%m_%d`.zip
url_zipDailyFile=http://www.taifex.com.tw/DailyDownload/DailyDownload/Daily_`date +%Y_%m_%d`.zip
dailyStoreDir=/home/redjoe/trade/prg_bash/daily/
tickStoreDir=/home/redjoe/trade/prg_bash/tick/
log_File=/home/redjoe/trade/prg_bash/rj_crontab.log
ltd=`tac /home/redjoe/trade/last-trading-days/last-trading-days`

wget -c -a $log_File -P $dailyStoreDir $url_zipDailyFile


# Process Tick

cd $dailyStoreDir

workFile=`date +%Y_%m_%d`
workday=`date +%Y%m%d`
workMonth=`date +%Y%m`

zip_DailyFile=Daily_$workFile.zip
rpt_DailyFile=Daily_$workFile.rpt

workmonth=./tmp1

wkproduct=`ls -l $zip_DailyFile | cut -d ' ' -f 5 `

# echo $wkproduct

if [ "$wkproduct" -ne '93' ]; then

  unzip $zip_DailyFile

  # echo $rpt_DailyFile
  # echo $workFile.TX

  for td in $ltd
  do
    #echo "$td="$td , "$workday="$workday
    if [ "$td" -ge "$workday" ]; then
      #echo " $td > $workday "
      wkmonth=`echo $td`
    fi
  done

  echo $wkmonth > $workmonth

  wkproduct=`cut -c 1-6 $workmonth`
  # echo $wkproduct


  # TX 台指
  head -n 1 $rpt_DailyFile > $workFile.TX
  sed '/MTX/d' $rpt_DailyFile | sed -n '/TX/p' | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $1,$2,$3,$4,$5,$6/2 }' >> $workFile.TX
  echo "TickTime,Price,Vol" > txf$workday.csv
  sed '/MTX/d' $rpt_DailyFile | sed -n '/TX/p' | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $4,$5,$6/2 }' >> txf$workday.csv

  # MTX 小台
  head -n 1 $rpt_DailyFile > $workFile.MTX
  sed -n '/MTX/p' $rpt_DailyFile | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $1,$2,$3,$4,$5,$6/2 }' >> $workFile.MTX
  echo "TickTime,Price,Vol" > mxf$workday.csv
  sed -n '/MTX/p' $rpt_DailyFile | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $4,$5,$6/2 }' >> mxf$workday.csv

  # TE 電指期
  head -n 1 $rpt_DailyFile > $workFile.TE
  sed -n '/TE/p' $rpt_DailyFile | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $1,$2,$3,$4,$5,$6/2 }' >> $workFile.TE
  echo "TickTime,Price,Vol" > exf$workday.csv
  sed -n '/TE/p' $rpt_DailyFile | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $4,$5,$6/2 }' >> exf$workday.csv

  ## TF 金指期
  head -n 1 $rpt_DailyFile > $workFile.TF
  sed '/GTF/d' $rpt_DailyFile | sed -n '/TF/p' | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $1,$2,$3,$4,$5,$6/2 }' >> $workFile.TF
  echo "TickTime,Price,Vol" > fxf$workday.csv
  sed '/GTF/d' $rpt_DailyFile | sed -n '/TF/p' | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $4,$5,$6/2 }' >> fxf$workday.csv

  rm $workmonth


  if [ ! -d $workMonth ]; then
    mkdir $workMonth
  fi
  mv $rpt_DailyFile $zip_DailyFile  $workMonth/

  if [ ! -d "/home/redjoe/trade/prg_bash/tick/$workMonth" ]; then
    mkdir /home/redjoe/trade/prg_bash/tick/$workMonth
  fi
  mv $workFile.TX txf$workday.csv $workFile.MTX mxf$workday.csv $workFile.TE exf$workday.csv $workFile.TF fxf$workday.csv $tickStoreDir$workMonth/


fi

2016年3月2日 星期三

台灣期交所下載資料位置變更

台灣期交所下載資料位置變更(105-02-26)

2016-03-03

台灣期交所位置: 首頁 > 交易資訊 > 盤後資訊 > 期貨 > 前30個交易日期貨每筆成交資料

前30個交易日期貨每筆成交資料, 增加了 .csv 下載

以前的最近30天成交記錄 rpt 下載 ( daily_yyyy_mm_dd.zip ,  其中 yyyy 為西元年, mm 為月份, dd 為日期)

原位置 : http://www.taifex.com.tw/DailyDownload/
新位置 : http://www.taifex.com.tw/DailyDownload/DailyDownload/

程式中有用到這個位置的要改...

記錄一下..

----

2014年6月3日 星期二

台指期轉檔程式 - part5 (只用AutoHotkey)

AutoHotkey到期交所抓交易檔, 並分拆成Tick及K線 (多天)

寫過幾個 到期交所抓交易檔, 並分拆成Tick及K線 "台指期轉檔程式" - 轉檔程 Linux Bash ~ 轉檔程 part4.

這次是只用 AutoHotkey 及外部程式 unzip.exe 來處理





ahk 程式
  \twfTrade2K.exe  (主程式)
  \Tick2mk.exe
  \Tick2dk.exe
  \chk_Ver.exe   檢查 AutoHotkey 版本

設定檔
  \twfTrade2K.ini (設定檔)

  \last-trading-days (期貨最後交易日檔)

Source code 在 ahk_code 目錄下

程式



相關


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

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


-

2011年7月1日 星期五

順勢,停損/停利

順勢,停損/停利 - 勝率、買賣點很重要嗎?

順勢:口袋不夠深時,(資金不足,會被斷頭), 操作方向。
停損:降低風險, 確保資金。
停利:保證利潤。

順勢是方向, 停損/停利是出場時機, 還有進場時間, 三者為穫利基本關鍵, 策略暨為三者的組合。

-

2010年6月25日 星期五

AutoHotKey補一個月的轉檔主程式

這支程式是用AutoHotKey寫的,用來補前幾天(前30天)沒有做轉檔, 要配合
台指期轉檔程式 - part4(懶人包), 自動取得交易檔, 轉Tick及1分K線。

程式中用到他人的 SimpleArray.ahk 要放在同個資料夾(目錄)下。下載SimpleArray.zip, 下載後要解zip檔。

getTick.ahk程式碼


;
; AutoHotkey Version: 1.0.0
; Platform: Win XP
; Author: R.J
; Date : 2010/6/11
; Script Function:
; Get Tick
;
#Include SimpleArray.ahk

; 1 2 3 4 5 6 7 8 9 10 11 12
Month = 31|28|31|30|31|30|31|31|30|31|30|31

PerlExe = c:\perl\bin\perl.exe
plGetTick = c:\tick\prg_perl3w\gettick3w.pl
plProc3wTick = c:\tick\prg_perl3w\proc3w_tick.pl

ToDay = %A_YYYY%-%A_MM%-%A_DD%

if (%A_MM% == 1 ){
sStartMonth := 12 ; 前月
} else {
sStartMonth := A_MM + 99
sStartMonth := SubStr(sStartMonth, 2, 2) ; 前月
}

sStartDay = %A_YYYY%-%sStartMonth%-%A_DD%
sStopDay = %A_YYYY%-%A_MM%-%A_DD%


Gui, Font, S12,
Gui, Add, Text, x10 y25 w70 h20 , Start Date :
Gui, Add, Text, x10 y85 w70 h20 , Stop Date :
Gui, Add, Edit, x90 y23 w90 h20 r1 vStartEdit, %sStartDay%
Gui, Add, Edit, x90 y83 w90 h20 r1 vStopEdit, %sStopDay%
Gui, Add, Button, x220 y18 w46 h29 , Start
Gui, Show, x300 y150 h250 w320, Get Future Daily-Trade from TAIFEX
Return

GuiClose:
ExitApp


ButtonStart:
Gui, Submit
stopDate := StopEdit

stYYYY := SubStr(StartEdit, 1, 4)
stMM := SubStr(StartEdit, 6, 2)
stDD := SubStr(StartEdit, 9, 2)

WorkDate = %stYYYY%-%stMM%-%stDD%

; While (stopDate >= WorkDate) {
While (WorkDate <= stopDate) {
if (stDD > SA_Get(Month, stMM)) {
; 換月
stDD -= SA_Get(Month, stMM)
if (stDD < 10) {
stDD += 100
stDD := SubStr(stDD, 2, 2)
}
stMM += 1
if (stMM > 12) {
stMM := 01
stYYYY += 1
} else if (stMM < 10) {
stMM += 100
stMM := SubStr(stMM, 2, 2)
}
}
WorkDate = %stYYYY%-%stMM%-%stDD%

RunWait, %comspec% /c date %WorkDate%, , min
sleep, 1000

if (A_WDay >= 2 and A_WDay <= 6) {
RunWait, %PerlExe% %plGetTick%
RunWait, %PerlExe% %plProc3wTick%
}

stDD += 1
if (stDD < 10) {
stDD += 100
stDD := SubStr(stDD, 2, 2)
}
WorkDate = %stYYYY%-%stMM%-%stDD%
}

RunWait, %comspec% /c date %ToDay%, , min ;; Reset Today DateTime
Return


-

2010年4月27日 星期二

台指期轉檔程式 - part4(懶人包)

因應 JameX 網友所提的"懶人包",

1. tick.zip
2. tool.zip
3. CRONw_crontab.zip

為配合TS的匯入, 這次改了一分K線的檔案名稱, 及輸出目錄, 並刪除抬頭

安裝說明, 參照 台指期轉檔程式 - part4

---

2010年4月20日 星期二

台指期轉檔程式 - part4

因為我比較懶, 用K線轉檔機還要按按鈕, 所以用 CRONw 排程, 自行到期交所抓當日的成交檔, 分類 tick, 再轉K線...

最近在 win XP sp3 下安裝
  • perl - ActivePerl-5.8.2.808-MSWin32-x86.msi
  • CRONw - CRONw_2.0.zip
  • tool - wget.exe unzip.exe
  • perl 轉檔程式
之前的操作忘了, 這次記錄一下。



1. perl
ActivePerl-5.8.2.808-MSWin32-x86.msi
2. CRONw
CRONw_2.0.zip
a.unzip CRONw_2.0.zip
b. CRONw -> C:\CRONw
3. tool.zip
a.unzip put at c:\tool\
b.file
1. c:\tool\wget.exe
2. c:\tool\unzip.exe
3. c:\tool\unzip32.dll
4. tick.zip (perl script)
a. unzip put at c:\tick
b.file
1. c:\tick\prg_perl3w\gettick3w.bat
2. c:\tick\prg_perl3w\proc3w_tick.bat
3. c:\tick\prg_perl3w\gettick3w.pl
4. c:\tick\prg_perl3w\proc3w_tick.pl
5. c:\tick\prg_perl3w\last-trading-days
6. c:\tick\prg_perl3w\movefile2dir.pl
(其他-手動補之前的K線)
7. c:\tick\ext\make_kline
8. c:\tick\ext\win_crontab.txt
9. c:\tick\ext\user_proc3w_tick.ba
10. c:\tick\ext\tick2kline.pl
c. 排程時間 copy c:\tick\ext\win_crontab.txt to c:\CRONw\crontab.txt
(add crontab rule)
27 15 * * 1-5 c:\perl\bin\perl.exe C:\tick\prg_perl3w\gettick3w.pl
29 15 * * 1-5 c:\perl\bin\perl.exe C:\tick\prg_perl3w\proc3w_tick.pl

5. install CRONW modules -> read \INSTALL.txt
a.
installer.pl

6. install CRONw to WinXP Service
a. 安裝服務 - perl cronHelper.pl --install

b. 起動服務 - net start CRON
c. 檢查 -> Cron Service (CRONw) -
net start

時間定在 15:27 以後, 是確保當時可以抓得到今日的成交檔


相關 -  台指期轉檔程式 - part4(懶人包)
 

2009年7月30日 星期四

台指期轉檔程式 - perl 程式 2 (配合前支gettick3w.pl-自行下載交易檔)

配合前支程式 : 自期交所自行下載交易檔 perl 程式(win-XP) - gettick3w.pl

  1. 配合環境: windows xp sp2
  2. 程式名稱 : proc3w_tick.pl
  3. 程式目的 : 將當天交易檔分拆成台指期,小台,電指期,金指期當月分tick檔
  4. 程式碼



#!C:\Perl\bin\perl.exe

# 2009-06-25 change output file name
# 2009/6/25 Change directory to C:\\tick\\prg_perl3w\\
# 2009/6/18 For Win32 ActivePerl
# 2009-06-17 for move File to Storage Directory
# 2009-06-06 Process Tick and Make K-Line File

use POSIX qw(strftime);
use integer;

$workDir = 'C:\\tick\\prg_perl3w\\daily\\';
$tickDir = 'C:\\tick\\prg_perl3w\\tick\\';
# 可以改成 5 分K
# my $Minute5K = 5; # 5分K
my $Minute1K = 1; # 1分K

# 讀取最後交易日檔
my $LastTradingDays = "C:\\tick\\prg_perl3w\\last-trading-days";


$today = strftime "%Y%m%d", localtime;

$today_YY = substr $today, 0, 4;
$today_mm = substr $today, 4, 2;
$today_dd = substr $today, 6, 2;

$tick_day = $today_YY . "-" . $today_mm . "-" . $today_dd;

$wkMonth = &get_current_month_product($LastTradingDays);

print "Process $today Tick and Make $Minute1K Minute K-Line File..\n";

chdir $workDir;

&split_Tick ($today_YY, $today_mm, $today_dd, $wkMonth);

$tickdayfile = '???' . $today;

$daily_trade_file = 'Daily_' . $today_YY . '_' . $today_mm . '_' . $today_dd;

$saveDir = substr $today, 0, 6;
$tickStoreDir = $tickDir . $saveDir . '/';
$dailyStoreDir = $workDir . $saveDir . '/';

`C:\\tick\\prg_perl3w\\movefile2dir.pl $workDir $dailyStoreDir $daily_trade_file`;
`C:\\tick\\prg_perl3w\\movefile2dir.pl $workDir $tickStoreDir $tickdayfile`;

exit;

sub process_kline {
# in參數 $tickfile $KMinute

my $startHH = '08'; # 開始時
my $startMM = '45'; # 開始分
my $IdxK = -1; # idx
my $PreIdxK = -1; # idx

my $tickfile = $_[0];
my $KMinute = $_[1];

$workday = substr $tickfile, 3, 8;
my $kline_file = substr($tickfile, 0, 11) . '_' . $KMinute . 'k' . substr($tickfile, 11, 4);

open(infile, $tickfile) || die("Cannot open $tickfile.\n");
open(outfile, ">$kline_file");

print outfile "Date Time,Open,High,Low,Close,Vol\n";

# print "K File Processing...\n";

;

while(my $tk_record = )
{
chomp $tk_record;
$tk_record =~ s/ //g;
($tickTime, $tickPrice, $tickVol)=split(/,/ , $tk_record);

$tkTimeHh = substr $tickTime, 0, 2;
$tkTimeMm = substr $tickTime, 3, 2;
$tkTimeSs = substr $tickTime, 6, 2;

$IdxK = int(((($tkTimeHh - $startHH) * 60) + ($tkTimeMm - $startMM)) / $KMinute);
if ($IdxK == $PreIdxK) { # 同根k
if ($tickPrice > $HPrice) {
$HPrice = $tickPrice;
}
if ($tickPrice < $LPrice) {
$LPrice = $tickPrice;
}
$CPrice = $tickPrice;
$KVol = $KVol + $tickVol;
}
else {
if ($PreIdxK != -1){
print outfile $KTime,$OPrice,$HPrice,$LPrice,$CPrice,$KVol\n";
}
$OPrice = $tickPrice;
$HPrice = $tickPrice;
$LPrice = $tickPrice;
$CPrice = $tickPrice;
$KVol = $tickVol ;

my $KTimeHH = ((($IdxK + 1) * $KMinute) + ($startHH * 60) + $startMM) / 60 + 100;
my $KTimeMM = ((($IdxK + 1) * $KMinute) + ($startHH * 60) + $startMM) % 60 + 100;
$KTimeHH = substr $KTimeHH, 1, 2;
$KTimeMM = substr $KTimeMM, 1, 2;

$KTime = $tick_day . ' ' . $KTimeHH . ':' . $KTimeMM;
$PreIdxK = $IdxK;
}
}
if ($IdxK == $PreIdxK) {
# 同根k
print outfile "$KTime,$OPrice,$HPrice,$LPrice,$CPrice,$KVol\n";
}
close(outfile);
close(infile);
}

# get current month product. ex: 200906 (取得當月月分)
sub get_current_month_product{
my $LastTradingDays_file = $_[0];
open(open_LastTradingDays, $LastTradingDays_file)|| die("Cannot open $LastTradingDays_file.\n");
@recs = ;

for($row=@recs-1; $row >= 0; $row=$row-1)
{
my $LastTradingDays = $recs[$row];
if ($LastTradingDays >= $today ) {
$TradingDays = $LastTradingDays;
}
}
my $wkMonth = substr $TradingDays, 0, 6;

close(open_LastTradingDays);
return $wkMonth;
}

sub split_Tick {
chdir $workDir;
# in參數 $today_YY $today_mm $today_dd $wkMonth

$workday_YY = $_[0];
$workday_mm = $_[1];
$workday_dd = $_[2];
$workMonth = $_[3];

$workdayfile = $workday_YY . $workday_mm . $workday_dd;


$trade_file = 'Daily_' . $workday_YY . '_' . $workday_mm . '_' . $workday_dd . '.rpt';

my $TX_Product = 'TX'; # 台指
my $MTX_Product = 'MTX'; # 小台
my $TE_Product = 'TE'; # 電指期
my $TF_Product = 'TF'; # 金指期

# 2009-06-25 change output file name
$tx_tickfile = 'txf' . $workdayfile . '.csv'; # 台指
$mtx_tickfile = 'mxf' . $workdayfile . '.csv'; # 小台
$te_tickfile = 'exf' . $workdayfile . '.csv'; # 電指期
$tf_tickfile = 'fxf' . $workdayfile . '.csv'; # 金指期

open(read_file, $trade_file) || die("Cannot open $trade_file.\n");


open(out_tx, ">$tx_tickfile");
open(out_mtx,">$mtx_tickfile");
open(out_te, ">$te_tickfile");
open(out_tf, ">$tf_tickfile");

print out_tx "Date Time,Price,Vol\n";
print out_mtx "Date Time,Price,Vol\n";
print out_te "Date Time,Price,Vol\n";
print out_tf "Date Time,Price,Vol\n";

# print "Split Tick File Processing...\n";

while(my $record = )
{
chomp $record;
$record =~ s/ //g;
# 交易日期,商品代號,交割年月,成交時間,成交價格,成交數量(B+S),近月價格,遠月價格
($tDays, $tProduct, $tMonth, $tickTime, $tPrice, $tVol, $nPrice, $fPrice)=split(/,/ , $record);
# print "$tDays, $tProduct, $tMonth, $tickTime, $tPrice, $tVol, $nPrice, $fPrice\n";

$tVol = $tVol / 2;

$tTimeHh = substr $tickTime, 0, 2;
$tTimeMm = substr $tickTime, 2, 2;
$tTimeSs = substr $tickTime, 4, 2;

$tTime = $tTimeHh . ':' . $tTimeMm . ':' . $tTimeSs;

# 當月
if ($tMonth eq $workMonth)
{
if ($tProduct eq $TX_Product) { # 台指
print out_tx "$tTime,$tPrice,$tVol\n";
}
elsif ($tProduct eq $MTX_Product) { # 小台
print out_mtx "$tTime,$tPrice,$tVol\n";
}
elsif ($tProduct eq $TE_Product) { # 電指期
print out_te "$tTime,$tPrice,$tVol\n";
}
elsif ($tProduct eq $TF_Product) { # 金指期
print out_tf "$tTime,$tPrice,$tVol\n";
}
}
}

close(out_tf);
close(out_te);
close(out_mtx);
close(out_tx);

close(read_file);

&process_kline($tx_tickfile, $Minute1K);
}

參考我的 wiki : Process split tick - proc3w_tick.pl

2009年7月14日 星期二

自期交所自行下載交易檔 perl 程式(win-XP)

在Windows XP使用 perl script 程式,配合cronw自動排程,自動抓台期交所當天交易檔
  1. 環境: windows xp sp2
  2. 程式名稱 : gettick3w.pl
  3. 程式目的 : 抓台期交所當天交易檔
  4. 程式碼




#!C:\Perl\bin\perl.exe

# 2009/6/25 Change directory to C:\\tick\\prg_perl3w\\
# 2009/6/18 For Win32 ActivePerl
#!/usr/bin/perl # 原程式是在 Debian linux 下
# 2009-05-30 get taiwan future tick

use POSIX qw(strftime);

$workDir = 'C:\\tick\\prg_perl3w\\daily\\';

$today_ziptickfile = strftime "Daily_%Y_%m_%d.zip", localtime;
$today_tickfile = strftime "Daily_%Y_%m_%d.rpt", localtime;

$LogFile = $workDir . "perl_crontab.log";

$tickfile = "http://www.taifex.com.tw/DailyDownload/" .$today_ziptickfile ;

chdir $workDir;

# 用 wget 抓台期交所當天交易檔
my $content = `C:\\tool\\wget.exe -c -a $LogFile -P $workDir $tickfile`;

if (-e $today_ziptickfile) {
# 解 zip 檔
# `unzip $today_ziptickfile`;
`c:\\tool\\unzip $today_ziptickfile`;
}
else {
die("File not exist : $today_ziptickfile.\n");
}

參考我的 wiki : Get Taiwan future tick - gettick3w.pl

2009年7月2日 星期四

台指期轉檔程式 - Linux Bash

自行到期交所下載交易檔及轉台指期的1分 K 的 bash 程式

這部份是在linux上的shell script程式,配合crontab自動排程
  • Crontab for User
    • 自動排程crontab
    • 編輯 user 的 crontab (執行 crontab -l )
    • 每週 1-5 16:44分,執行這支bash程式(~/prg_bash/cron_proc_tick.bash)
    • crontab 內容
    • # m  h  dom mon dow command
      # 分 時 日 月 周 指令
      44 16 * * 1-5 ~/prg_bash/cron_proc_tick.bash



  • 抓交易檔轉成tick程式
    • 環境: debian linux lenny
    • 程式名稱 : cron_proc_tick.bash
    • 程式目的 : 抓台灣期貨交易所當天交易檔,並分別轉成tick(.csv)
    • BASH 程式碼
    • #!/bin/sh

      # Get Tick

      today_tickfile=http://www.taifex.com.tw/DailyDownload/Daily_`date +%Y_%m_%d`.zip

      wget -c -a ~/tick/prg_bash/rj_crontab.log -P ~/tick/prg_bash/daily/ $today_tickfile


      # Process Tick

      cd ~/tick/prg_bash/daily/

      todayfile=`date +%Y_%m_%d`
      today=`date +%Y%m%d`
      todayMonth=`date +%Y%m`
      zipfile=Daily_$todayfile.zip

      workmonth=./tmp1

      wkproduct=`ls -l Daily_$todayfile.zip | cut -d ' ' -f 5 `

      if [ "$wkproduct" -ne '93' ]; then

      unzip $zipfile

      # echo Daily_$todayfile.rpt
      # echo $todayfile.TX

      # ltd=`tac last-trading-days`
      ltd=`tac ~/tick/last-trading-days`
      for td in $ltd
      do
      #echo "$td="$td , "$today="$today
      if [ "$td" -ge "$today" ]; then
      #echo " $td > $today "
      wkmonth=`echo $td`
      fi
      done

      echo $wkmonth > $workmonth

      wkproduct=`cut -c 1-6 $workmonth`
      # echo $wkproduct


      # TX 台指
      head -n 1 Daily_$todayfile.rpt > $todayfile.TX
      sed '/MTX/d' Daily_$todayfile.rpt | sed -n '/TX/p' | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $1,$2,$3,$4,$5,$6/2 }' >> $todayfile.TX
      echo "TickTime,Price,Vol" > txf$today.csv
      sed '/MTX/d' Daily_$todayfile.rpt | sed -n '/TX/p' | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $4,$5,$6/2 }' >> txf$today.csv

      # MTX 小台
      head -n 1 Daily_$todayfile.rpt > $todayfile.MTX
      sed -n '/MTX/p' Daily_$todayfile.rpt | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $1,$2,$3,$4,$5,$6/2 }' >> $todayfile.MTX
      echo "TickTime,Price,Vol" > mxf$today.csv
      sed -n '/MTX/p' Daily_$todayfile.rpt | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $4,$5,$6/2 }' >> mxf$today.csv


      # TE 電指期
      head -n 1 Daily_$todayfile.rpt > $todayfile.TE
      sed -n '/TE/p' Daily_$todayfile.rpt | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $1,$2,$3,$4,$5,$6/2 }' >> $todayfile.TE
      echo "TickTime,Price,Vol" > exf$today.csv
      sed -n '/TE/p' Daily_$todayfile.rpt | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $4,$5,$6/2 }' >> exf$today.csv

      ## TF 金指期
      head -n 1 Daily_$todayfile.rpt > $todayfile.TF
      sed '/GTF/d' Daily_$todayfile.rpt | sed -n '/TF/p' | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $1,$2,$3,$4,$5,$6/2 }' >> $todayfile.TF
      echo "TickTime,Price,Vol" > fxf$today.csv
      sed '/GTF/d' Daily_$todayfile.rpt | sed -n '/TF/p' | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $4,$5,$6/2 }' >> fxf$today.csv

      rm $workmonth


      if [ ! -d $todayMonth ]; then
      mkdir $todayMonth
      fi
      mv Daily_$todayfile.rpt $zipfile $todayMonth/

      if [ ! -d "~/tick/prg_bash/tick/$todayMonth" ]; then
      mkdir ~/tick/prg_bash/tick/$todayMonth
      fi
      mv $todayfile.TX txf$today.csv $todayfile.MTX mxf$today.csv $todayfile.TE exf$today.csv $todayfile.TF fxf$today.csv ~/tick/prg_bash/tick/$todayMonth/

      fi


參考我的 wiki : Get Taiwan future tick - cron_proc_tick.bash


2009年5月1日 星期五

定時自動抓期交所的成交資料

這幾天在趕程式, 空時看 程式交易聚寶盆 的文章, 其中有下載當天(最近30天)的成交資料, 要每天去抓, 覺得不方便。

昨天五月一日(星期五)沒交易, 在自家的主機(Debian)上, 用shell script 配合crontab寫了每天(星期一至星期五)16:30左右, 自動到期交所抓當天成交資料, 並分拆成台指, 小台指, 金指期, 電指期的tick檔, 下星期開始跑, 先暫時這樣。

這個程式只取當期(近月)的tick, 若是4月29日當天,會做以下動作
  • 到期交所抓當天成交資料(Daily_2009_04_29.zip)
  • 解Daily_2009_04_29.zip成Daily_2009_04_29.rpt
  • 參考最後結算日檔(last-trading-days)取出近月tick, 並分成台指, 小台指, 金指期, 電指期,及產生2009_04_29.TX , 2009_04_29.MTX , 2009_04_29.TF , 2009_04_29.TE 四個檔



待處理
  • 還沒有統計成1分鐘K,
  • 及改成perl寫的程式
  • 合併到原有的K線中


用 wget 下載的 script - wget-future-tick

#!/bin/sh

today_tickfile=http://www.taifex.com.tw/DailyDownload/Daily_`date +%Y_%m_%d`.zip

wget -c -a /daily/future_tick.log -P /daily/ $today_tickfile




分拆成台指,小台指,金指期,電指期的 script - proc-tick

#!/bin/sh

todayfile=`date +%Y_%m_%d` # -> 2009_04_29
today=`date +%Y%m%d` # -> 20090429
zipfile=Daily_$todayfile.zip # -> Daily_2009_04_29.zip

workmonth=./tmp1 # 暫存用

# 取得下載檔 size
filesize=`ls -l Daily_$todayfile.zip | cut -d ' ' -f 5 `

if [ "$filesize" -ne '93' ]; then # 超過 93 才有資料

unzip $zipfile # 解zip

# echo Daily_$todayfile.rpt
# echo $todayfile.TX

ltd=`tac last-trading-days` # 最後結算日檔
for td in $ltd
do
#echo "$td="$td , "$today="$today
if [ "$td" -ge "$today" ]; then
#echo " $td > $today "
wkmonth=`echo $td` # 取得最近的結算日 -> wkmonth
fi
done

echo $wkmonth > $workmonth

wkproduct=`cut -c 1-6 $workmonth` # 當期交易商品月份
# echo $wkproduct

# 用 sed 及 awk 分拆檔案
# TX 台指
head -n 1 Daily_$todayfile.rpt > $todayfile.TX # 留表頭第一行
sed '/MTX/d' Daily_$todayfile.rpt | sed -n '/TX/p' | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $1,$2,$3,$4,$5,$6 }' >> $todayfile.TX

# MTX 小台
head -n 1 Daily_$todayfile.rpt > $todayfile.MTX
sed -n '/MTX/p' Daily_$todayfile.rpt | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $1,$2,$3,$4,$5,$6 }' >> $todayfile.MTX

# TE 電指期
head -n 1 Daily_$todayfile.rpt > $todayfile.TE
sed -n '/TE/p' Daily_$todayfile.rpt | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $1,$2,$3,$4,$5,$6 }' >> $todayfile.TE

## TF 金指期
head -n 1 Daily_$todayfile.rpt > $todayfile.TF
sed '/GTF/d' Daily_$todayfile.rpt | sed -n '/TF/p' | sed -n 's/ //gp' | awk -F, 'BEGIN{OFS=","}($3=='$wkproduct'){ print $1,$2,$3,$4,$5,$6 }' >> $todayfile.TF

rm $workmonth # 刪除暫存檔
fi


crontab中的內容

# 分 時 日 月 星期 要執行的指令
34 16 * * 1-5 redjoetseng cd /daily/ && run-parts /etc/cron.tick/01get/wget-future-tick #每天抓future成交記錄
44 16 * * 1-5 redjoetseng cd /daily/ && run-parts /etc/cron.tick/02proc/proc-tick #依商品分拆future成交記錄


註:
  1. windows下也有crontab 排程(自動執行)程式 - CRONw
  2. 修改金指期(TF)部份,有GTF要除掉。(2009-05-06)



台灣期交所下載網頁

2009年2月4日 星期三

好吃不黏牙的台証Office Quote報價源

前兩天(2009/02/02)收到台証營業員王先生幫我伸請的Office Quote,昨天花了30分鐘熟析,並改了程式中來源設定檔,以配合Office Quote當資訊來源來跑程式,有近月期貨可選用,小巧、操作簡便,是個好吃不黏牙的報價源,唯一要說的是,要一直使用這個Office Quote報價源,台証要求要達到每月約一百口大台的交易量,多了些,以及要在開盤前重連線,沒有重新連線,報價會進不來。

昨天試了一下,開台指期(大台)、現貨(大盤)報價,記錄使用Memory(記憶體/內存)的用量,並比較Office Quote、台証超級大三元、元大yeswin(越是贏)、康和E閃電-標準版、康和E閃電-I KNOW版。



Office Quote:5048K
yeswin :97280K
台証超級大三元 :28272k
康和E閃電-標準版 :26600K
康和E閃電-I KNOW版 :6648K

Office Quote真是小巧,不佔太多Memory,舊電腦跑起也會很順。
Office Quote 記憶體使用量

Yeswin 記憶體使用量

台証超級大三元 記憶體使用量

康和E閃電-標準版 記憶體使用量

康和E閃電-I KNOW版 記憶體使用量

註:
1.Office Quote是艾揚 的產品。
2.台証超級大三元及康和E閃電都是凱衛資訊 的產品,程式名稱都是axis.exe。

資料是 2009-02-04 上午09:30以後抓的,附圖在 我的(redjoe.tseng)picasa-Future相簿2009/02/05 內。

聯絡表單

名稱

以電子郵件傳送 *

訊息 *