Class EquityFitDataManager<DATATYPE extends EquityFitData>

java.lang.Object
com.illumon.modelfarm.fitterfarm.equity.EquityFitDataManager<DATATYPE>
Type Parameters:
DATATYPE - data type
All Implemented Interfaces:
RowDataManager<FitScope,DATATYPE>

public class EquityFitDataManager<DATATYPE extends EquityFitData> extends Object implements RowDataManager<FitScope,DATATYPE>
Utility for accessing and querying equity fit data contained in a dynamic table.
  • Field Details

    • csFitGroup

      protected final ColumnSource csFitGroup
    • csTimestamp

      protected final ColumnSource csTimestamp
    • csUnderlyingId

      protected final ColumnSource csUnderlyingId
    • csUnderlyingSym

      protected final ColumnSource csUnderlyingSym
    • csUnderlyingType

      protected final ColumnSource csUnderlyingType
    • csUnderlyingBid

      protected final ColumnSource csUnderlyingBid
    • csUnderlyingAsk

      protected final ColumnSource csUnderlyingAsk
    • csUnderlyingLast

      protected final ColumnSource csUnderlyingLast
    • csUnderlyingBidSize

      protected final ColumnSource csUnderlyingBidSize
    • csUnderlyingAskSize

      protected final ColumnSource csUnderlyingAskSize
    • csUnderlyingBidGap

      protected final ColumnSource csUnderlyingBidGap
    • csUnderlyingAskGap

      protected final ColumnSource csUnderlyingAskGap
    • csOptionIds

      protected final ColumnSource csOptionIds
    • csOptionSyms

      protected final ColumnSource csOptionSyms
    • csOptionRoots

      protected final ColumnSource csOptionRoots
    • csOptionPayoffTypes

      protected final ColumnSource csOptionPayoffTypes
    • csOptionExerciseTypes

      protected final ColumnSource csOptionExerciseTypes
    • csOptionSettlementTypes

      protected final ColumnSource csOptionSettlementTypes
    • csOptionExpirations

      protected final ColumnSource csOptionExpirations
    • csOptionStrikes

      protected final ColumnSource csOptionStrikes
    • csDivExDates

      protected final ColumnSource csDivExDates
    • csDivCashAmounts

      protected final ColumnSource csDivCashAmounts
    • csDivProportionalAmounts

      protected final ColumnSource csDivProportionalAmounts
    • csYieldCurveDates

      protected final ColumnSource csYieldCurveDates
    • csYieldCurveRates

      protected final ColumnSource csYieldCurveRates
    • csCarryCurveDates

      protected final ColumnSource csCarryCurveDates
    • csCarryCurveRates

      protected final ColumnSource csCarryCurveRates
    • csCarryCurveErrors

      protected final ColumnSource csCarryCurveErrors
  • Constructor Details

    • EquityFitDataManager

      public EquityFitDataManager(Supplier<DATATYPE> newEquityFitData, RowDataManager.LoadExtraColumns<DATATYPE> loadFitDataExtraColumns, DynamicTable data)
      Create a multithreaded resource to fit a derivative model's parameters for equities.

      The input table must have the following columns:

      • Timestamp: DBDateTime
      • FitGroup: String
      • UnderlyingId: long
      • UnderlyingSym: String
      • UnderlyingType: String
      • UnderlyingBid: double
      • UnderlyingAsk: double
      • UnderlyingLast: double (optional)
      • UnderlyingBidSize: double (optional)
      • UnderlyingAskSize: double (optional)
      • UnderlyingBidGap: double (optional)
      • UnderlyingAskGap: double (optional)
      • OptionId: DbLongArray
      • OptionSym: DbArray<String>
      • OptionRoot: DbArray<String> (optional)
      • OptionPayoffType: DbArray<String>
      • OptionExerciseType: DbArray<String>
      • OptionExpiration: DbArray<DBDateTime>
      • OptionStrike: DbDoubleArray
      • DivExDate: DbArray<DBDateTime>
      • DivCashAmount: DbDoubleArray
      • DivProportionalAmount: DbDoubleArray
      • YieldCurveDate: DbArray<DBDateTime>
      • YieldCurveRate: DbArray<DBDateTime>
      • CarryCurveDate: DbArray<DBDateTime>
      • CarryCurveRate: DbDoubleArray
      • CarryCurveError: DbDoubleArray
      Parameters:
      newEquityFitData - function to create a new EquityFitData of the proper type.
      loadFitDataExtraColumns - function to parse the data at a specific table index and load it into the EquityFitData.
      data - data for fitting the option model.
  • Method Details

    • table

      public DynamicTable table()
      Description copied from interface: RowDataManager
      Gets the source table.
      Specified by:
      table in interface RowDataManager<FitScope,DATATYPE extends EquityFitData>
      Returns:
      source table.
    • newData

      public DATATYPE newData()
      Description copied from interface: RowDataManager
      Creates a new data instance.
      Specified by:
      newData in interface RowDataManager<FitScope,DATATYPE extends EquityFitData>
      Returns:
      new data instance.
    • uniqueIdCurrent

      public FitScope uniqueIdCurrent(long index)
      Description copied from interface: RowDataManager
      Gets the current unique identifier value for a row.

      This function should only be called during an update loop or while holding the LTM lock.

      Specified by:
      uniqueIdCurrent in interface RowDataManager<FitScope,DATATYPE extends EquityFitData>
      Parameters:
      index - table row index.
      Returns:
      current unique identifier for a row.
    • uniqueIdPrev

      public FitScope uniqueIdPrev(long index)
      Description copied from interface: RowDataManager
      Gets the previous unique identifier value for a row. One column of each table is designated as a unique identifier for data rows.

      This function should only be called during an update loop or while holding the LTM lock.

      Specified by:
      uniqueIdPrev in interface RowDataManager<FitScope,DATATYPE extends EquityFitData>
      Parameters:
      index - table row index.
      Returns:
      previous underlying id.
    • underlyingMidCurrent

      public double underlyingMidCurrent(long index)
      Gets the current mid market price for the underlying, or NULL if both the bid and ask are not present.
      Parameters:
      index - data row index.
      Returns:
      current mid market price for the underlying, or NULL if both the bid and ask are not present.
    • loadData

      public void loadData(DATATYPE fitData, long index, boolean usePrev)
      Description copied from interface: RowDataManager
      Populates a data object with data from a table row.

      This method should be called while the LTM lock is held. This can occur either during the update loop or the LTM lock can be acquired outside the update loop. If the LTM lock is not held, the loaded data can be inconsistent or corrupt.

      Specified by:
      loadData in interface RowDataManager<FitScope,DATATYPE extends EquityFitData>
      Parameters:
      fitData - data structure to populate
      index - table index of the row to load data from
      usePrev - use data from the previous table update