Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Exchange BOC error

I get the following error now when running the scripts.



Comments

  • The new updated script is available for download: https://www.portfolioslicer.com/download/v2.4/PortfolioSlicerDDMScriptsV2.4.17.zip
    For existing users simply extract files from that compressed file into separate location and then copy the file GetExchRates-YahooIntraday to your script location

    Thank you to Maxim for the very fast update!
  • Thank you and thanks to Maxim. I still get the same error after the GetExchRates-Boc script is run.
  • Gbiasini,

    I just checked and new script did fix the problems I have. Can you please make sure that script GetExchRates-YahooIntraday has Jan 18, 2023 date?
    In your reported screenshot, "ExchRate Boc" succeeded and error was in GetExchRates-YahooIntraday script - script name with error is in your provided red error text:


  • Hi Vidas,

    Just like the version of GetExchRates-YahooIntraday in Scripts version 2.4.17, it has a date of January 26, 2022.

    Regards,
  • Hi,

    I checked again and I do not see any issues with 2.4.17 scripts - it has Get-ExchRates-YahooIntraday script with Jan 18, 2023 date. Please try again - download to separate folder and check files inside the zip file - there should be updated file inside.
  • I use the GetExchRates-BoC.ps1 script for exchange rates. My "CAD_USD.txt" and "USD_CAD.txt" data files seem to put new exchannge rates on 2 lines. Here is a screen cap of the portion of the "psCheckFiles.txt" log file showing the error.



    I have had this issue with both v 2.4.16 and 2.4.17 of the scripts. A manual workaround has been to delete the carriage return using NotePad and rerun just the "CreateFilesUpdatePSData.bat" batch file.
  • gsbaker,

    Please review your exchange rate files in the folder CurrExch.
    each exchange rate should be a line per day, as here:

    If you have some values split in two rows, then delete these rows.

    When was the last time you successfully run this GetExchRates-BOC.ps1 script?
    I would try to switch using ECB script, that is lines in .bat file should be:
    - Add REM in as the first symbols in the line that calls GetExchRates-BoC.ps1 script. This will comment out this line and will not execute.
    - instead use ECB script:

    REM powershell -ExecutionPolicy Bypass .\Scripts\GetExchRates-BoC.ps1
    powershell -ExecutionPolicy Bypass .\Scripts\GetExchRates-ECB.ps1



  • My recollection is that the last time I successfully ran the Exchange Rate scripts was prior to applying the fix to the error message noted above by GBiasini. I just tried running ONLY the BoC script just now (by "REM" ing out all of the other lines in the UpdatePSData.bat file (using a renamed copy and after backing up all of the previous exchange rate text files of course). So the only script file that ran was the GetExchRates-BoC.ps1. Here is an image of the BAT file I ran.



    Here is what the new lines look like in the CAD_USD.txt file (this is the same in the USD_CAD.txt file as well):



    My work-around has been to delete the CR character so that each day is only on one line and then running just the CreateFilesUpdatePSData.bat file to recreate the .CSV data files. This work around seems to work Ok and generate the correct CSV files.

    Incidentally I have been using the BoC exchange rates because that is the same data source as the financial software I use ("Moneydance") so it makes reconciling investment holdings easier. I have noticed some differences between the BoC rates and the ECG rates in the past.

    Gary
  • Hi Gary,

    From your last post in this tread I understood that your issue with Exchange rates are now resolved. But in another tread you stated that you still have issues with Exchange rates. Can you please clarify - what issue you still have with Exchange rates?
  • I am still having the same issue noted above - after running the scripts, the new lines added to the CAD_USD.txt and USD_CAD.txt datafiles split the exchange rates for each day on to 2 lines.

    I have a manual workaround, but the script still generates that error, which is detected and reported in the psCheckFiles.ps1 script and corresponding log file.
  • I am running GetExchRates-ECB.ps1 script daily and it works OK.
    Can you confirm that you run ECB script and please check the date for this script - should be 2023-01-01

  • ECB script runs fine, with no errors and generates the properly formatted CAD_USD.txt and USD_CAD.txt files. The BoC script continues to generate each new day's rates on 2 lines as noted above.
  • I asked the original script author to review/fix the script. I'll post an update when I'll hear from him.
  • I got following comment from original script developer:

    Script: GetExchRaets-BoC.ps1
    Line: 47
    Old code part:
    $a[0] + "," + $exchRate + "," +

    New Code part:
    $a[0] + "," + $exchRate.Replace("`r","") + "," +


    I will update and test later.
  • Thanks Vidas and MaximT. I have applied the suggested correction and it seems to be working.
Sign In or Register to comment.