Takes an existing value and rounds that value to the nearest tick.
Namespace:
RightEdge.CommonAssembly: 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 (Declaration) |
|---|
Public Shared Function RoundToNearestTick ( _ currentPrice As Double, _ tickSize As Double _ ) As Double |
| Visual C++ |
|---|
public: static double RoundToNearestTick( double currentPrice, double tickSize ) |
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
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.