Ejemplo n.º 1
0
        public static Position Get(string key)
        {
            Dictionary <string, string> dic = TradeRA.GetFields(key);

            if (dic.Count == 0)
            {
                return(null);
            }
            else
            {
                return new Position()
                       {
                           id                    = int.Parse(dic["id"]),
                           code                  = dic["code"],
                           name                  = dic["name"],
                           price_cost            = decimal.Parse(dic["price_cost"]),
                           count                 = int.Parse(dic["count"]),
                           count_sellable        = int.Parse(dic["count_sellable"]),
                           price_cost_today_buy  = decimal.Parse(dic["price_cost_today_buy"]),
                           price_cost_today_sell = decimal.Parse(dic["price_cost_today_sell"]),
                           count_today_buy       = int.Parse(dic["count_today_buy"]),
                           count_today_sell      = int.Parse(dic["count_today_sell"]),
                           unit_id               = int.Parse(dic["unit_id"]),
                           unit_name             = dic["unit_name"],
                           account_id            = int.Parse(dic["account_id"]),
                           account_name          = dic["account_name"],
                           price_latest          = decimal.Parse(dic["price_latest"]),
                           block                 = int.Parse(dic["block"])
                       }
            };
        }
Ejemplo n.º 2
0
        public static OrderAuto Get(string key)
        {
            Dictionary <string, string> dic = TradeRA.GetFields(key);

            return(new OrderAuto()
            {
                id = long.Parse(dic["id"]),
                unit_id = int.Parse(dic["unit_id"]),
                user_id = int.Parse(dic["user_id"]),
                platform = int.Parse(dic["platform"]),
                account_id = int.Parse(dic["account_id"]),
                account_name = dic["account_name"],
                code = dic["code"],
                name = dic["name"],
                status = int.Parse(dic["status"]),
                type = int.Parse(dic["type"]),
                price_min = decimal.Parse(dic["price_min"]),
                price_max = decimal.Parse(dic["price_max"]),
                price_type = int.Parse(dic["price_type"]),
                count_min = int.Parse(dic["count_min"]),
                count_max = int.Parse(dic["count_max"]),
                count_total = int.Parse(dic["count_total"]),
                time_min = int.Parse(dic["time_min"]),
                time_max = int.Parse(dic["time_max"]),
                time_next_dt = DateTime.Parse(dic["time_next_dt"]),
                time_prev_dt = DateTime.Parse(dic["time_prev_dt"]),
                order_times = int.Parse(dic["order_times"]),
                order_count = int.Parse(dic["order_count"]),
                result_prev = dic["result_prev"],
                operator_start = dic["operator_start"],
                operator_stop = dic["operator_stop"]
            });
        }
Ejemplo n.º 3
0
        public static Account Get(string key)
        {
            Dictionary <string, string> dic = TradeRA.GetFields(key);

            return(new Account()
            {
                id = int.Parse(dic["id"]),
                code = dic["code"],
                name = dic["name"],
                limit_no_buying = dic["limit_no_buying"],
                limit_ratio_single = decimal.Parse(dic["limit_ratio_single"]),
                limit_ratio_gem_single = decimal.Parse(dic["limit_ratio_gem_single"]),
                limit_ratio_gem_total = decimal.Parse(dic["limit_ratio_gem_total"]),
                ratio_capital_warning = decimal.Parse(dic["ratio_capital_warning"]),
                capital_initial = decimal.Parse(dic["capital_initial"]),
                status = int.Parse(dic["status"]),
                status_order = int.Parse(dic["status_order"]),
                created_by = int.Parse(dic["created_by"]),
                capital_available = decimal.Parse(dic["capital_available"]),
                capital_stock_value = decimal.Parse(dic["capital_stock_value"]),
                capital_stock_value_gem = decimal.Parse(dic["capital_stock_value_gem"]),
                capital_total = decimal.Parse(dic["capital_total"]),
                capital_profit = decimal.Parse(dic["capital_profit"]),
                synchronized_time = dic["synchronized_time"],
            });
        }
Ejemplo n.º 4
0
        public static Deal Get(string key)
        {
            Dictionary <string, string> dic = TradeRA.GetFields(key);

            return(new Deal()
            {
                code = dic["code"],
                name = dic["name"],
                money = decimal.Parse(dic["money"]),
                deal_no = dic["deal_no"],
                time_dt = DateTime.Parse(dic["time_dt"]),
                price = decimal.Parse(dic["price"]),
                count = int.Parse(dic["count"]),
                type = int.Parse(dic["type"]),
                order_no = dic["order_no"],
                unit_id = int.Parse(dic["unit_id"]),
                unit_name = dic["unit_name"],
                account_id = int.Parse(dic["account_id"]),
                account_name = dic["account_name"],
                commission = decimal.Parse(dic["commission"]),
                management_fee = decimal.Parse(dic["management_fee"]),
                transferred = int.Parse(dic["transferred"]),
                profit = decimal.Parse(dic["profit"])
            });
        }
