// Path: src/main/java/ch/urbanfox/freqtrade/FreqTradeApplication.java
// @SpringBootApplication
// public class FreqTradeApplication {
// 
//     private static final Logger LOGGER = LoggerFactory.getLogger(FreqTradeApplication.class);
// 
//     public static void main(String[] args) throws InterruptedException, TelegramApiException {
//         LOGGER.info("Starting freqtrade...");
// 
//         ConfigurableApplicationContext context = SpringApplication.run(FreqTradeApplication.class, args);
// 
//         LOGGER.info("freqtrade started.");
// 
//         FreqTradeMainRunner runner = context.getBean(FreqTradeMainRunner.class);
//         runner.main();
//     }
// 
// }
// 
// Path: src/main/java/ch/urbanfox/freqtrade/exchange/FreqTradeExchangeService.java
// public interface FreqTradeExchangeService {
// 
//     /**
//      * Places a limit buy order.
//      *
//      * @param pair currency pair
//      * @param rate Rate limit for order
//      * @param amount The amount to purchase
//      * @return orderId of the placed buy order
//      *
//      * @throws IOException if any error occur while contacting the exchange
//      */
//     String buy(CurrencyPair pair, BigDecimal rate, BigDecimal amount) throws IOException;
// 
//     /**
//      * Get Ticker for given pair.
//      *
//      * @param pair Pair as str, format: BTC_ETC
//      * @return the ticker
//      *
//      * @throws IOException if any error occur while contacting the exchange
//      */
//     Ticker getTicker(CurrencyPair pair) throws IOException;
// 
//     /**
//      * Places a limit sell order.
//      *
//      * @param pair currency pair
//      * @param rate Rate limit for order
//      * @param amount The amount to sell
//      * @return the order ID
//      *
//      * @throws IOException if any communication error occur while contacting the
//      *             exchange
//      */
//     String sell(CurrencyPair pair, BigDecimal rate, BigDecimal amount) throws IOException;
// 
//     /**
//      * Get all open orders for given pair.
//      *
//      * @param pair the currency pair
//      * @return list of orders
//      *
//      * @throws IOException if any communication error occur while contacting the
//      *             exchange
//      */
//     List<LimitOrder> getOpenOrders(CurrencyPair pair) throws IOException;
// 
//     /**
//      * Returns the market detail url for the given pair
//      *
//      * @param pair pair as a String, format: BTC_ANT
//      * @return url as a string
//      */
//     String getPairDetailUrl(String pair);
// 
//     /**
//      * Get account balance.
//      *
//      * @param currency currency as str, format: BTC
//      * @return balance
//      *
//      * @throws IOException if any communication error occur while contacting the
//      *             exchange
//      */
//     BigDecimal getBalance(Currency currency) throws IOException;
// 
//     /**
//      * Request ticker data from Bittrex for a given currency pair
//      */
//     List<BittrexChartData> fetchRawticker(CurrencyPair pair) throws IOException;
// 
//     /**
//      * Request ticker data from Bittrex for a given currency pair
//      */
//     List<BittrexChartData> fetchRawticker(CurrencyPair pair, ZonedDateTime minimumDate) throws IOException;
// 
// }


import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.knowm.xchange.bittrex.dto.marketdata.BittrexChartData;
import org.knowm.xchange.currency.CurrencyPair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ApplicationContext;
import com.fasterxml.jackson.databind.ObjectMapper;
import ch.urbanfox.freqtrade.FreqTradeApplication;
import ch.urbanfox.freqtrade.exchange.FreqTradeExchangeService;
package ch.urbanfox.freqtrade.tester;





public class GatherTestDataTester {

    private static final Logger LOGGER = LoggerFactory.getLogger(GatherTestDataTester.class);
    
    private static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS";

    public static void main(String[] args) throws IOException {

        ApplicationContext context = SpringApplication.run(FreqTradeApplication.class, args);

        FreqTradeExchangeService exchangeService = context.getBean(FreqTradeExchangeService.class);

// Path: src/main/java/ch/urbanfox/freqtrade/FreqTradeApplication.java
// @SpringBootApplication
// public class FreqTradeApplication {
// 
//     private static final Logger LOGGER = LoggerFactory.getLogger(FreqTradeApplication.class);
// 
//     public static void main(String[] args) throws InterruptedException, TelegramApiException {
//         LOGGER.info("Starting freqtrade...");
// 
//         ConfigurableApplicationContext context = SpringApplication.run(FreqTradeApplication.class, args);
// 
//         LOGGER.info("freqtrade started.");
// 
//         FreqTradeMainRunner runner = context.getBean(FreqTradeMainRunner.class);
//         runner.main();
//     }
// 
// }
// 
// Path: src/main/java/ch/urbanfox/freqtrade/exchange/FreqTradeExchangeService.java
// public interface FreqTradeExchangeService {
// 
//     /**
//      * Places a limit buy order.
//      *
//      * @param pair currency pair
//      * @param rate Rate limit for order
//      * @param amount The amount to purchase
//      * @return orderId of the placed buy order
//      *
//      * @throws IOException if any error occur while contacting the exchange
//      */
//     String buy(CurrencyPair pair, BigDecimal rate, BigDecimal amount) throws IOException;
// 
//     /**
//      * Get Ticker for given pair.
//      *
//      * @param pair Pair as str, format: BTC_ETC
//      * @return the ticker
//      *
//      * @throws IOException if any error occur while contacting the exchange
//      */
//     Ticker getTicker(CurrencyPair pair) throws IOException;
// 
//     /**
//      * Places a limit sell order.
//      *
//      * @param pair currency pair
//      * @param rate Rate limit for order
//      * @param amount The amount to sell
//      * @return the order ID
//      *
//      * @throws IOException if any communication error occur while contacting the
//      *             exchange
//      */
//     String sell(CurrencyPair pair, BigDecimal rate, BigDecimal amount) throws IOException;
// 
//     /**
//      * Get all open orders for given pair.
//      *
//      * @param pair the currency pair
//      * @return list of orders
//      *
//      * @throws IOException if any communication error occur while contacting the
//      *             exchange
//      */
//     List<LimitOrder> getOpenOrders(CurrencyPair pair) throws IOException;
// 
//     /**
//      * Returns the market detail url for the given pair
//      *
//      * @param pair pair as a String, format: BTC_ANT
//      * @return url as a string
//      */
//     String getPairDetailUrl(String pair);
// 
//     /**
//      * Get account balance.
//      *
//      * @param currency currency as str, format: BTC
//      * @return balance
//      *
//      * @throws IOException if any communication error occur while contacting the
//      *             exchange
//      */
//     BigDecimal getBalance(Currency currency) throws IOException;
// 
//     /**
//      * Request ticker data from Bittrex for a given currency pair
//      */
//     List<BittrexChartData> fetchRawticker(CurrencyPair pair) throws IOException;
// 
//     /**
//      * Request ticker data from Bittrex for a given currency pair
//      */
//     List<BittrexChartData> fetchRawticker(CurrencyPair pair, ZonedDateTime minimumDate) throws IOException;
// 
// }


// Path: src/test/java/ch/urbanfox/freqtrade/tester/GatherTestDataTester.java
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.knowm.xchange.bittrex.dto.marketdata.BittrexChartData;
import org.knowm.xchange.currency.CurrencyPair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ApplicationContext;
import com.fasterxml.jackson.databind.ObjectMapper;
import ch.urbanfox.freqtrade.FreqTradeApplication;
import ch.urbanfox.freqtrade.exchange.FreqTradeExchangeService;

package ch.urbanfox.freqtrade.tester;





public class GatherTestDataTester {

    private static final Logger LOGGER = LoggerFactory.getLogger(GatherTestDataTester.class);
    
    private static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS";

    public static void main(String[] args) throws IOException {

        ApplicationContext context = SpringApplication.run(FreqTradeApplication.class, args);

        FreqTradeExchangeService exchangeService = context.getBean(FreqTradeExchangeService.class);

        List<BittrexChartData> rawTickers = exchangeService.fetchRawticker(new CurrencyPair("ETH/BTC"));