Class PriceRangeCalculationHelper

java.lang.Object
velox.api.layer1.utils.PriceRangeCalculationHelper

public class PriceRangeCalculationHelper extends Object
Provides implementations of price range calculation
  • 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 range
      maxValue - maximum value of indicator on chart range
      linesCount - 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)
    • getGoodNumbersPriceResult

      public static CalculatePricesResult getGoodNumbersPriceResult(double minValue, double maxValue, double linesCount)
      Same as getGoodNumbersCalculation(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 range
      maxValue - maximum value of indicator on chart range
      linesCount - 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