// 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/analyze/AnalyzeService.java
// public interface AnalyzeService {
// 
//     /**
//      * Calculates a buy signal based several technical analysis indicators
//      *
//      * @param tickers the tickers to analyze
//      * @return true if pair is good for buying, false otherwise
//      */
//     boolean getBuySignal(TimeSeries tickers);
// 
// }
// 
// 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/main/java/ch/urbanfox/freqtrade/exchange/converter/BittrexDataConverter.java
// public class BittrexDataConverter {
//     
//     public TimeSeries parseRawTickers(List<BittrexChartData> rawData) {
// 
//         List<Tick> ticks = rawData.stream()
//                 .map(this::convertTick)
//                 .collect(Collectors.toList());
// 
//         return new BaseTimeSeries(ticks);
//     }
// 
//     private BaseTick convertTick(BittrexChartData data) {
// 
//         return new BaseTick(ZonedDateTime.ofInstant(data.getTimeStamp().toInstant(), ZoneId.systemDefault()),
//                 Decimal.valueOf(data.getOpen().toString()),
//                 Decimal.valueOf(data.getHigh().toString()),
//                 Decimal.valueOf(data.getLow().toString()),
//                 Decimal.valueOf(data.getClose().toString()),
//                 Decimal.valueOf(data.getVolume().toString()));
//     }
// 
// }


import java.time.ZonedDateTime;
import java.util.List;
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 ch.urbanfox.freqtrade.FreqTradeApplication;
import ch.urbanfox.freqtrade.analyze.AnalyzeService;
import ch.urbanfox.freqtrade.exchange.FreqTradeExchangeService;
import ch.urbanfox.freqtrade.exchange.converter.BittrexDataConverter;
import eu.verdelhan.ta4j.TimeSeries;
package ch.urbanfox.freqtrade.tester;




public class AnalyzeServiceTester {

    private static final Logger LOGGER = LoggerFactory.getLogger(AnalyzeServiceTester.class);

    public static void main(String[] args) throws Exception {
        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/analyze/AnalyzeService.java
// public interface AnalyzeService {
// 
//     /**
//      * Calculates a buy signal based several technical analysis indicators
//      *
//      * @param tickers the tickers to analyze
//      * @return true if pair is good for buying, false otherwise
//      */
//     boolean getBuySignal(TimeSeries tickers);
// 
// }
// 
// 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/main/java/ch/urbanfox/freqtrade/exchange/converter/BittrexDataConverter.java
// public class BittrexDataConverter {
//     
//     public TimeSeries parseRawTickers(List<BittrexChartData> rawData) {
// 
//         List<Tick> ticks = rawData.stream()
//                 .map(this::convertTick)
//                 .collect(Collectors.toList());
// 
//         return new BaseTimeSeries(ticks);
//     }
// 
//     private BaseTick convertTick(BittrexChartData data) {
// 
//         return new BaseTick(ZonedDateTime.ofInstant(data.getTimeStamp().toInstant(), ZoneId.systemDefault()),
//                 Decimal.valueOf(data.getOpen().toString()),
//                 Decimal.valueOf(data.getHigh().toString()),
//                 Decimal.valueOf(data.getLow().toString()),
//                 Decimal.valueOf(data.getClose().toString()),
//                 Decimal.valueOf(data.getVolume().toString()));
//     }
// 
// }


// Path: src/main/java/ch/urbanfox/freqtrade/tester/AnalyzeServiceTester.java
import java.time.ZonedDateTime;
import java.util.List;
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 ch.urbanfox.freqtrade.FreqTradeApplication;
import ch.urbanfox.freqtrade.analyze.AnalyzeService;
import ch.urbanfox.freqtrade.exchange.FreqTradeExchangeService;
import ch.urbanfox.freqtrade.exchange.converter.BittrexDataConverter;
import eu.verdelhan.ta4j.TimeSeries;

package ch.urbanfox.freqtrade.tester;




public class AnalyzeServiceTester {

    private static final Logger LOGGER = LoggerFactory.getLogger(AnalyzeServiceTester.class);

    public static void main(String[] args) throws Exception {
        ApplicationContext context = SpringApplication.run(FreqTradeApplication.class, args);

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