Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Install script for GeniusTrader (http://www.geniustrader.org) onto Turnkey Linux LAMP 11.0 RC (http://www.turnkeylinux.org/lamp)
- #
- # v 0.0.5 build-essential added, much expanded options file, password variables
- # v 0.0.4 TKLBAM configured to backup options file, gt_path
- # v 0.0.3 Better integration, M$ Fonts, options file setup
- # v 0.0.2 replaced installtion of libgd-gd2-perl with libgd2-xpm-dev to fix cpan problem
- # == TODO ==============================================================================
- # When uncommenting sources, only uncomment whats needed
- # Integrate password source into that used by Turnkey
- # Move GT to a proper application install
- # Setup aliases and defaults so that more examples from GT documenation just work
- # Cut back gt privelidges on MySQL to just what it needs
- # Find free alternatives to the M$ fonts
- # ============================================================================== TODO ==
- # NOTES:
- # 1) You need to ensure that the password variables contain the correct passwords
- #
- MySQLPassword=password
- GTPassword=$MySQLPassword
- # Add the user that is going to run GeniusTrader
- useradd --create-home --shell=/bin/bash gt
- echo "gt:$GTPassword" | chpasswd
- # Create the directory where GeniusTrader is going to live, download GeniusTrader, extract from archive and tidy up, not forgetting to set gt as the owner
- mkdir /home/gt/geniustrader
- cd /home/gt/geniustrader/
- wget http://www.geniustrader.org/download/geniustrader_r690.tgz
- cd /home/gt/
- tar xfz geniustrader/geniustrader_r690.tgz
- rm -rf /home/gt/geniustrader/Windows_Installer
- mkdir /home/gt/.gt
- echo "PATH=\"\$PATH\":/home/gt/geniustrader/Scripts" > /home/gt/.bashrc.d/gt_path
- echo "export PATH" >> /home/gt/.bashrc.d/gt_path
- chmod +x /home/gt/.bashrc.d/gt_path
- chown -R gt:gt /home/gt
- # Enable the multiverse source so we can get the M$ fonts (actually it uncomments all source! TODO)
- sed -i -e "s/# deb/deb/g" /etc/apt/sources.list.d/sources.list
- apt-get update
- # Download and install the pre-requisites
- apt-get -y install libdate-calc-perl libgetargs-long-perl libxml-libxml-perl libcompress-zlib-perl libdate-manip-perl libgd2-xpm-dev beancounter msttcorefonts build-essential
- echo yes | cpan GD
- # Setup MySQL (TODO too much power?)
- mysql -u root -p$MySQLPassword -e "grant all privileges on *.* to gt@localhost"
- # Setup beancounter
- su - gt -c "setup_beancounter -m -s; update_beancounter -m"
- # Download some data to get started with
- su - gt -c "beancounter --dbsystem MySQL --dbname beancounter addstock IBM"
- su - gt -c "beancounter --dbsystem MySQL --dbname beancounter backpopulate --prevdate '20 year ago' --date 'today' IBM"
- # Download FTSE100 constituents and FTSE100, FTSE Mid 250, FTSE Mid 250 excl IT,FTSE All Share indexes
- su - gt -c "beancounter --dbsystem MySQL --dbname beancounter addstock AAL.L ABF.L ABG.L ADM.L AGK.L AMEC.L ANTO.L ARM.L ATST.L AU.L AV.L AZN.L BA.L BARC.L BATS.L BAY.L BG.L BLND.L BLT.L BNZL.L BP.L BRBY.L BSY.L BT-A.L CCL.L CNA.L CNE.L COB.L CPG.L CPI.L CSCG.L DGE.L EMG.L ENRC.L ESSR.L EXPN.L FRES.L GFS.L GKN.L GSK.L HMSO.L HSBA.L IAP.L IHG.L III.L IMT.L INVP.L IPR.L ISAT.L ISYS.L ITRK.L JMAT.L KAZ.L KGF.L LAND.L LGEN.L LLOY.L LMI.L MKS.L MRW.L NG.L NXT.L OML.L PFC.L PRU.L PSON.L RB.L RBS.L RDSA.L RDSB.L REL.L REX.L RIO.L RR.L RRS.L RSA.L RSL.L SAB.L SBRY.L SDR.L SDRC.L SGE.L SHP.L SL.L SMIN.L SN.L SRP.L SSE.L STAN.L SVT.L TLW.L TSCO.L TT.L ULVR.L UU.L VED.L VOD.L WEIR.L WOS.L WPP.L WTB.L XTA.L ^FTAS ^FTMC ^FTMX ^FTSE"
- su - gt -c "beancounter --dbsystem MySQL --dbname beancounter backpopulate --prevdate '10 year ago' --date 'yesterday' AAL.L ABF.L ABG.L ADM.L AGK.L AMEC.L ANTO.L ARM.L ATST.L AU.L AV.L AZN.L BA.L BARC.L BATS.L BAY.L BG.L BLND.L BLT.L BNZL.L BP.L BRBY.L BSY.L BT-A.L CCL.L CNA.L CNE.L COB.L CPG.L CPI.L CSCG.L DGE.L EMG.L ENRC.L ESSR.L EXPN.L FRES.L GFS.L GKN.L GSK.L HMSO.L HSBA.L IAP.L IHG.L III.L IMT.L INVP.L IPR.L ISAT.L ISYS.L ITRK.L JMAT.L KAZ.L KGF.L LAND.L LGEN.L LLOY.L LMI.L MKS.L MRW.L NG.L NXT.L OML.L PFC.L PRU.L PSON.L RB.L RBS.L RDSA.L RDSB.L REL.L REX.L RIO.L RR.L RRS.L RSA.L RSL.L SAB.L SBRY.L SDR.L SDRC.L SGE.L SHP.L SL.L SMIN.L SN.L SRP.L SSE.L STAN.L SVT.L TLW.L TSCO.L TT.L ULVR.L UU.L VED.L VOD.L WEIR.L WOS.L WPP.L WTB.L XTA.L ^FTAS ^FTMC ^FTMX ^FTSE"
- su - gt -c "beancounter --dbsystem MySQL --dbname beancounter update --forceupdate today"
- # Setup cron to download latest data every 4 hours into beancounter
- var="(crontab -l; echo \"0 */4 * * * beancounter --dbsystem MySQL --dbname beancounter update --forceupdate today\") | crontab -"
- su - gt -c "$var"
- # Create GeniusTrader Options file
- {
- echo \# === Set data \source as beancounter
- echo DB::module bean
- echo DB::bean::dbname beancounter
- echo DB::bean::db mysql
- echo \# === Default fonts
- echo \# \$FONT_ARIAL
- echo Path::Font::Arial /usr/share/fonts/truetype/msttcorefonts/arial.ttf
- echo \# \$FONT_FIXED
- echo Path::Font::Courier /usr/share/fonts/truetype/msttcorefonts/couri.ttf
- echo \# \$FONT_TIMES
- echo Path::Font::Times /usr/share/fonts/truetype/msttcorefonts/times.ttf
- echo \# === Brokerage
- echo Brokers::module SelfTrade
- echo \# ===
- echo Analysis::ReferenceTimeFrame year
- echo \# === Graphics setup
- echo Graphic::BackgroundColor LINEN
- echo Graphic::ZLevelOrder reverse
- echo Graphic::Axis::Font \$FONT_FIXED
- echo \# \for the volume histogram clip
- echo Graphic::Volume::Color I:G:If \{S:G:Below \{I:Prices OPEN\} \{I:Prices CLOSE\}\} green3 red3
- echo \# \for histograms \in general
- echo Graphic::Histogram::Color [100,100,100,100]
- echo Graphic::Histogram::ClipColor [80,80,80,0]
- echo \#
- echo Graphic::Candle::UpBorderColor green3 \# very dark green
- echo Graphic::Candle::DownBorderColor red3 \# dark red
- echo \#
- echo Graphic::Candle::UpColor green2 \# very dark green
- echo Graphic::Candle::DownColor red2 \# dark red
- echo \#
- echo Graphic::Positions::BuyColor \"[0,135,0]\" \# very dark green
- echo Graphic::Positions::SellColor \"[150,0,0]\" \# dark red
- echo \#
- echo Graphic::BuySellArrows::BuyColor \"[0,135,0,64]\" \# very dark green
- echo Graphic::BuySellArrows::SellColor \"[150,0,0,64]\" \# dark red
- echo Graphic::BuySellArrows::Distance 24
- echo Graphic::BuySellArrows::SizeFactor 6
- echo \#
- echo Graphic::Marks::Width 12
- echo \# === Aliases
- echo Aliases::Global::TFS SY:TFS 50 10 \| CS:SY:TFS
- echo Aliases::Global::TFS2[] SY:TFS \#1 \#2 \| CS:SY:TFS \#1
- echo Aliases::Global::TFS3[] SY:TFS \#1 \#2 \| CS:SY:TFS \#1 \| CS:Stop:Fixed \#3
- echo Aliases::Global::TFS[] SY:TFS \#1 \#2 \| CS:SY:TFS \#1 \| CS:Stop:Fixed \#3
- } > /home/gt/.gt/options
- chown gt:gt /home/gt/.gt/options
- #TKLBAM backup configuration
- echo /home/gt/.gt >> /var/lib/tklbam/profile/dirindex.conf
- # su - gt -c "./geniustrader/Scripts/graphic.pl --out 'ibm_daily.png' IBM"
- # su - gt -c "./geniustrader/Scripts/display_indicator.pl I:Prices IBM"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement