Class PriceHistReq

java.lang.Object
com.studerw.tda.model.history.PriceHistReq

public class PriceHistReq extends Object

Encapsulates the necessary parameters for a TdaClient.priceHistory(PriceHistReq) call. Use the PriceHistReq.Builder to create an instance.

     //Price history for AMTD for the last week by the minute
     PriceHistReq request = PriceHistReq.Builder.priceHistReq()
       .withSymbol("AMTD")
       .withStartDate(System.currentTimeMillis() - (1000 * 60 * 60 * 24 * 7))
       .withFrequencyType(FrequencyType.minute)
       .withFrequency(1)
       .build();
 
  • Method Details

    • getSymbol

      public String getSymbol()
      Returns:
      uppercase symbol of equity, index, forex, option chain, etc. Your account must be explicitly enabled for several of the types.
    • getPeriodType

      public PeriodType getPeriodType()
      Returns:
      The number of periods for which the data is returned. For example, if periodtype=day and period=10, then the request is for 10 days of data
    • getPeriod

      public Integer getPeriod()
      Returns:
      The number of periods for which the data is returned. For example, if periodtype=day and period=10, then the request is for 10 days of data
    • getFrequencyType

      public FrequencyType getFrequencyType()
      Returns:
      The type of frequency with which a new candle is formed.
    • getFrequency

      public Integer getFrequency()
      Returns:
      The number of the frequencyType to be included in each candle.
    • getStartDate

      public Long getStartDate()
      Returns:
      The start date of the data being requested (Inclusive). If the startDate is not specified, then it will be (endDate - period) excluding weekends and holidays. If specified, then period and periodType CANNOT be specified.
    • getEndDate

      public Long getEndDate()
      Returns:
      The end date of the data being requested (Inclusive). If NULL, then the default is the previous business day.
    • getExtendedHours

      public Boolean getExtendedHours()
      Returns:
      Indicates if extended hours data is to be included in the response. FALSE if null. NOTE: Only valid for intraday data requests.
    • toString

      public String toString()
      Overrides:
      toString in class Object