Search in sources :

Example 1 with DonchianChannelStrategy

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

the class Main method run.

@Override
public void run() {
    try {
        System.out.println("Load data from file");
        loadDataFromFile();
        System.out.println("Executing trading on ticks: " + timeSeries.getEndIndex());
        printHeader();
        // final TradeStrategyFactory factory = new EMAStrategy03(5, 12, 40);
        // final Strategy strategy = ForexStrategy01.getStrategy(timeSeries);
        final TradeStrategyFactory factory1 = new DonchianChannelStrategy(24 * 4, 12 * 4, timeSeries);
        processTrade(factory1);
        final TradeStrategyFactory factory2 = new DonchianChannelStrategy(24 * 4, 24 * 4, timeSeries);
        processTrade(factory2);
        final TradeStrategyFactory factory3 = new DonchianChannelStrategy(12 * 4, 24 * 4, timeSeries);
        processTrade(factory3);
    // findEma();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : DonchianChannelStrategy(com.github.jnidzwetzki.cryptobot.strategy.DonchianChannelStrategy) TradeStrategyFactory(com.github.jnidzwetzki.cryptobot.strategy.TradeStrategyFactory) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException)

Aggregations

DonchianChannelStrategy (com.github.jnidzwetzki.cryptobot.strategy.DonchianChannelStrategy)1 TradeStrategyFactory (com.github.jnidzwetzki.cryptobot.strategy.TradeStrategyFactory)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1