Package velox.api.layer1.utils
Class PriceRangeCalculationHelper
java.lang.Object
velox.api.layer1.utils.PriceRangeCalculationHelper
public class PriceRangeCalculationHelper
extends java.lang.Object
Provides implementations of price range calculation
-
Field Summary
Fields Modifier and Type Field Description static intMAX_NEGATIVE_PRICES_STEPS_MULTIPLIER_POWERstatic intMAX_POSITIVE_PRICES_STEPS_MULTIPLIER_POWERstatic int[]PRICES_STEPS_MULTIPLIERS -
Constructor Summary
Constructors Constructor Description PriceRangeCalculationHelper() -
Method Summary
Modifier and Type Method Description static Layer1PriceAxisRangeCalculatable.ResultPriceAxisInfogetGoodNumbersCalculation(double minValue, double maxValue, double linesCount)Provides an implementation of price range calculation that displays only "good" numbers on axis (1, 2, 5, 10, 25, 50 * 10^2n and their multipliers)static java.util.Map<java.lang.String,Layer1PriceAxisRangeCalculatable.ResultPriceAxisInfo>getGoodNumbersCalculation(double linesCount, java.util.Map<java.lang.String,Layer1PriceAxisRangeCalculatable.InputPriceAxisInfo> inputInfo)InvokesgetGoodNumbersCalculation(double, double, double)for every map entrystatic CalculatePricesResultgetGoodNumbersPriceResult(double minValue, double maxValue, double linesCount)Same asgetGoodNumbersCalculation(double, double, double), different return type
You don't need to use this method unless you want to see advanced parameters of best solution
-
Field Details
-
PRICES_STEPS_MULTIPLIERS
public static final int[] PRICES_STEPS_MULTIPLIERS -
MAX_POSITIVE_PRICES_STEPS_MULTIPLIER_POWER
public static final int MAX_POSITIVE_PRICES_STEPS_MULTIPLIER_POWER- See Also:
- Constant Field Values
-
MAX_NEGATIVE_PRICES_STEPS_MULTIPLIER_POWER
public static final int MAX_NEGATIVE_PRICES_STEPS_MULTIPLIER_POWER- See Also:
- Constant Field Values
-
-
Constructor Details
-
PriceRangeCalculationHelper
public PriceRangeCalculationHelper()
-
-
Method Details
-
getGoodNumbersCalculation
public static Layer1PriceAxisRangeCalculatable.ResultPriceAxisInfo getGoodNumbersCalculation(double minValue, double maxValue, double linesCount)Provides an implementation of price range calculation that displays only "good" numbers on axis (1, 2, 5, 10, 25, 50 * 10^2n and their multipliers)- Parameters:
minValue- minimal value of indicator on chart rangemaxValue- maximum value of indicator on chart rangelinesCount- number of visible horizontal lines, that can display labels. Note that this value is double.
Value 2.3 will means 2 visible lines, and 3/10 of distance between lines as empty space to the top- Returns:
-
getGoodNumbersCalculation
public static java.util.Map<java.lang.String,Layer1PriceAxisRangeCalculatable.ResultPriceAxisInfo> getGoodNumbersCalculation(double linesCount, java.util.Map<java.lang.String,Layer1PriceAxisRangeCalculatable.InputPriceAxisInfo> inputInfo)InvokesgetGoodNumbersCalculation(double, double, double)for every map entry -
getGoodNumbersPriceResult
public static CalculatePricesResult getGoodNumbersPriceResult(double minValue, double maxValue, double linesCount)Same asgetGoodNumbersCalculation(double, double, double), different return type
You don't need to use this method unless you want to see advanced parameters of best solution- Parameters:
minValue- minimal value of indicator on chart rangemaxValue- maximum value of indicator on chart rangelinesCount- number of visible horizontal lines, that can display labels. Note that this value is double.
Value 2.3 will means 2 visible lines, and 3/10 of distance between lines as empty space to the top- Returns:
- best calculated result or null if non was calculated
-