Package velox.api.layer1.utils
Class PriceRangeCalculationHelper
java.lang.Object
velox.api.layer1.utils.PriceRangeCalculationHelper
Provides implementations of price range calculation
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetGoodNumbersCalculation(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)getGoodNumbersCalculation(double linesCount, Map<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:
-
MAX_NEGATIVE_PRICES_STEPS_MULTIPLIER_POWER
public static final int MAX_NEGATIVE_PRICES_STEPS_MULTIPLIER_POWER- See Also:
-
-
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 Map<String,Layer1PriceAxisRangeCalculatable.ResultPriceAxisInfo> getGoodNumbersCalculation(double linesCount, Map<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
-