Apama Capital Markets Foundation 10.11 | Capital Markets Foundation | Analytics | Using the position service framework | Creating and using position service interfaces | Managing position trackers
 
Managing position trackers
 
Updating positions being tracked
The PSInterface object provides actions that let your application manage position trackers:
*addUpdateCallback() – This action registers a user-defined callback action to be called every time that a specified subscription's position changes. You can define more than one update callback per subscription.
*addSymbolSliceUpdateCallback() — This action registers a user-defined callback action to be called every time that the position changes for a specified symbol slice in a specified subscription. You can define more than one update callback per subscription.
*removeUpdateCallback() – This action removes the update callback previously registered for the specified reference Id, which was returned when the callback was added.
*getCurrentPosition() - This action returns the current position for the specified subscription
*setPosition() – This action allows the application to manually set the specified subscription's position in the tracker to the specified value. You must specify a callback action to be executed when the position update has been made, and to indicate whether or not the operation was successful. This action also returns the new position. Any matching subscriptions receive position updates.
*setPositionWithConfig() – This action is a duplicate of the setPosition() action but it allows an extra configuration parameter to be specified. For position adjustments, you can specify the TRACKER_CONFIG_UPDATE_SLICE configuration parameter. The value of this configuration parameter is of the type com.apama.position.tracker.generic.SliceKey.
*adjustRelativePosition() - This action allows the application to manually adjust (by a relative amount) the subscription's position in the tracker. This action uses the position object you specify to adjust the current position. For each of the four data fields, minQtyPosition, masQtyPosition, minCashPosition, and maxCashPosition, this action adds the value in the specified position object's field to the corresponding current value held by the tracker. If you want to decrease the value of a position, specify a negative number in the appropriate field of the postion object you specify. You must specify a callback action to be executed when the position adjustment has been made, and to indicate whether or not the operation was successful. This action returns the new position. Any matching subscriptions receive position updates.
*adjustRelativePositionWithConfig() – This action is a duplicate of the adjustRelativePosition() action, but it allows an extra configuration parameter to be specified. For position adjustments, you can specify the TRACKER_CONFIG_UPDATE_SLICE configuration parameter. The value of this configuration parameter is of the type com.apama.position.tracker.generic.SliceKey.
*resetPosition() – This action allows the application to manually set the specified subscription's position to zero in the tracker. This is the equivalent to using the setPosition() action with a zero value. A parameter to this action is a callback action that will be executed when the position adjustment has been made, and will indicate whether or not the operation was successful. Any matching subscriptions receive position updates.
*getTrackerInfo() - This action returns information about a specific position tracker implementation, including the context that it has been created in. This action can also be configured to wait until the tracker is registered and available before returning.