def parse_args():
    parser = argparse.ArgumentParser(description='Process command parameters.')
    common_samples.add_main_arguments(parser)
    common_samples.add_direction_rate_lots_arguments(parser,
                                                     direction=False,
                                                     rate=False)
    common_samples.add_account_arguments(parser)
    common_samples.add_instrument_timeframe_arguments(parser)
    common_samples.add_date_arguments(parser, date_to=False)

    parser.add_argument('-nextbars',
                        metavar="NEXTBARS",
                        default=5,
                        type=int,
                        help='Number of prediction bars')

    def check_positive(value):
        i_value = int(value)
        if i_value <= 0:
            raise argparse.ArgumentTypeError(
                "%s is an invalid positive int value" % value)
        return i_value

    args = parser.parse_args()
    # specific arguments
    return args
def parse_args():
    parser = argparse.ArgumentParser(description='Process command parameters.')
    common_samples.add_main_arguments(parser)
    common_samples.add_instrument_timeframe_arguments(parser)
    common_samples.add_date_arguments(parser)
    common_samples.add_max_bars_arguments(parser)
    parser.add_argument('-PeriodMA1',
                        metavar="PERIODMA1",
                        default=5,
                        type=int,
                        help='Period of MA1')
    parser.add_argument('-PeriodMA2',
                        metavar="PERIODMA2",
                        default=10,
                        type=int,
                        help='Period of MA2')
    parser.add_argument('-PeriodMA3',
                        metavar="PERIODMA3",
                        default=15,
                        type=int,
                        help='Period of MA3')
    parser.add_argument('-TrainPercent',
                        metavar="TRAINPERCENT",
                        default=80,
                        type=int,
                        help='Percent of training data')
    args = parser.parse_args()
    return args
Beispiel #3
0
def parse_args():
    parser = argparse.ArgumentParser(description='Process command parameters.')
    common_samples.add_main_arguments(parser)
    common_samples.add_instrument_timeframe_arguments(parser)
    common_samples.add_date_arguments(parser)
    common_samples.add_max_bars_arguments(parser)
    args = parser.parse_args()
    return args
def parse_args():
    parser = argparse.ArgumentParser(description='Process command parameters.')
    common_samples.add_main_arguments(parser)
    common_samples.add_instrument_timeframe_arguments(parser)
    common_samples.add_date_arguments(parser)
    common_samples.add_max_bars_arguments(parser)
    parser.add_argument('-prevbars',
                        metavar="PREVBARS",
                        default=50,
                        type=int,
                        help='Number of bars for prediction')
    parser.add_argument('-nextbars',
                        metavar="NEXTBARS",
                        default=5,
                        type=int,
                        help='Number of prediction bars')
    args = parser.parse_args()
    return args
def parse_args():
    parser = argparse.ArgumentParser(description='Process command parameters.')
    common_samples.add_main_arguments(parser)
    common_samples.add_direction_rate_lots_arguments(parser, direction=False, rate=False)
    common_samples.add_account_arguments(parser)
    common_samples.add_instrument_timeframe_arguments(parser)
    common_samples.add_date_arguments(parser, date_to=False)

    def check_positive(value):
        i_value = int(value)
        if i_value <= 0:
            raise argparse.ArgumentTypeError("%s is an invalid positive int value" % value)
        return i_value
    parser.add_argument('-orderscount', metavar="COUNT", default=3, type=check_positive,
                        help='How many orders will the strategy create before going out.')
    parser.add_argument('-shortperiods', metavar="COUNT", default=5, type=check_positive,
                        help='Short MA periods count.')
    parser.add_argument('-longperiods', metavar="COUNT", default=15, type=check_positive,
                        help='Long MA periods count.')
    args = parser.parse_args()
    # specific arguments
    return args