ta4j-examples/src/main/java/ta4jexamples/bots/TradingBotOnMovingTimeSeries.java
private static Tick generateRandomTick() {
        final Decimal maxRange = Decimal.valueOf("0.03"); // 3.0%
        Decimal openPrice = LAST_TICK_CLOSE_PRICE;
        Decimal minPrice = openPrice.minus(openPrice.multipliedBy(maxRange.multipliedBy(Decimal.valueOf(Math.random()))));
        Decimal maxPrice = openPrice.plus(openPrice.multipliedBy(maxRange.multipliedBy(Decimal.valueOf(Math.random()))));
        Decimal closePrice = randDecimal(minPrice, maxPrice);
        LAST_TICK_CLOSE_PRICE = closePrice;
        return new BaseTick(ZonedDateTime.now(), openPrice, maxPrice, minPrice, closePrice, Decimal.ONE);
    }
private static Tick generateRandomTick() {
        final Decimal maxRange = Decimal.valueOf("0.03"); // 3.0%
        Decimal openPrice = LAST_TICK_CLOSE_PRICE;
        Decimal minPrice = openPrice.minus(openPrice.multipliedBy(maxRange.multipliedBy(Decimal.valueOf(Math.random()))));
        Decimal maxPrice = openPrice.plus(openPrice.multipliedBy(maxRange.multipliedBy(Decimal.valueOf(Math.random()))));
        Decimal closePrice = randDecimal(minPrice, maxPrice);
        LAST_TICK_CLOSE_PRICE = closePrice;
        return new BaseTick(ZonedDateTime.now(), openPrice, maxPrice, minPrice, closePrice, Decimal.ONE);
    }
private static Tick generateRandomTick ( ) { final Decimal maxRange = Decimal . valueOf ( "0.03" ) ; // 3.0%
 Decimal openPrice = LAST_TICK_CLOSE_PRICE ; Decimal minPrice = openPrice . minus ( openPrice . multipliedBy ( maxRange . multipliedBy ( Decimal . valueOf ( Math . random ( ) ) ) ) ) ; Decimal maxPrice = openPrice . plus ( openPrice . multipliedBy ( maxRange . multipliedBy ( Decimal . valueOf ( Math . random ( ) ) ) ) ) ; Decimal closePrice = randDecimal ( minPrice , maxPrice ) ; LAST_TICK_CLOSE_PRICE = closePrice ; return new BaseTick ( ZonedDateTime . now ( ) , openPrice , maxPrice , minPrice , closePrice , Decimal . ONE ) ; }
Generates a random tick.
@return a random tick
Generates a random tick .