parameters: (parser)
docstring: Helper function that adds the options that are used to
      create a blpapi request to the argument parser.
docstring_summary: Helper function that adds the options that are used to
      create a blpapi request to the argument parser.
docstring_tokens: Helper function that adds the options that are used to create a blpapi request to the argument parser .
function: def addRequestOptions(parser):
      """
      Helper function that adds the options that are used to
      create a blpapi request to the argument parser.
      """
  
      # Compute default start/end datetime
      defaultStartDateTime, defaultEndDateTime = computeDefaultStartAndEndDateTime()
      formattedDefaultStartDateTime = defaultStartDateTime.isoformat(
          timespec="seconds")
      formattedDefaultEndDateTime = defaultEndDateTime.isoformat(
          timespec="seconds")
  
      isoDatetimeFormat = "YYYY-MM-DDTHH:MM:SS"
  
      # Request options
      argGroupRequest = parser.add_argument_group("Request Options")
      argGroupRequest.add_argument("-s",
                                   "--service",
                                   dest="service",
                                   help="The service name (default: %(default)s)",
                                   metavar="service",
                                   default=REFDATA_SERVICE)
      argGroupRequest.add_argument("-S",
                                   "--security",
                                   dest="securities",
                                   help="Security to request. Can be specified multiple times.",
                                   metavar="security",
                                   action="append",
                                   default=[])
      argGroupRequest.add_argument("-f",
                                   "--field",
                                   dest="fields",
                                   help="Field to request. Can be specified multiple times.",
                                   metavar="field",
                                   action="append",
                                   default=[])
      argGroupRequest.add_argument("-e",
                                   "--event",
                                   dest="eventTypes",
                                   help="Event Type (default: ['TRADE']). Can be specified multiple times.",
                                   metavar="eventType",
                                   action="append",
                                   default=[])
      argGroupRequest.add_argument("-i",
                                   "--interval",
                                   dest="barInterval",
                                   type=int,
                                   help="Bar interval (default: %(default)d)",
                                   metavar="barInterval",
                                   default=60)
      argGroupRequest.add_argument("-I",
                                   "--include-condition-codes",
                                   dest="conditionCodes",
                                   help="Include condition codes",
                                   action='store_true',
                                   default=False)
      argGroupRequest.add_argument("-G",
                                   "--gap-fill-initial-bar",
                                   dest="gapFillInitialBar",
                                   help="Gap fill initial bar",
                                   action='store_true',
                                   default=False)
      argGroupRequest.add_argument("--start-date",
                                   dest="startDateTime",
                                   help="Start datetime in the format of "
                                   f"{isoDatetimeFormat} (default: {formattedDefaultStartDateTime})",
                                   metavar="startDateTime",
                                   type=parseDatetime,
                                   default=defaultStartDateTime)
      argGroupRequest.add_argument("--end-date",
                                   dest="endDateTime",
                                   help="End datetime in the format of "
                                   f"{isoDatetimeFormat} (default: {formattedDefaultEndDateTime})",
                                   metavar="endDateTime",
                                   type=parseDatetime,
                                   default=defaultEndDateTime)
      argGroupRequest.add_argument("-O",
                                   "--override",
                                   dest="overrides",
                                   help="Field to override. Can be specified multiple times.",
                                   metavar="<fieldId>=<value>",
                                   action=OverridesAction,
                                   default=[])
      argGroupRequest.add_argument("-r",
                                   "--request",
                                   dest="requestType",
                                   choices=[REFERENCE_DATA_REQUEST,
                                            REFERENCE_DATA_REQUEST_OVERRIDE,
                                            REFERENCE_DATA_REQUEST_TABLE_OVERRIDE,
                                            INTRADAY_BAR_REQUEST,
                                            INTRADAY_TICK_REQUEST,
                                            HISTORICAL_DATA_REQUEST],
                                   help=f"""Request Type (default: %(default)s)
  To retrieve reference data:
      -r, --request {REFERENCE_DATA_REQUEST}
      [-S, --security <security = {{IBM US Equity, MSFT US Equity}}>]
      [-f, --field <field = PX_LAST>]
  To retrieve reference data with overrides:
      -r, --request {REFERENCE_DATA_REQUEST_OVERRIDE}
      [-S, --security <security = {{IBM US Equity, MSFT US Equity}}>]
      [-f, --field <field = {{PX_LAST, DS002, EQY_WEIGHTED_AVG_PX}}>]
      [-O, --override <<fieldId>=<value> = {{VWAP_START_TIME=9:30, VWAP_END_TIME=11:30}}]
  To retrieve reference data with table overrides:
      -r, --request {REFERENCE_DATA_REQUEST_TABLE_OVERRIDE}
      [-S, --security <security = FHR 3709 FA Mtge>]
      [-f, --field <field = {{MTG_CASH_FLOW, SETTLE_DT}}>]
  To retrieve intraday bars:
      -r, --request {INTRADAY_BAR_REQUEST}
      [-S, --security <security = IBM US Equity>]
      [-e, --event <event = TRADE>]
      [-i, --interval <barInterval = 60>]
      [--start-date <startDateTime = {formattedDefaultStartDateTime}>]
      [--end-date <endDateTime = {formattedDefaultEndDateTime}>]
      [-G, --gap-fill-initial-bar]
          1) All times are in GMT.
          2) Only one security can be specified.
          3) Only one event can be specified.
  To retrieve intraday raw ticks:
      -r, --request {INTRADAY_TICK_REQUEST}
      [-S, --security <security = IBM US Equity>]
      [-e, --event <event = TRADE>]
      [-i, --interval <barInterval = 60>]
      [--start-date <startDateTime = {formattedDefaultStartDateTime}>]
      [--end-date <endDateTime = {formattedDefaultEndDateTime}>]
      [--include-condition-codes <includeConditionCodes = false>]
          1) All times are in GMT.
          2) Only one security can be specified.
  To retrieve historical data:
      -r, --request {HISTORICAL_DATA_REQUEST}
      [-S, --security <security = {{IBM US Equity, MSFT US Equity}}>]
      [-f, --field <field = PX_LAST>]""",
                                   metavar="requestType",
                                   default=REFERENCE_DATA_REQUEST)
