public SampleParams(String[] args) {
        // Get parameters with short keys
        mInstrument = getArgument(args, "i");
        mBuySell = getArgument(args, "d");
        String sRate = getArgument(args, "r");

        // If parameters with short keys are not specified, get parameters with long keys
        if (mInstrument.isEmpty())
            mInstrument = getArgument(args, "instrument");
        if (mBuySell.isEmpty())
            mBuySell = getArgument(args, "buysell");
        if (sRate.isEmpty())
            sRate = getArgument(args, "rate");

        String sLots = "";
        String sDateFrom = "";
        String sDateTo = "";
        String sRateStop = "";
        String sRateLimit = "";

        // Get parameters with long keys
        mContingencyID = getArgument(args, "contingencyid");
        mOrderID = getArgument(args, "orderid");
        mPrimaryID = getArgument(args, "primaryid");
        mSecondaryID = getArgument(args, "secondaryid");
        mTimeframe = getArgument(args, "timeframe");
        sLots = getArgument(args, "lots");
        mAccountID = getArgument(args, "account");
        mOrderType = getArgument(args, "ordertype");
        sDateFrom = getArgument(args, "datefrom");
        mDateFrom = Calendar.getInstance();
        sDateTo = getArgument(args, "dateto");
        mDateTo = Calendar.getInstance();
        sRateStop = getArgument(args, "ratestop");
        sRateLimit = getArgument(args, "ratelimit");
        mStatus = getArgument(args, "status");

        // Convert types
        try {
            mLots = Integer.parseInt(sLots);
        } catch (Exception ex) {
            mLots = 1;
        }
        try {
            mRate = Double.parseDouble(sRate);
        } catch (Exception ex) {
            mRate = Double.NaN;
        }
        try {
            mRateStop = Double.parseDouble(sRateStop);
        } catch (Exception ex) {
            mRateStop = Double.NaN;
        }
        try {
            mRateLimit = Double.parseDouble(sRateLimit);
        } catch (Exception ex) {
            mRateLimit = Double.NaN;
        }
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        try {
            mDateFrom.setTimeZone(TimeZone.getTimeZone("America/New_York"));
            mDateFrom.setTime(df.parse(sDateFrom));
        } catch (Exception ex) {
            mDateFrom = null;
        }
        try {
            mDateTo.setTime(df.parse(sDateTo));
        } catch (Exception ex) {
            mDateTo = null;
        }
    }