This function checks that the given period code is valid. If the range or format is not valid, the function throws an error message indicating which codes are invalid. It also converts the input to the proper format if necessary.
Arguments
- start_date
The start date of the query, either in the format `yyyy` or `yyyy-mm`.
- end_date
The end date of the query, either in the format `yyyy` or `yyyy-mm`. Can be a maximum of 12 years after the start date for the annuel frequency or one year for monthly.
- frequency
The frequency of reported trade data, either `A` for annual or `M` for monthly.