Hello there, I am very much the noob. I am trying to get historic data, for now, BTCUSD and BTCAUD from coinbase.

I believe BTCAUD may not be available, so lets start with BTCUSD.

I have written this script with the help of the GPT……but it is still prompting me for answers. It does not seem to ignore the --no-interaction flag.

So I am wondering two things;
- Is BTCAUD available (from coinbase)
- How can I get the no interaction flage working

Thank you very much for any info anyone might have.

Hungry.


Below is the script……



# ===  Runs the included script in the current scope. That'll share variables, functions as though it was one ===
. "$PSScriptRoot\Include.ps1"

# === CONFIG ===
$startDate = "20200101"
$endDate = (Get-Date).ToString("yyyyMMdd")
$market = "coinbase"
$securityType = "crypto"

# Coinbase doesn't have tick
#$resolutions = @("tick", "second", "minute", "hour", "daily")
$resolutions = @("second", "minute", "hour", "daily")

# Coinbase symbols (you can add more)
# $symbols = @("BTCUSD", "BTCAUD", "ETHUSD", "LTCUSD", "BCHUSD", "DOGEUSD", "ADAUSD","SOLUSD", "AVAXUSD", "MATICUSD", "DOTUSD", "SHIBUSD")
$symbols = @("BTCUSD")

# === DOWNLOAD LOOP ===
foreach ($symbol in $symbols) {
   foreach ($resolution in $resolutions) {
       Write-Host "`n[INFO] Downloading $symbol | $market | $resolution"

       # === Clean old data (optional)
       $dataPath = ".\data\$securityType\$market\$($symbol.ToLower())\$resolution"
       if (Test-Path $dataPath) {
           Write-Host "[INFO] Removing old data at $dataPath"
           Remove-Item $dataPath -Recurse -Force
       }

       # === Download fresh data
       lean data download --security-type $securityType --symbol $symbol --market $market --resolution $resolution --start $startDate --end $endDate  --data-provider "Coinbase Advanced Trade" --no-interaction
   }
}
 

Author

Mr John T Sheppard

5 days ago