Exemplo n.º 1
0
 /// <summary>
 ///   建構子
 /// </summary>
 /// <param name="lots">下單合約數量結構</param>
 /// <param name="name">下單名稱</param>
 /// <param name="action">下單進出場動作</param>
 /// <param name="exitInfo">平倉設定類別</param>
 public SOrderParameters(Contracts lots, string name, EOrderAction action, OrderExit exitInfo)
 {
     this.Lots         = lots;
     this.Name         = name;
     this.Action       = action;
     this.ExitTypeInfo = exitInfo;
 }
Exemplo n.º 2
0
 /// <summary>
 ///   建構子
 /// </summary>
 /// <param name="name">下單名稱</param>
 /// <param name="action">下單進出場動作列舉</param>
 /// <param name="category">下單類型</param>
 /// <param name="lots">下單合約數量</param>
 /// <param name="openNextBar">是否開倉在下一根 Bars</param>
 /// <param name="exitInfo">平倉設定類別</param>
 public Order(string name, EOrderAction action, OrderCategory category, Contracts lots, bool openNextBar, OrderExit exitInfo)
 {
     this.Name      = name;
     this.Action    = action;
     this.Category  = category;
     this.Contracts = lots;
     this.OnClose   = openNextBar;
     this.OrderExit = exitInfo;
 }
Exemplo n.º 3
0
        public void Edit(OrderExit entity)
        {
            entity.IsActive = false;
            orderExitRepository.Edit(entity);

            OrderExit am = new OrderExit();

            am.UniqueId    = Guid.NewGuid();
            am.Id          = entity.UniqueId;
            am.ClientId    = entity.ClientId;
            am.ProductId   = entity.ProductId;
            am.Quatity     = entity.Quatity;
            am.Cost        = entity.Cost;
            am.ExitDate    = entity.ExitDate;
            am.CreatedBy   = entity.CreatedBy;
            am.CreatedDate = DateTime.Now;

            this.orderExitRepository.Add(am);
        }
Exemplo n.º 4
0
		/// <summary>
		///   建構子
		/// </summary>
		/// <param name="name">下單名稱</param>
		/// <param name="action">下單進出場動作列舉</param>
		/// <param name="category">下單類型</param>
		/// <param name="lots">下單合約數量</param>
		/// <param name="openNextBar">是否開倉在下一根 Bars</param>
		/// <param name="exitInfo">平倉設定類別</param>
		public Order(string name, EOrderAction action, OrderCategory category, Contracts lots, bool openNextBar, OrderExit exitInfo) {
			this.Name = name;
			this.Action = action;
			this.Category = category;
			this.Contracts = lots;
			this.OnClose = openNextBar;
			this.OrderExit = exitInfo;
		}
Exemplo n.º 5
0
		/// <summary>
		///   建構子
		/// </summary>
		/// <param name="lots">下單合約數量結構</param>
		/// <param name="name">下單名稱</param>
		/// <param name="action">下單進出場動作</param>
		/// <param name="exitInfo">平倉設定類別</param>
		public SOrderParameters(Contracts lots, string name, EOrderAction action, OrderExit exitInfo) {
			this.Lots = lots;
			this.Name = name;
			this.Action = action;
			this.ExitTypeInfo = exitInfo;
		}
Exemplo n.º 6
0
		/// <summary>
		///   建構子
		/// </summary>
		/// <param name="lots">下單合約數量結構</param>
		/// <param name="action">下單進出場動作</param>
		/// <param name="exitInfo">平倉設定類別</param>
		public SOrderParameters(Contracts lots, EOrderAction action, OrderExit exitInfo)
			: this(lots, string.Empty, action, exitInfo) {
		}
Exemplo n.º 7
0
        protected override void Create()
        {
            // create variable objects, function objects, order objects etc.
            DailyDema  = new Dema(this, 1);
            WeeklyDema = new Dema(this, 2);

            FE         = OrderCreator.Stop(new SOrderParameters(Contracts.UserSpecified, "FE", EOrderAction.Buy));
            SL1        = OrderCreator.Stop(new SOrderParameters(Contracts.UserSpecified, "SL1", EOrderAction.Sell, OrderExit.FromEntry(FE)));
            TralingSL1 = OrderCreator.Stop(new SOrderParameters(Contracts.UserSpecified, "Trail1", EOrderAction.Sell, OrderExit.FromEntry(FE)));

            StrategyPositionStates = new Dictionary <EMarketPositionSide, Action <double, double> >()
            {
                { EMarketPositionSide.Flat, this.EMarketPositionSideFlat },
                { EMarketPositionSide.Long, this.EMarketPositionSideLong },
                { EMarketPositionSide.Short, this.EMarketPositionSideShort }
            };
        }
Exemplo n.º 8
0
 /// <summary>
 ///   建構子
 /// </summary>
 /// <param name="lots">下單合約數量結構</param>
 /// <param name="action">下單進出場動作</param>
 /// <param name="exitInfo">平倉設定類別</param>
 public SOrderParameters(Contracts lots, EOrderAction action, OrderExit exitInfo)
     : this(lots, string.Empty, action, exitInfo)
 {
 }
Exemplo n.º 9
0
 public void Delete(OrderExit entity)
 {
     entity.IsActive = false;
     orderExitRepository.Edit(entity);
 }
Exemplo n.º 10
0
 public void Add(OrderExit entity)
 {
     orderExitRepository.Add(entity);
 }
Exemplo n.º 11
0
        /// <summary>
        ///   從 entry 取得平倉設定類別
        /// </summary>
        /// <param name="entry">IOrderObject 介面</param>
        /// <returns>返回值: OrderExit 類別</returns>
        public static OrderExit FromEntry(IOrderObject entry)
        {
            OrderExit cOrderExit = entry.Info.OrderExit;

            return(new OrderExit(EExitType.FromOne, entry.ID));
        }