External Data Management Script Set

Portfolio Slicer expects 4 external files "Dates.csv" ,"CurrencyConv.csv" ,"Quotes.csv" and "Dividends.csv" that will be imported into Excel workbook. Portfolio Slicer includes "External Data Management Script Set" to help you to work with these external files. All these scripts are written using PowerShell scripting language. These scripts are open (not encrypted, not compiled), so you can open them in any text editor to review their logic and adjust it to your liking.

Purpose of these included scripts is to simplify management of your external data files. At this point script set includes 1 configuration file, 4 PowerShell scripts and one batch file.

  • Configuration file "psConfig.txt" - This configuration file contains all parameters required by scripts.
  • Script "CreateDatesFile.ps1 - This script creates Dates.csv file. This file will have dates from MinDate specified in psConfig.txt parameter file up to todays date.
  • Script "AppendGeneratedQuotes.ps1" - This script will append generated quotes (for static price symbols) to Quotes.csv file.
  • Script "ArchiveOldQuotes.ps1" - This optional script will split your symbol quotes file into 2 files. It will leave original file with daily quotes for last 50 calendar days and one quote per month for older dates. New file with suffix "_Archive" will have moved quote records.
  • Script "CheckPSFiles.ps1" - This script will check all 4 external files for any potential issues. We highly recommend to run this script every time after you create external data files - it would give you warning if data is not suitable for Portfolio Slicer import.
  • Batch File "UpdatePSData.bat" - This is batch file that executes scripts in required order.

Additional scripts

User MaximT created scripts to get data from various financial websites. These scripts were tested and confirmed to work with Portfolio Slicer (actually work very well). You can download them as part of Portfolio Slicer data management script set. You can choose to use these included scripts, or you can choose your own data provider for quotes and currency exchange rates.

  • Script "GetExchRatesBoC.ps1" - gets currency exchange rates from Bank of Canada website. Just exchange rates from 2017-May are availalbe using this new script.
  • Script "GetExchRatesBoC-Old.ps1" - gets currency exchange rates from Bank of Canada website using Old method (pre 2017-May). All exchange rates before 2017-May are extracted using this script.
  • Script "GetExchRatesYahooIntraday.ps1" - gets intraday exchange rates from Yahoo Finance website.
  • Script "GetExchRatesECB.ps1" - gets currency exchange rates from European Central Bank.
  •  

  • Script "GetQuotesGoogle.ps1" - gets historical quotes from Google Finance website.
  • Script "GetQuotesGoogleWeb.ps1" - gets historical quotes from Google Finance website.
  • Script "GetQuotesGoogleIntraday.ps1" - gets intraday quotes from Google Finance website.
  •  

  • Script "MakePSDataFiles.ps1" - reads data stored localy and creates files for Portfolio Slicer import.
  •  

  • (Not working) Script "GetDividendsYahoo.ps1" - gets dividend payment data from Yahoo Finance website.
  • (Not working) Script "GetExchRatesYahooIntraday.ps1" - gets intraday currency exchange rates from Yahoo Finance website.
  • (Not working) Script "GetQuotesYahoo.ps1" - gets historical quotes from Yahoo Finance website.
  • (Not working) Script "GetQuotesYahooIntraday.ps1" - gets intraday quotes from Yahoo Finance website.

Video instructions - How data extract scripts works