<commit_before>package stsc.algorithms.helpers.stock;

import java.util.List;
import java.util.Optional;

import stsc.algorithms.geometry.stock.FibonacciRetracementBearStdDev;
import stsc.common.BadSignalException;
import stsc.common.Day;
import stsc.common.algorithms.BadAlgorithmException;
import stsc.common.algorithms.StockAlgorithm;
import stsc.common.algorithms.StockAlgorithmInit;
import stsc.common.signals.SerieSignal;
import stsc.common.signals.SignalContainer;
import stsc.common.signals.SignalsSerie;
import stsc.signals.DoubleSignal;
import stsc.signals.series.LimitSignalsSerie;

/**
 * This algorithm is helper for Visualizing some of algorithms results. For example {@link FibonacciRetracementBearStdDev} algorithms can provide signal
 * {@link Double#MAX_VALUE} which is really much bigger then expected to visualize. <br/>
 * So you can use this algorithm to set up maximum (up and bottom borders). <br/>
 * For example: you can use it with next parameters:<br/>
 * a1. UP = 100d, DOWN = -100d;<br/>
 * a2. ALL = 100d (will setup 'up to 100d' and 'down to -100d').<br/>
 * You can use UP, DOWN and ALL together but result will be unpredictable. By default UP = {@link Double#MAX_VALUE}, DOWN = -{@link Double#MAX_VALUE}, ALL =
 * {@link Double#MAX_VALUE}.
 */
public final class AlgorithmsLimiter extends StockAlgorithm {

	private final String subAlgoName;
	private final double up;
	private final double down;
	private final double all;

	public AlgorithmsLimiter(StockAlgorithmInit init) throws BadAlgorithmException {
		super(init);<commit_msg>added javadocs to AlgorithmsLimiter<commit_after>package stsc.algorithms.helpers.stock;

import java.util.List;
import java.util.Optional;

import stsc.algorithms.geometry.stock.FibonacciRetracementBearStdDev;
import stsc.common.BadSignalException;
import stsc.common.Day;
import stsc.common.algorithms.BadAlgorithmException;
import stsc.common.algorithms.StockAlgorithm;
import stsc.common.algorithms.StockAlgorithmInit;
import stsc.common.signals.SerieSignal;
import stsc.common.signals.SignalContainer;
import stsc.common.signals.SignalsSerie;
import stsc.signals.DoubleSignal;
import stsc.signals.series.LimitSignalsSerie;

/**
 * This algorithm is helper for Visualizing some of algorithms results. For example {@link FibonacciRetracementBearStdDev} algorithms can provide signal
 * {@link Double#MAX_VALUE} which is really much bigger then expected to visualize. <br/>
 * So you can use this algorithm to set up maximum (up and bottom borders). <br/>
 * For example: you can use it with next parameters:<br/>
 * a1. UP = 100d, DOWN = -100d;<br/>
 * a2. ALL = 100d (will setup 'up to 100d' and 'down to -100d').<br/>
 * You can use UP, DOWN and ALL together but result will be unpredictable. By default UP = {@link Double#MAX_VALUE}, DOWN = -{@link Double#MAX_VALUE}, ALL =
 * {@link Double#MAX_VALUE}.
 * 
 * @input_parameters UP - double ({@link Double#MAX_VALUE}) <br/>
 *                   DOWN - double (- {@link Double#MAX_VALUE}) <br/>
 *                   ALL - double ({@link Double#MAX_VALUE}) <br/>
 *                   size - integer (2) size of output serie) <br/>
 *                   sub-execution algorithm;
 * @output_type {@link DoubleSignal} class.
 * @output_description if input value > UP -> UP, if input value < DOWN -> DOWN, if input value out of (-ALL, +ALL) border -> +/- ALL, otherwise input value.
 */
public final class AlgorithmsLimiter extends StockAlgorithm {

	private final String subAlgoName;
	private final double up;
	private final double down;
	private final double all;

	public AlgorithmsLimiter(StockAlgorithmInit init) throws BadAlgorithmException {
		super(init);
{'fraction_non_alphanumeric': 0.09926570573837368, 'fraction_numerical': 0.009518629317378298, 'mean_word_length': 4.530827067669173, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3837119', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1062, 'n_words': 357}