Ejemplo n.º 5
0
        public static AccountGroupItem Get(string key)
        {
            Dictionary <string, string> dic = TradeRA.GetFields(key);

            return(new AccountGroupItem()
            {
                account_group_id = int.Parse(dic["account_group_id"]),
                account_id = int.Parse(dic["account_id"]),
                capital_allow = decimal.Parse(dic["capital_allow"]),
                sort_buy = int.Parse(dic["sort_buy"]),
                sort_sell = int.Parse(dic["sort_sell"]),
                unit_id = int.Parse(dic["unit_id"]),
                capital_stock_value = decimal.Parse(dic["capital_stock_value"])
            });
        }
Ejemplo n.º 6
0
        public static Unit Get(string key)
        {
            Dictionary <string, string> dic = TradeRA.GetFields(key);

            if (dic.Count == 0)
            {
                return(null);
            }

            return(new Unit()
            {
                id = int.Parse(dic["id"]),
                code = dic["code"],
                name = dic["name"],
                user_id = int.Parse(dic["user_id"]),
                account_group_id = int.Parse(dic["account_group_id"]),
                capital_scale = decimal.Parse(dic["capital_scale"]),
                ratio_freezing = decimal.Parse(dic["ratio_freezing"]),
                ratio_management_fee = decimal.Parse(dic["ratio_management_fee"]),
                ratio_commission = decimal.Parse(dic["ratio_commission"]),
                ratio_software_fee = decimal.Parse(dic["ratio_software_fee"]),
                limit_stock_count = int.Parse(dic["limit_stock_count"]),
                limit_ratio_mbm_single = decimal.Parse(dic["limit_ratio_mbm_single"]),
                limit_ratio_gem_single = decimal.Parse(dic["limit_ratio_gem_single"]),
                limit_ratio_gem_total = decimal.Parse(dic["limit_ratio_gem_total"]),
                limit_ratio_sme_single = decimal.Parse(dic["limit_ratio_sme_single"]),
                limit_ratio_sme_total = decimal.Parse(dic["limit_ratio_sme_total"]),
                limit_ratio_smg_total = decimal.Parse(dic["limit_ratio_smg_total"]),
                limit_ratio_star_single = decimal.Parse(dic["limit_ratio_star_single"]),
                limit_ratio_star_total = decimal.Parse(dic["limit_ratio_star_total"]),
                ratio_warning = decimal.Parse(dic["ratio_warning"]),
                ratio_close_position = decimal.Parse(dic["ratio_close_position"]),
                limit_no_buying = dic["limit_no_buying"],
                limit_order_price = int.Parse(dic["limit_order_price"]),
                status = int.Parse(dic["status"]),
                status_order = int.Parse(dic["status_order"]),
                capital_balance = decimal.Parse(dic["capital_balance"]),
                capital_freezing = decimal.Parse(dic["capital_freezing"]),
                priority_strategy = int.Parse(dic["priority_strategy"]),
                capital_stock_value = decimal.Parse(dic["capital_stock_value"]),
                capital_stock_value_mbm = decimal.Parse(dic["capital_stock_value_mbm"]),
                capital_stock_value_star = decimal.Parse(dic["capital_stock_value_star"]),
                capital_stock_value_gem = decimal.Parse(dic["capital_stock_value_gem"]),
                capital_stock_value_sme = decimal.Parse(dic["capital_stock_value_sme"]),
                capital_profit = decimal.Parse(dic["capital_profit"]),
                capital_inout = decimal.Parse(dic["capital_inout"])
            });
        }
Ejemplo n.º 7
0
        public static Order Get(string key)
        {
            Dictionary <string, string> dic = TradeRA.GetFields(key);

            if (dic.Count == 0)
            {
                return(null);
            }
            else
            {
                return new Order()
                       {
                           trade_no           = dic["trade_no"],
                           trade_count        = (int)decimal.Parse(dic["trade_count"]),
                           code               = dic["code"],
                           name               = dic["name"],
                           deal_count         = (int)decimal.Parse(dic["deal_count"]),
                           cancel_count       = (int)decimal.Parse(dic["cancel_count"]),
                           status             = dic["status"],
                           state              = int.Parse(dic["state"]),
                           time_dt            = DateTime.Parse(dic["time_dt"]),
                           price              = decimal.Parse(dic["price"]),
                           count              = (int)decimal.Parse(dic["count"]),
                           type               = int.Parse(dic["type"]),
                           order_no           = dic["order_no"],
                           remark             = dic["remark"],
                           unit_id            = int.Parse(dic["unit_id"]),
                           unit_name          = dic["unit_name"],
                           user_id            = int.Parse(dic["user_id"]),
                           user_name          = dic["user_name"],
                           account_id         = int.Parse(dic["account_id"]),
                           account_name       = dic["account_name"],
                           deal_average_price = decimal.Parse(dic["deal_average_price"]),
                           platform           = int.Parse(dic["platform"])
                       }
            };
        }