Esempio n. 1
0
        public static string EquityType2String(EquityType eq)
        {
            if (eq == EquityType.Option)
            {
                return("OPT");
            }
            else if (eq == EquityType.Stock)
            {
                return("STK");
            }
            else if (eq == EquityType.Future)
            {
                return("FUT");
            }
            else if (eq == EquityType.FutOpt)
            {
                return("FOP");
            }
            else if (eq == EquityType.Index)
            {
                return("IND");
            }

            throw new Exception("Invalid exception type. Internal error");
        }
 protected ITimeSheet TimeSheetFactory(
     IEnumerable <long> systemsIds,
     TimeInterval timeInterval = TimeInterval.Month,
     EquityType equityType     = EquityType.Equity,
     String planId             = C2ExplorerServiceStack.Logic.Implementation.Globals.DefaultCommissPlan)
 {
     return(queryRunner.TimeSheetFactory(systemsIds, timeInterval, equityType, planId));
 }
 protected IEnumerable <object> GetEquitiesSheet(long system, TimeInterval timeInterval, EquityType equityType)
 {
     return(this.GetEquitiesSheet(new long[] { system }, timeInterval, equityType));
 }
        protected IEnumerable <object> GetEquitiesSheet(long[] systems, TimeInterval timeInterval, EquityType equityType)
        {
            ITimeSheet timeSheet = queryRunner.TimeSheetFactory(systems, timeInterval, equityType);

            return(timeSheet.GetEquitiesSheet());
        }
Esempio n. 5
0
        public LegData(int?ID,
                       string ticker,
                       EquityType equity_type,
                       string exchange,
                       int multiplier,
                       string local_symbol,
                       int?con_id,
                       OpenCloseValues if_closed,
                       bool?if_call,
                       bool if_sell,
                       decimal?strike,
                       DateTime?expiry_date,
                       decimal?und_price,
                       decimal?open_price,
                       decimal?close_price,
                       int no_contracts,
                       double?totaldelta,
                       double?totaltheta,
                       double?gamma,
                       double?vega,
                       double?mydelta,
                       double?mytheta,
                       double?mygamma,
                       double?myvega,
                       DateTime?open_date,
                       DateTime?closed_date,
                       decimal?profit_loss,
                       DateTime?profit_loss_timestamp,
                       decimal?daily_profit_loss,
                       DateTime?daily_profit_loss_timestamp,
                       decimal?yesterday_profit_loss,
                       DateTime?yesterday_profit_loss_timestamp,
                       decimal?profit_threshold,
                       DateTime?last_email,
                       int email_notifications,
                       int?trade_id)
        {
            bIfUpdatingMarketData = false;
            Id              = ID;
            Ticker          = ticker;
            Equity          = equity_type;
            Exchange        = exchange;
            Multiplier      = multiplier;
            LocalSymbol     = local_symbol;
            ConId           = con_id;
            OpenCloseStatus = if_closed;
            IfCall          = if_call;
            IfSell          = if_sell;
            Strike          = (double?)strike;
            ExpiryDate      = expiry_date;
            UnderlyingPrice = (double?)und_price;
            OpenPrice       = (double?)open_price;
            ClosePrice      = (double?)close_price;
            NoContracts     = no_contracts;
            TotalDelta      = totaldelta;
            TotalTheta      = totaltheta;
//            Gamma = gamma;
//            Vega = vega;
            MyDelta                      = mydelta;
            MyTheta                      = mytheta;
            MyGamma                      = mygamma;
            MyVega                       = myvega;
            OpenDate                     = open_date;
            ClosedDate                   = closed_date;
            TotalProfitLoss              = (double?)profit_loss;
            DailyProfitLoss              = (double?)daily_profit_loss;
            DailyProfitLossTimestamp     = daily_profit_loss_timestamp;
            ProfitLossTimestamp          = profit_loss_timestamp;
            YesterdayProfitLoss          = (double?)yesterday_profit_loss;
            YesterdayProfitLossTimestamp = yesterday_profit_loss_timestamp;
            ProfitThreshold              = (double?)profit_threshold;
            LastEmail                    = last_email;
            EmailNotifications           = email_notifications;
            Trade_id                     = trade_id;
            ModelOption                  = null;
        }
Esempio n. 6
0
 public OmahaEquity(EquityType eqtype, bool hasouts)
 {
     this.type     = eqtype;
     this.outcount = hasouts ? new int[52] : null;
     this.outs     = hasouts ? new List <Out>() : null;
 }