@@ -0,0 +1,2487 @@
+/**%0A * The MIT License (MIT)%0A *%0A * Copyright (c) 2014 Marc de Verdelhan%0A *%0A * Permission is hereby granted, free of charge, to any person obtaining a copy of%0A * this software and associated documentation files (the %22Software%22), to deal in%0A * the Software without restriction, including without limitation the rights to%0A * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of%0A * the Software, and to permit persons to whom the Software is furnished to do so,%0A * subject to the following conditions:%0A *%0A * The above copyright notice and this permission notice shall be included in all%0A * copies or substantial portions of the Software.%0A *%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS%0A * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR%0A * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER%0A * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN%0A * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.%0A */%0Apackage eu.verdelhan.ta4j.strategies;%0A%0Aimport eu.verdelhan.ta4j.Indicator;%0Aimport eu.verdelhan.ta4j.Strategy;%0A%0A/**%0A * Maximum value starter strategy.%0A * %3Cp%3E%0A * Enter: when an %7B@link Indicator indicator%7D's value is less than a threshold%3Cbr%3E%0A * Exit: according to the provided %7B@link Strategy strategy%7D%0A *%0A * @author Daniel Kuan%0A */%0Apublic class MaxValueStarterStrategy extends AbstractStrategy %7B%0A%0A  /** Strategy */%0A  private final Strategy                    strategy;%0A  /** Indicator */%0A  private final Indicator%3C? extends Number%3E indicator;%0A  /** Starting threshold */%0A  private final double                      start;%0A%0A  /**%0A   * Constructor.%0A   * @param indicator the indicator%0A   * @param strategy the strategy%0A   * @param start the starting threshold%0A   */%0A  public MaxValueStarterStrategy(final Indicator%3C? extends Number%3E indicator, final Strategy strategy, final double start) %7B%0A    this.indicator = indicator;%0A    this.strategy = strategy;%0A    this.start = start;%0A  %7D%0A%0A  @Override%0A  public boolean shouldEnter(final int index) %7B%0A    return (indicator.getValue(index).doubleValue() %3C start);%0A  %7D%0A%0A  @Override%0A  public boolean shouldExit(final int index) %7B%0A    return strategy.shouldExit(index);%0A  %7D%0A%0A  @Override%0A  public String toString() %7B%0A    return String.format(%22%25s start: %25i%22, this.getClass().getSimpleName(), start);%0A  %7D%0A%0A%7D%0A

Create MaxValueStarterStrategy.java