Round2Fraction (Function)
The Round2Fraction function calculates a value rounded to the nearest minmove fraction.
Syntax
Round2Fraction(DecAmt)
Parameters
Name |
Type |
Description |
DecAmt |
Numeric |
Sets a decimal value to be rounded to the nearest fractional price scale. |
Returns (Double)
A numeric value containing the nearest fractional value for a decimal variable.
Remarks
The nearest fraction is based on the price scale for the symbol type being evaluated. You can determine the price scale for any symbol by looking at the symbol properties.
Example
Assigns to Value1 the number 100.375 as the nearest fractional value for a stock with a price scale of 1/8th.
Value1 = RoundToFraction(100.3732);