コード例 #1
0
        //public void AgregarPrecio(byte idMercado, byte idMoneda, int idProducto, byte tipoPlazoLiquidacionOrden, TradeInfo infoTrade, FixEntryType settlementPrice, FixEntryType highValue, FixEntryType lowValue, FixEntryType tradeVolume, FixEntryType ClosingPrice)
        //{
        //    FixDAL.AgregarPrecio(idMercado, idMoneda, idProducto, tipoPlazoLiquidacionOrden, infoTrade, settlementPrice, highValue, lowValue, tradeVolume, ClosingPrice);
        //}

        public void AgregarPrecio(byte idMercado, byte idMoneda, int idProducto, byte tipoPlazoLiquidacionOrden, TradeInfo trade, FixEntryType closePrice, FixEntryType openPrice)
        {
            FixEntryType highValue       = null;
            FixEntryType lowValue        = null;
            FixEntryType tradeVolume     = null;
            FixEntryType settlementPrice = null;
            FixEntryType equivalentRate  = null;

            if (trade.InfoTrade != null && trade.InfoTrade.Count > 0)
            {
                highValue       = trade.InfoTrade.Find(it => it.TipoOferta == FixTipoEntradaEnum.TradingSessionHighPrice);
                lowValue        = trade.InfoTrade.Find(it => it.TipoOferta == FixTipoEntradaEnum.TradingSessionLowPrice);
                tradeVolume     = trade.InfoTrade.Find(it => it.TipoOferta == FixTipoEntradaEnum.TradeVolume);
                settlementPrice = trade.InfoTrade.Find(it => it.TipoOferta == FixTipoEntradaEnum.SettlementPrice);
                equivalentRate  = trade.InfoTrade.Find(it => it.TipoOferta == FixTipoEntradaEnum.MarginRate);
            }

            FixDAL.AgregarPrecio(idMercado, idMoneda, idProducto, tipoPlazoLiquidacionOrden, trade, settlementPrice, highValue, lowValue, tradeVolume, closePrice, openPrice, equivalentRate);
        }
コード例 #2
0
        //public void AgregarPrecio(byte idMercado, byte idMoneda, int idProducto, byte tipoPlazoLiquidacionOrden, List<FixEntryType> infoTrade, FixEntryType settlementPrice, FixEntryType highValue, FixEntryType lowValue, FixEntryType tradeVolume)
        public static short AgregarPrecio(byte idMercado, byte idMoneda, int idProducto, byte tipoPlazoLiquidacionOrden, TradeInfo trade, FixEntryType settlementPrice, FixEntryType highValue, FixEntryType lowValue, FixEntryType tradeVolume, FixEntryType closingPrice, FixEntryType openingPrice, FixEntryType equivalentRate)
        {
            List <SqlParameter> lista = new List <SqlParameter>();

            lista.Add(SqlServerHelper.GetParam("@IdProducto", idProducto));
            lista.Add(SqlServerHelper.GetParam("@IdMercado", idMercado));
            lista.Add(SqlServerHelper.GetParam("@Precio", trade.Precio));
            if (closingPrice != null)
            {
                lista.Add(SqlServerHelper.GetParam("@PrecioUltimoCierre", closingPrice.Precio));
            }
            if (openingPrice != null)
            {
                lista.Add(SqlServerHelper.GetParam("@PrecioApertura", openingPrice.Precio));
            }
            if (equivalentRate != null)
            {
                lista.Add(SqlServerHelper.GetParam("@EquivalentRate", equivalentRate.Precio));
            }
            //if (settlementPrice != null)
            //{
            //    lista.Add(SqlServerHelper.GetParam("@settlementPrice", settlementPrice.Precio));
            //}
            if (highValue != null)
            {
                lista.Add(SqlServerHelper.GetParam("@HighValue", highValue.Precio));
            }
            if (lowValue != null)
            {
                lista.Add(SqlServerHelper.GetParam("@LowValue", lowValue.Precio));
            }
            if (tradeVolume != null)
            {
                lista.Add(SqlServerHelper.GetParam("@TradeVolume", tradeVolume.Cantidad));
            }
            lista.Add(SqlServerHelper.GetParam("@Cantidad", trade.Cantidad));
            lista.Add(SqlServerHelper.GetParam("@Fecha", trade.Fecha));
            lista.Add(SqlServerHelper.GetParam("@IdPlazo", tipoPlazoLiquidacionOrden));
            lista.Add(SqlServerHelper.GetParam("@CompraVenta", trade.Side == FixSideOrdenEnum.Buy ? "C" : "V"));
            SqlParameter p = SqlServerHelper.GetParamStringOuput("@IdPrecio");

            lista.Add(p);

            SqlServerHelper.ExecuteNonQuery("orden_owner.FIX_AgregarPrecio", lista);
            return(short.Parse(p.Value.ToString()));
        }
コード例 #3
0
        public static void PersistirProductoPorMercado(int IdMercado, int IdProducto, FixEntryType openPrice, FixEntryType closePrice, FixEntryType referencePrice)
        {
            List <SqlParameter> lista = new List <SqlParameter>();

            lista.Add(SqlServerHelper.GetParam("@IdProducto", IdProducto));
            lista.Add(SqlServerHelper.GetParam("@IdMercado", IdMercado));

            if (openPrice != null)
            {
                lista.Add(SqlServerHelper.GetParam("@OpenPrice", openPrice.Precio));
            }
            if (closePrice != null)
            {
                lista.Add(SqlServerHelper.GetParam("@ClosePrice", closePrice.Precio));
            }
            if (referencePrice != null)
            {
                lista.Add(SqlServerHelper.GetParam("@ReferencePrice", referencePrice.Precio));
            }
            SqlServerHelper.ExecuteNonQuery("orden_owner.FIX_AgregarProductoPorMercado", lista);
        }
コード例 #4
0
 public void PersistirProductoPorMercado(int IdMercado, int IdProducto, FixEntryType openPrice, FixEntryType closePrice, FixEntryType referencePrice)
 {
     FixDAL.PersistirProductoPorMercado(IdMercado, IdProducto, openPrice, closePrice, referencePrice);
 }