Takes an existing value and rounds that value to the nearest tick.

Namespace: RightEdge.Common
Assembly: Common (in Common.dll) Version: 2010.1.0.0 (2010.1.0.0)

Syntax

C#
public static double RoundToNearestTick(
	double currentPrice,
	double tickSize
)
Visual Basic
Public Shared Function RoundToNearestTick ( 
	currentPrice As Double,
	tickSize As Double
) As Double
Visual C++
public:
static double RoundToNearestTick(
	double currentPrice, 
	double tickSize
)
F#
static member RoundToNearestTick : 
        currentPrice : float * 
        tickSize : float -> float 

Parameters

currentPrice
Type: System..::..Double
Current price value.
tickSize
Type: System..::..Double
Tick size. This is the smallest allowable increment of price movement for a contract.

Return Value

Type: Double
The rounded tick value.

Remarks

This is commonly used in futures contracts where the tick size is variable. For example, the S&P 500 futures contract trades in $0.25 increments, or tick size. An order placed at $1000.22 would be invalid and rejected by the exchange. The nearest tick in $0.25 increments would be $1000.25.

See Also