function_tokens: def addRequestOptions ( parser ) : # Compute default start/end datetime defaultStartDateTime , defaultEndDateTime = computeDefaultStartAndEndDateTime ( ) formattedDefaultStartDateTime = defaultStartDateTime . isoformat ( timespec = "seconds" ) formattedDefaultEndDateTime = defaultEndDateTime . isoformat ( timespec = "seconds" ) isoDatetimeFormat = "YYYY-MM-DDTHH:MM:SS" # Request options argGroupRequest = parser . add_argument_group ( "Request Options" ) argGroupRequest . add_argument ( "-s" , "--service" , dest = "service" , help = "The service name (default: %(default)s)" , metavar = "service" , default = REFDATA_SERVICE ) argGroupRequest . add_argument ( "-S" , "--security" , dest = "securities" , help = "Security to request. Can be specified multiple times." , metavar = "security" , action = "append" , default = [ ] ) argGroupRequest . add_argument ( "-f" , "--field" , dest = "fields" , help = "Field to request. Can be specified multiple times." , metavar = "field" , action = "append" , default = [ ] ) argGroupRequest . add_argument ( "-e" , "--event" , dest = "eventTypes" , help = "Event Type (default: ['TRADE']). Can be specified multiple times." , metavar = "eventType" , action = "append" , default = [ ] ) argGroupRequest . add_argument ( "-i" , "--interval" , dest = "barInterval" , type = int , help = "Bar interval (default: %(default)d)" , metavar = "barInterval" , default = 60 ) argGroupRequest . add_argument ( "-I" , "--include-condition-codes" , dest = "conditionCodes" , help = "Include condition codes" , action = 'store_true' , default = False ) argGroupRequest . add_argument ( "-G" , "--gap-fill-initial-bar" , dest = "gapFillInitialBar" , help = "Gap fill initial bar" , action = 'store_true' , default = False ) argGroupRequest . add_argument ( "--start-date" , dest = "startDateTime" , help = "Start datetime in the format of " f"{isoDatetimeFormat} (default: {formattedDefaultStartDateTime})" , metavar = "startDateTime" , type = parseDatetime , default = defaultStartDateTime ) argGroupRequest . add_argument ( "--end-date" , dest = "endDateTime" , help = "End datetime in the format of " f"{isoDatetimeFormat} (default: {formattedDefaultEndDateTime})" , metavar = "endDateTime" , type = parseDatetime , default = defaultEndDateTime ) argGroupRequest . add_argument ( "-O" , "--override" , dest = "overrides" , help = "Field to override. Can be specified multiple times." , metavar = "<fieldId>=<value>" , action = OverridesAction , default = [ ] ) argGroupRequest . add_argument ( "-r" , "--request" , dest = "requestType" , choices = [ REFERENCE_DATA_REQUEST , REFERENCE_DATA_REQUEST_OVERRIDE , REFERENCE_DATA_REQUEST_TABLE_OVERRIDE , INTRADAY_BAR_REQUEST , INTRADAY_TICK_REQUEST , HISTORICAL_DATA_REQUEST ] , help = f"""Request Type (default: %(default)s)
  To retrieve reference data:
      -r, --request {REFERENCE_DATA_REQUEST}
      [-S, --security <security = {{IBM US Equity, MSFT US Equity}}>]
      [-f, --field <field = PX_LAST>]
  To retrieve reference data with overrides:
      -r, --request {REFERENCE_DATA_REQUEST_OVERRIDE}
      [-S, --security <security = {{IBM US Equity, MSFT US Equity}}>]
      [-f, --field <field = {{PX_LAST, DS002, EQY_WEIGHTED_AVG_PX}}>]
      [-O, --override <<fieldId>=<value> = {{VWAP_START_TIME=9:30, VWAP_END_TIME=11:30}}]
  To retrieve reference data with table overrides:
      -r, --request {REFERENCE_DATA_REQUEST_TABLE_OVERRIDE}
      [-S, --security <security = FHR 3709 FA Mtge>]
      [-f, --field <field = {{MTG_CASH_FLOW, SETTLE_DT}}>]
  To retrieve intraday bars:
      -r, --request {INTRADAY_BAR_REQUEST}
      [-S, --security <security = IBM US Equity>]
      [-e, --event <event = TRADE>]
      [-i, --interval <barInterval = 60>]
      [--start-date <startDateTime = {formattedDefaultStartDateTime}>]
      [--end-date <endDateTime = {formattedDefaultEndDateTime}>]
      [-G, --gap-fill-initial-bar]
          1) All times are in GMT.
          2) Only one security can be specified.
          3) Only one event can be specified.
  To retrieve intraday raw ticks:
      -r, --request {INTRADAY_TICK_REQUEST}
      [-S, --security <security = IBM US Equity>]
      [-e, --event <event = TRADE>]
      [-i, --interval <barInterval = 60>]
      [--start-date <startDateTime = {formattedDefaultStartDateTime}>]
      [--end-date <endDateTime = {formattedDefaultEndDateTime}>]
      [--include-condition-codes <includeConditionCodes = false>]
          1) All times are in GMT.
          2) Only one security can be specified.
  To retrieve historical data:
      -r, --request {HISTORICAL_DATA_REQUEST}
      [-S, --security <security = {{IBM US Equity, MSFT US Equity}}>]
      [-f, --field <field = PX_LAST>]""" , metavar = "requestType" , default = REFERENCE_DATA_REQUEST )