コード例 #1
0
ファイル: test_algo.py プロジェクト: forlink/fxsignal
def optimizebuy_keltner2(config):
    feed = fxsignal.FxcmFeed('EUR/USD', datetime(2015, 10, 1),
                             datetime(2019, 5, 1), 'D1', config['fxcm'])
    feed.read_csv()
    data = fxsignal.FeedConverter.fxcm2bt(feed.clean())
    runner = fxsignal.OptimizeRunner(feed, data, 'trend_keltner2', 'sell')
    runner.run()
コード例 #2
0
def optimizesell_trend30(config):
    feed = fxsignal.FxcmFeed('GBP/USD', datetime(2019, 1, 1),
                             datetime(2019, 9, 1), 'm30', config['fxcm'])
    feed.read_csv()
    data = fxsignal.FeedConverter.fxcm2bt(feed.clean())
    runner = fxsignal.OptimizeRunner(feed, data, 'trend30', 'sell')
    runner.run()
コード例 #3
0
def savecsv(config):
    feed = fxsignal.FxcmFeed('GBP/USD', datetime(2018, 1, 1), datetime(2019, 5, 1), 'D1', config['fxcm'])
    # data = pd.DataFrame()
    data = feed.get_feed()
    feed.close()
    feed.save_csv(data)
    logging.info("savecsv count(): {}".format(len(data.index)))
コード例 #4
0
ファイル: test_algo.py プロジェクト: forlink/fxsignal
def optimizebuy_hma(config):
    feed = fxsignal.FxcmFeed('EUR/USD', datetime(2015, 1, 1),
                             datetime(2019, 5, 1), 'D1', config['fxcm'])
    feed.read_csv()
    data = fxsignal.FeedConverter.fxcm2bt(feed.clean())
    runner = fxsignal.OptimizeRunner(feed, data, 'trend_jackvortex', 'buy')
    runner.run()
コード例 #5
0
ファイル: test_algo.py プロジェクト: forlink/fxsignal
def simplebuy_keltner2(config):
    feed = fxsignal.FxcmFeed('EUR/USD', datetime(2015, 1, 1),
                             datetime(2019, 5, 1), 'D1', config['fxcm'])
    feed.read_csv()
    data = fxsignal.FeedConverter.fxcm2bt(feed.clean())
    runner = fxsignal.AlgoRunner(feed, data, 'trend_keltner2', 'buy')
    runner.run()
コード例 #6
0
def panda2bt(config):
    feed = fxsignal.FxcmFeed('GBP/USD', datetime(2018, 1, 1), datetime(2019, 5, 1), 'D1', config['fxcm'])
    # data = pd.DataFrame()
    feed.read_csv()
    d1 = feed.clean()
    # print(d1.info())
    data = fxsignal.FeedConverter.fxcm2bt(d1)
    logging.info("panda2bt symbol(): {}".format(feed.symbol))
コード例 #7
0
ファイル: test_algo.py プロジェクト: forlink/fxsignal
def simplebuy_keltner(config):
    feed = fxsignal.FxcmFeed('EUR/USD', datetime(2015, 1, 1),
                             datetime(2019, 5, 1), 'D1', config['fxcm'])
    feed.read_csv()
    data = fxsignal.FeedConverter.fxcm2bt(feed.clean())
    runner = fxsignal.AlgoRunner(feed, data, 'trend_keltner', 'buy')
    runner.run()
    logging.info("simplebuy symbol: {} {}".format(feed.symbol,
                                                  runner.feed.symbol))
コード例 #8
0
def optimizesell_hma(config, currency, start_dt):
    feed = fxsignal.FxcmFeed(currency, start_dt, datetime(2019, 8, 1), 'D1',
                             config['fxcm'])
    feed.read_csv()
    data = fxsignal.FeedConverter.fxcm2bt(feed.clean())
    runner = fxsignal.OptimizeRunner(feed,
                                     data,
                                     'trend_jackvortex',
                                     'sell',
                                     file_id=start_dt.strftime("%Y-%m-%d"))
    runner.run()
コード例 #9
0
def collect(config):
    ''' Collects data for whole period '''
    start_date = datetime(2019, 1, 1)
    end_date = datetime(2019, 9, 1)
    for symbol in symbol_list:

        feed = fxsignal.FxcmFeed(symbol, start_date, end_date, 'm30',
                                 config['fxcm'])
        feed.get_feed()
        feed.close()
        data = feed.clean()
        feed.save_csv(data)
        logging.info("{} count: {}".format(symbol, len(data.index)))
コード例 #10
0
def simplesell_trend30(config):
    feed = fxsignal.FxcmFeed('GBP/USD', datetime(2019, 1, 1),
                             datetime(2019, 9, 1), 'm30', config['fxcm'])
    feed.read_csv()
    data = fxsignal.FeedConverter.fxcm2bt(feed.clean())
    runner = fxsignal.AlgoRunner(feed,
                                 data,
                                 'trend30',
                                 'sell',
                                 plot=True,
                                 verbose=True)
    runner.run()
    logging.info("simplesell symbol: {} {}".format(feed.symbol,
                                                   runner.feed.symbol))
コード例 #11
0
ファイル: test_algo.py プロジェクト: forlink/fxsignal
def simplesell_hma(config):
    feed = fxsignal.FxcmFeed('EUR/USD', datetime(2018, 4, 1),
                             datetime(2019, 5, 1), 'D1', config['fxcm'])
    feed.read_csv()
    data = fxsignal.FeedConverter.fxcm2bt(feed.clean())
    runner = fxsignal.AlgoRunner(feed,
                                 data,
                                 'trend_jackvortex',
                                 'sell',
                                 plot=False,
                                 verbose=False)
    runner.run()
    logging.info("simplebuy symbol: {} {}".format(feed.symbol,
                                                  runner.feed.symbol))
コード例 #12
0
def collect_chunk(config):
    ''' Collects data by months (there is 10000 records limitation in fxcmpy API) '''
    start_date = datetime(2010, 1, 1)
    end_date = datetime(2019, 9, 1)
    for symbol in symbol_list:
        chunk_start_date = start_date
        chunk_end_date = start_date + relativedelta(months=+1)
        history = pd.DataFrame()

        while (chunk_start_date < end_date):
            feed = fxsignal.FxcmFeed(symbol, chunk_start_date, chunk_end_date,
                                     'm30', config['fxcm'])
            feed.get_feed()
            feed.close()
            data = feed.clean()
            history = history.append(data, ignore_index=True)
            chunk_start_date = chunk_end_date + relativedelta(seconds=+1)
            chunk_end_date = chunk_end_date + relativedelta(months=+1)

        feed.save_csv(history)
        logging.info("{} count: {}".format(symbol, len(history.index)))
コード例 #13
0
def getcsv(config):
    feed = fxsignal.FxcmFeed('GBP/USD', datetime(2018, 1, 1), datetime(2019, 5, 1), 'D1', config['fxcm'])
    # data = pd.DataFrame()
    data = feed.read_csv()
    logging.info("getcsv count(): {}".format(len(data.index)))