Howdy, Stranger!

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

Duplicate quotes for Friday the 13th

2»

Comments

  • Thank you for send me the file.
    But unfortunatelly, I was able to import this file without problems - all date fields were OK.
    I reviewed dates and all look OK. I converted dates to "Text" and reviewed them, some records have different allignment, but that should not be a problem.

    Next steps:
    1. Please download updated scripts - now they include more error handling, so should give more information on what is wrong with data.
    2. I also included the same script with old code - GetExcelSrcData_OleDB.ps1. So if you need to run your scripts you can do following:
    - Rename GetExcelSrcData.ps1 to GetExcelSrcData_Was.ps1
    - Rename GetExcelSrcData_OldDB.ps1 to GetExcelSrcData.ps1

    But please first test option 1 and post here more detail error message.

  • Hi Vitas,

    Option 1 - still the same error message, after updating the scripts.
    I had previously changed the transactions with dates 01-31-2014 to 01-30-2014, which is when the date inside the error changed to what it is still now.



  • edited March 23
    As you did not get additional error information, it is possible that you did not updated to latest script. Can you please re-download the script and run again - I am expecting more information about an error. Likely because of server caching, you downloaded script, but it was still older version.
  • I downloaded the scripts using a different browser to try to make sure I didn't have the cache issue, and it worked! I ran the batch files and everything updated without errors. Thank you again so much for all your help Vitas!
  • edited March 24
    Vidas, since there was a bunch of troubleshooting going on during this thread, and since I am also having the same issue, could you reiterate the steps we need to do to resolve this.

  • @Scrappy:

    Sumarry of what to do:
    - Download latest scripts and move them to your script folder.

    Update scripts:
    Scripts\GetQuotes-Yahoo.ps1 - updated code fixes the issue if Yahoo provides duplicate quotes.
    Scripts\GetExcelSrcData.ps1 - code changed from using OleDB to read data from Excel to PowerShell ImportExcel model.

    Additional scripts:
    Scripts\deduplicate-currExch.ps1
    Scripts\deduplicate-quotes.ps1
    deduplicate.bat

    If you already have duplicate issues, please download updated scripts, copy these 4 files to the corresponding folders (note that .bat files go to the folder above Scripts), and then run deduplicate.bat.

    - You will need to do additional steps to setup PowerShell to allow read Excel files. Follow instructions here: https://www.portfolioslicer.com/scripts/setup-powershell.html.




  • edited March 24
    OK, I ran setup powershell and it appeared to work properly.

    I have copied the 4 ps1 script files mentioned above into my Script folder and put the deduplicate.bat file in the folder above as instructed. The scripts were taken from v3_20260314

    I then:
    a. deleted the Quotes.csv file;
    b. ran UpdatePSData.bat (where I received the same error of duplicates);
    c. Ran Deduplicate.bat.

    When I went back and then checked the Quotes.csv file, the duplicates from 2026-03-20 for each symbol ofrom Yahoo was still there.

    This was the result of running depulicated.bat

    C:\PortfolioSlicer\PSDataExtract>deduplicate.bat

    C:\PortfolioSlicer\PSDataExtract>powershell -ExecutionPolicy Bypass .\Scripts\deduplicate-quotes.ps1
    13:36:05 Script: Deduplicate Quotes . Files Processed/Succeed/Failed/Changed/DuplicatesRemoved: 42/42/0/11/11. Duration: 2 sec.

    C:\PortfolioSlicer\PSDataExtract>powershell -ExecutionPolicy Bypass .\Scripts\deduplicate-currExch.ps1
    13:36:08 Script: Deduplicate CurrExch. Files Processed/Succeed/Failed/Changed/DuplicatesRemoved: 2/2/0/0/0. Duration: 0 sec.


    This is a line from Quotes.csv after running the above:

    "2026-03-20 183.589996 BMO.TO"
    "2026-03-20 183.589996 BMO.TO"
    "2026-03-23 188.259995 BMO.TO"


    Am I missing something?
  • You need to run deduplicate.bat just once - it will delete duplicates from Quotes folder, not from Quotes.csv file. After running deduplicate.bat you need again to run UpdatePSData.bat.
  • Perfect. That worked. Appreciate the help.
  • Thank you Vidas. Stumbled across this today after noticing my portfolio doubled in size on March 20th! Was nice to see that ;) What I did to fix:
    - Downloaded new scripts and .bat file, replaced current versions
    - Followed PowerShell commands instructions
    - Ran deduplicate.bat
    - Ran regular UpdatePSData.bat

    All good now. Keep up the great work!
  • edited April 1
    So I discovered the duplication problem when I did my month end update yesterday. I followed all the information here and now my spreadsheet looks okay. However, when I run UpdateDatePSData.bat, I get the following error:



    How and when does the file get created? What is the purpose of that file?
    What I am missing?
  • @dmorley64
    Please confirm you are using Portfolio Slicer v3
    It appears that you need to open psConfig.txt file and update parameter ExcelSourceFile.
    You should specify there full path to your PortfolioSlicer-Source.xlsx file.
  • edited April 1
    No, I am still using v2.4.08.
    The full path is in my psconfig.txt file.

    I tried v3 but for some reason I cant remember now, I decided to stay with v2.4
    I dont recall seeing that error message until this recent script and bat file update.
  • @dmorley64 - It appears that you updated all scripts and not just the ones were changed. So you are now running full v3 scripts.
    If you have , restore previous .bat file and run that.
    If you do not have previous .bat file, try commenting out (add "REM " to the start of each line) last 3 scripts executed.
    REM powershell -ExecutionPolicy Bypass .\Scripts\GetExcelSrcData.ps1
    REM powershell -ExecutionPolicy Bypass .\Scripts\GetExcelCostBasis.ps1
    REM powershell -ExecutionPolicy Bypass .\Scripts\psCheckFiles.ps1
    
  • Ah yes, silly me, restored .bat from my backup and all is good now. Thanks for your continued support!
Sign In or Register to comment.