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

    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('-openhour',
                        metavar="OpenHour",
                        default=None,
                        type=check_positive,
                        help='Open hour')
    parser.add_argument('-openminute',
                        metavar="OpenMinute",
                        default=0,
                        type=check_positive,
                        help='Open minute')

    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)

    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
Ejemplo n.º 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, timeframe=False)
    common_samples.add_account_arguments(parser)
    args = parser.parse_args()

    return args
Ejemplo n.º 4
0
def parse_args():
    parser = argparse.ArgumentParser(description='Process command parameters.')
    common_samples.add_main_arguments(parser)
    common_samples.add_instrument_timeframe_arguments(parser, timeframe=False)
    common_samples.add_account_arguments(parser)
    parser.add_argument('-Stop', metavar="STOP", type=float, help='Stop level')
    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, timeframe=False)
    common_samples.add_account_arguments(parser)
    parser.add_argument('-Profit_Level',
                        metavar="PROFIT_LEVEL",
                        type=float,
                        help='Profit level')
    parser.add_argument('-Loss_Level',
                        metavar="LOSS_LEVEL",
                        type=float,
                        help='Loss level')
    args = parser.parse_args()

    return args
Ejemplo n.º 6
0
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