Search in sources :

Example 1 with EMAStrategy03

use of com.github.jnidzwetzki.cryptobot.strategy.EMAStrategy03 in project crypto-bot by jnidzwetzki.

the class EMABot method createStrategies.

/**
 * Init the trading stretegies
 */
private void createStrategies() {
    for (final BitfinexCurrencyPair currency : tradedCurrencies) {
        TradeStrategyFactory strategyFactory = new EMAStrategy03(5, 12, 40, timeSeries.get(currency));
        final Strategy strategy = strategyFactory.getStrategy();
        strategies.put(currency, strategy);
    }
}
Also used : EMAStrategy03(com.github.jnidzwetzki.cryptobot.strategy.EMAStrategy03) Strategy(org.ta4j.core.Strategy) TradeStrategyFactory(com.github.jnidzwetzki.cryptobot.strategy.TradeStrategyFactory) BitfinexCurrencyPair(com.github.jnidzwetzki.bitfinex.v2.entity.BitfinexCurrencyPair)

Example 2 with EMAStrategy03

use of com.github.jnidzwetzki.cryptobot.strategy.EMAStrategy03 in project crypto-bot by jnidzwetzki.

the class Main method findEma.

protected void findEma() throws InterruptedException {
    final List<Integer> sma1 = Arrays.asList(5, 6, 7, 8, 9, 10, 11, 12, 15);
    final List<Integer> sma2 = Arrays.asList(10, 12, 14, 16, 18, 20, 30, 40);
    final List<Integer> sma3 = Arrays.asList(40, 50, 60, 70, 80, 90);
    for (final int sma1Value : sma1) {
        for (final int sma2Value : sma2) {
            for (final int sma3Value : sma3) {
                final TradeStrategyFactory factory = new EMAStrategy03(sma1Value, sma2Value, sma3Value, timeSeries);
                processTrade(factory);
            }
        }
    }
}
Also used : EMAStrategy03(com.github.jnidzwetzki.cryptobot.strategy.EMAStrategy03) TradeStrategyFactory(com.github.jnidzwetzki.cryptobot.strategy.TradeStrategyFactory)

Aggregations

EMAStrategy03 (com.github.jnidzwetzki.cryptobot.strategy.EMAStrategy03)2 TradeStrategyFactory (com.github.jnidzwetzki.cryptobot.strategy.TradeStrategyFactory)2 BitfinexCurrencyPair (com.github.jnidzwetzki.bitfinex.v2.entity.BitfinexCurrencyPair)1 Strategy (org.ta4j.core.Strategy)1