Ejemplo n.º 1
0
        public static EntrustDirection GetSecurityEntrustDirection(UFXEntrustDirection entrustDirection)
        {
            EntrustDirection eDirection = EntrustDirection.None;

            switch (entrustDirection)
            {
            case UFXEntrustDirection.Buy:
                eDirection = EntrustDirection.BuySpot;
                break;

            case UFXEntrustDirection.Sell:
                eDirection = EntrustDirection.SellSpot;
                break;

            default:
                break;
            }

            return(eDirection);
        }
Ejemplo n.º 2
0
        public static EntrustDirection GetFuturesEntrustDirection(UFXEntrustDirection entrustDirection, UFXFuturesDirection futuresDirection)
        {
            EntrustDirection eDirection = EntrustDirection.None;

            if (entrustDirection == UFXEntrustDirection.Sell && futuresDirection == UFXFuturesDirection.Open)
            {
                eDirection = EntrustDirection.SellOpen;
            }
            else if (entrustDirection == UFXEntrustDirection.Sell && futuresDirection == UFXFuturesDirection.Close)
            {
                eDirection = EntrustDirection.SellClose;
            }
            else if (entrustDirection == UFXEntrustDirection.Buy && futuresDirection == UFXFuturesDirection.Close)
            {
                eDirection = EntrustDirection.BuyClose;
            }
            else if (entrustDirection == UFXEntrustDirection.Buy && futuresDirection == UFXFuturesDirection.Open)
            {
                eDirection = EntrustDirection.BuyOpen;
            }

            return(eDirection);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Get the EntrustDirection name from the given UFXEntrustDirection enum type.
 /// NOTE: it needs to add the Description flag in the enum value.
 /// </summary>
 /// <param name="direction">The given UFXEntrustDirection type value.</param>
 /// <returns>A string value of the entrust direction description.</returns>
 public static string GetEntrustDirection(UFXEntrustDirection direction)
 {
     return(EnumAttributeHelper.GetEnumDescription <UFXEntrustDirection>(direction));
 }