Exemplo n.º 1
0
def result():
    return parse_ticker_dataframe(RESULT_BITTREX['result'],
                                  arrow.get('2017-08-30T10:00:00'))
Exemplo n.º 2
0
def preprocess(tickerdata: Dict[str, List]) -> Dict[str, DataFrame]:
    """Creates a dataframe and populates indicators for given ticker data"""
    return {
        pair: populate_indicators(parse_ticker_dataframe(pair_data))
        for pair, pair_data in tickerdata.items()
    }
Exemplo n.º 3
0
def result():
    with open('freqtrade/tests/testdata/BTC_ETH-1.json') as data_file:
        return parse_ticker_dataframe(json.load(data_file))
Exemplo n.º 4
0
def result():
    with open('freqtrade/tests/testdata/btc-eth.json') as data_file:
        data = json.load(data_file)

    return parse_ticker_dataframe(data['result'])
Exemplo n.º 5
0
def preprocess(backdata) -> Dict[str, DataFrame]:
    processed = {}
    for pair, pair_data in backdata.items():
        processed[pair] = populate_indicators(
            parse_ticker_dataframe(pair_data))
    return processed
Exemplo n.º 6
0
def preprocess(tickerdata: Dict[str, List]) -> Dict[str, DataFrame]:
    """Creates a dataframe and populates indicators for given ticker data"""
    return {pair: populate_indicators(parse_ticker_dataframe(pair_data))
            for pair, pair_data in tickerdata.items()}
Exemplo n.º 7
0
def result():
    with open('freqtrade/tests/testdata/BTC_ETH-1.json') as data_file:
        return parse_ticker_dataframe(json.load(data_file))
Exemplo n.º 8
0
# gather data
while True:

    # check time
    t = datetime.utcnow()
    s = t.second
    m = t.minute

    if s == 0 and m % trade_interval == 0:

        # get OHLC candles
        period = 'M' + str(trade_interval)
        resp = hitbtc.get_candles(market, limit=1000, period=period)

        # parse response into data frame and add technical indicators
        df = parse_ticker_dataframe(resp, exchange_name='HitBTC')
        df = populate_indicators(df)

        # add ask, bid, and last
        ticker = hitbtc.get_tickers(market)
        df['ask'] = ticker['ask']
        df['bid'] = ticker['bid']
        df['last'] = ticker['last']

        # save the last row of data frame
        file_name = list(str(df['date'][len(df) - 1]))
        file_name = "".join(file_name).replace(' ', '_').replace(':',
                                                                 '-') + '.csv'
        save_path = os.path.join(market_path, file_name)
        df.tail(1).to_csv(save_path, index=False)