MARKET.CSV Application Configuration File
The application reads settings from the application configuration file.
The default file is market.csv.exe.config. Please always keep it with the executable file, market.csv.exe.
You can specify alternative files using the config option. For example:
market.csv.exe download YahooFinanceQuotes symbols\uk-symbols.txt /config=configs\uk.config
This feature allows loading the different settings for different markets.
The application configuration files can contain the following settings:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="DefaultSymbolFileName" value="" /> <add key="MarketOpen" value="09:30:00 -05:00" /> <add key="MarketClose" value="16:00:00 -05:00" /> <add key="MarketTimeZone" value="-05:00" /> <add key="NextRequestDelay" value="500" /> <add key="RetryCycleDelay" value="5000" /> <add key="RetryCycleCount" value="3" /> <add key="Timeout" value="30000" /> <add key="Accept" value="" /> <add key="UserAgent" value="" /> <add key="CsvFolder" value="csv" /> <add key="DownloadFolder" value="downloads" /> <add key="ZipFolder" value="zip" /> <add key="CacheFolder" value="cache" /> <add key="LogFolder" value="logs" /> <add key="InputCodePage" value="1252" /> <add key="OutputCodePage" value="1252" /> <add key="CsvSeparator" value=";" /> <add key="CsvDateFormat" value="yyyy-MM-dd" /> <add key="CsvTimeFormat" value="HH:mm:ss" /> <add key="<Provider>_URL1" value="<URL>" /> <add key="<Provider>_URL2" value="<URL>" /> <add key="<Provider>_Fields" value="[<Field>[ AS <Name>][,...]]" /> </appSettings> </configuration>
Application Settings
- DefaultSymbolFileName
- This string value defines the default symbol file name. If specified, you can omit the file name in the download mode.
- MarketOpen
- This time value defines the market opening time.
The value is used to calculate trade dates. It is very important. - MarketClose
- This time value defines the market closing time.
The value is used to calculate trade dates. It is very important.
MARKET.CSV loads data after closing till opening once. - MarketTimeZone
- This string value defines the market time zone.
The time zone is used to calculate the market time of the downloaded data.
It is very important. - NextRequestDelay
- This integer value defines a delay between data requests in milliseconds.
The minimal value is 500 milliseconds that is used by default. - RetryCycleDelay
- This integer value defines a delay between cycles of reloading data with errors in milliseconds.
This time should be enough to reconnect your computer to the Internet. - RetryCycleCount
- This integer value defines the number of cycles of loading data.
In the first cycle, the application loads data from the current symbol list.
If an error occurs, the symbol is added to a retry list for the next cycle.
The application tries to reload data the specified number of cycles. - Timeout
- This integer value defines the web request timeout in milliseconds.
- Accept
- This string value defines the web request Accept header.
- UserAgent
- This string value defines the web request UserAgent header.
- CsvFolder
- This string value defines the folder for placing parsed CSV data.
The default value is "csv". - DownloadDataFolder
- This string value defines the folder for placing downloaded data (HTML, JSON, or CSV format).
The default value is "downloads". - ZipFolder
- This string value defines the folder for placing archives of parsed data.
The default value is "zip". - CacheFolder
- This string value defines the folder for placing cached data.
The default value is "cache". - LogFolder
- This string value defines the folder for placing log files.
The default value is "log". - InputCodePage
- This integer value defines a code page for symbol list files.
The default value is the default Windows code page. - OutputCodePage
- This integer value defines a code page for output CSV files.
The default value is the default Windows code page. - CsvSeparator
- This string value defines the CSV separator.
The default value is a semicolon. - CsvDateFormat
- This string value defines the date format for output CSV files as specified at
https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings.
The default value is "yyyy-MM-dd". - CsvTimeFormat
- This string value defines the time format for output CSV files as specified at
https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings.
The default value is "HH:mm:ss". - YahooFinanceHistoricalPricesStartDate
- This date value defines the start date for the YahooFinanceHistoricalPrices and YahooFinanceDividends providers.
Specify the date in the yyyy-MM-dd format. The default value is 2013-12-31.
The parameter was removed in version 2.2. - YahooFinanceQuotesFields
- This string value defines fields loaded by the YahooFinanceQuotes provider.
The parameter was removed in version 2.2. - Provider URL1
- This string value redefines the default URL with a single parameter (Symbol) used to download data.
Use this option to reflect changes made by data providers like Yahoo Finance, Google Finance, or MSN Money.
Usually, we change such URLs in newer versions to have the download URLs actual.
The URL must contain the{0}
parameter used to insert the symbol.
For example:
<add key="YahooOptions_URL1" value="http://query1.finance.yahoo.com/v7/finance/options/{0}" /> - Provider URL2
- This string value redefines the default URL with two parameters (Symbol and ExpDate) used to download data.
Use this option to reflect changes made by data providers like Yahoo Finance, Google Finance, or MSN Money.
The URL must contain the{0}
and{1}
parameter used to insert the symbol and the second parameter like an expiration date.
You can customize date and time parameters.
Use the{1:x}
form for Unix timestamps.
For example:
<add key="YahooOptions_URL2" value="http://query1.finance.yahoo.com/v7/finance/options/{0}?date={1:x}" /> - Provider Fields
- This string value allows customizing output CSV parameters, including changing column names and orders.
For example:
<add key="YahooOptions_Fields" value="LoadDate,LoadTime,MarketDate,MarketTime,Symbol,Expiration AS ExpDate,Type,Strike,
ContractSymbol AS ContractName,lastPrice AS Last,Bid,Ask,Change,PercentChange AS %Change,Volume,
OpenInterest AS Open Interest,ImpliedVolatility AS Implied Volatility,
-LastTradeDate,-Currency,-ContractSize,-InTheMoney" />
As you see, you can use multiple lines, the AS keyword to define the output name, and the hyphen at the field start to disable the field.
All the providers have built-in fields, like LoadDate or Symbol, and specific fields from a data source, like lastPrice or ImpliedVolatility.