Transformer Pipeline Module API Reference  7.1.1.311110
Validation

Detailed Description

The validation package provides a single validation algorithm in validate.threshold(). The call to this is wrapped up the validate.single_threshold() function call which provides a more user friendly interface.

Functions

 validate.threshold (var newprice, var oldprice, var heldprice, var threshold)
 Perform threshold checking on a value. More...
 
 validate.single_threshold (var update, var incomingname, var fieldid)
 Validate a single threshold field. More...
 

Function Documentation

validate.single_threshold ( var  update,
var  incomingname,
var  fieldid 
)

Validate a single threshold field.

Parameters
update- Outgoing update that we wish to validate
incomingname- Name of the incoming symbol
fieldid- Field id (in DataDictionary) of the field we wish to validate
Return values
1- Publish this update
nil- Don't publish this update

On incomingname we use the following database keys:

ValidationThreshold

On the data dictionary this function uses the following keys

fieldid

validate.threshold ( var  newprice,
var  oldprice,
var  heldprice,
var  threshold 
)

Perform threshold checking on a value.

Parameters
newprice- The new value
oldprice- The old value
heldprice- The currently held price
threshold- Threshold to check against (0.01 = 1%)

First return value:

Return values
validate.OK- this update is validated
validate.HOLD- this update should be held
validate.RELEASE- this update is ok, and the held value released
validate.KILL- this update is ok, and the held value discarded

Second return value:

Return values
Percentagechange - Percentage change between new price and old price

If heldprice is not nil then this function applies an auto-release principle in which if the next update is of the same order as the held value, the held value should be released.

If heldprice is nil then this function will simply perform validation on the new and oldprive and reutrn validate.OK or validate.HOLD as appropriate.

Example uses:

Newprice Oldprice Heldprice Threshold Result
10.7 10.2 10.0 0.1 validate.KILL
12.2 10.0 11.2 0.1 validate.RELEASE
15.0 10.0 12.0 0.1 validate.HOLD
109.9 100 nil 0.1 validate.OK
110.1 100.0 nil 0.1 validate.HOLD

Generated on Fri Mar 23 2018 18:29:26 for Transformer Pipeline Module API Reference