Hello Team,
I'm very new to Tickstory and I'm looking to learn how I can identify the average tick spread on various forex paris. I've installed tickstory free and I'm currently downloading pairs I'll be researching. Could someone point me to documentation or provide steps for me on how I can see the average tick spread on these forex pairs I'm downloading?
Thank you in advance for any help you can provide me.
Thank you.
Assistance with finding average tick spread
Re: Assistance with finding average tick spread
Hi Greavette,
Please refer the "Custom token Reference" section in our manual for exporting custom formatted data to file (and also our YouTube demo on this topic). You can use the token {BarMaxSpreadInt} if you want to output a bar's spread in the exported data or {BarMinSpreadInt} if you want to use tick data. You can then run a Powershell similar to that below to calculate the average spread (this is untested and you will need to make your own modifications to suit):
Hope that helps.
Please refer the "Custom token Reference" section in our manual for exporting custom formatted data to file (and also our YouTube demo on this topic). You can use the token {BarMaxSpreadInt} if you want to output a bar's spread in the exported data or {BarMinSpreadInt} if you want to use tick data. You can then run a Powershell similar to that below to calculate the average spread (this is untested and you will need to make your own modifications to suit):
Code: Select all
# Set the path to your CSV file and the column name for spread
$csvFilePath = "path\to\your\exported_data.csv"
$spreadColumnName = "Spread"
# Initialize variables for total spread and count of data points
$totalSpread = 0
$count = 0
# Check if the CSV file exists
if (Test-Path -Path $csvFilePath -PathType Leaf) {
# Import the CSV data
$csvData = Import-Csv -Path $csvFilePath
# Loop through the data and calculate the total spread
foreach ($row in $csvData) {
$spread = [decimal]$row.$spreadColumnName
$totalSpread += $spread
$count++
}
if ($count -gt 0) {
$averageSpread = $totalSpread / $count
Write-Host "Average Spread: $($averageSpread.ToString("N2")) pips"
} else {
Write-Host "No data found in the CSV file."
}
} else {
Write-Host "CSV file not found."
}