use of com.github.jnidzwetzki.cryptobot.strategy.TradeStrategyFactory 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);
}
}
use of com.github.jnidzwetzki.cryptobot.strategy.TradeStrategyFactory 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);
}
}
}
}
use of com.github.jnidzwetzki.cryptobot.strategy.TradeStrategyFactory 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();
}
}
Aggregations