Ejemplo n.º 1
0
# python fx_2_currency_converter.py -f USDJPY -ty old
# python fx_2_currency_converter.py

import argparse
import struct
import time

import pandas as pd

from fxlib import get_input_path
from fxlib import get_module_logger

logger = get_module_logger(__name__)

HEADER_SIZE = 148
OLD_FILE_STRUCTURE_SIZE = 44
NEW_FILE_STRUCTURE_SIZE = 60


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('-f', '--filename', default='USDJPY')
    parser.add_argument('-ty', '--filetype', default='old')
    args = parser.parse_args()

    filename = args.filename
    filetype = args.filetype

    if filename is None:
        print("Enter a valid filename (-f)")
        quit()
Ejemplo n.º 2
0
# 2 month(60000)
#  python fx_3_feature_extraction.py
# 1 Year
#  python fx_3_feature_extraction.py -t 1
# 2 Year
#  python fx_3_feature_extraction.py -t 2

import argparse
from datetime import datetime

import fxlib
import fxlib.datasets as datasets
from fxlib.prepare import features, talib
from fxlib.utils import ohlc

logger = fxlib.get_module_logger(__name__)


def main():
    print(datetime.now())

    parser = argparse.ArgumentParser()
    parser.add_argument('-t', '--time', default='0')
    args = parser.parse_args()

    df = ohlc.get_data(args.time)

    df = features.extract(df)

    df = talib.extract(df)