Пример #1
0
		public zo21q6cy3fImtUHATQ(SimulationExecutionProvider obj0, FIXNewOrderSingle obj1)
		{
			this.smCF4MYTNu = new Quote();
			this.j57Fjc16NJ = 1E-08;

			this.A8bFJItyyx = obj0;
			this.PYBF7sahqY = obj1;
			this.kUyFaL3cQu = obj0.FillOnBarMode;
			this.L27FNaAWTp = obj0.FillAtLimitPrice;
			this.yFOFUpVbqt = obj0.FillAtStopPrice;
			if (obj1.TradeVolumeDelay == 0)
				this.gxTF8gufMx = true;
			if ((this.PYBF7sahqY as SingleOrder).OrdType == OrdType.TrailingStop || (this.PYBF7sahqY as SingleOrder).OrdType == OrdType.TrailingStopLimit)
			{
				switch ((this.PYBF7sahqY as SingleOrder).Side)
				{
					case Side.Buy:
					case Side.BuyMinus:
						this.zGRFvN99ge = double.MaxValue;
						break;
					case Side.Sell:
					case Side.SellShort:
						this.zGRFvN99ge = double.MinValue;
						break;
					default:
						throw new NotSupportedException("" + obj1.Side.ToString());
				}
			}
			this.A8bFJItyyx.MyIPdEI7fi.Add(this.PYBF7sahqY.ClOrdID, this);
			this.dGEFgdOydF();
		}
Пример #2
0
		public virtual SingleOrder LongEntry(Instrument instrument, FillOnBarMode mode, string text)
		{
			if (!this.Strategy.IsInstrumentActive(instrument))
				return (SingleOrder)null;
			return this.Strategy.BgvpSPpUAD(new Signal(Clock.Now, ComponentType.CrossEntry, SignalType.Market, SignalSide.Buy, instrument, text)
			{
				Fuwj5CvMiW = true,
				R2djQy947W = mode
			});
		}
Пример #3
0
 public virtual SingleOrder LongExit(Instrument instrument, FillOnBarMode mode)
 {
     return(this.LongExit(instrument, mode, "LongExit " + base.Strategy.Name));
 }
Пример #4
0
		public virtual SingleOrder LongEntry(FillOnBarMode mode, string text)
		{
			return this.LongEntry(this.instrument, mode, text);
		}
Пример #5
0
 public virtual SingleOrder SellShort(Instrument instrument, FillOnBarMode mode)
 {
   return this.Sell(instrument, mode, this.Strategy.Name);
 }
Пример #6
0
 public virtual SingleOrder Buy(FillOnBarMode mode)
 {
   return this.Buy(this.instrument, mode);
 }
Пример #7
0
 public virtual void ShortExit(FillOnBarMode mode)
 {
   this.ShortExit(this.instrument, mode);
 }
Пример #8
0
 public virtual SingleOrder LongExit(FillOnBarMode mode)
 {
   return this.LongExit(this.instrument, mode);
 }
Пример #9
0
 public virtual SingleOrder ShortEntry(FillOnBarMode mode)
 {
     return(this.ShortEntry(this.instrument, mode));
 }
Пример #10
0
 public virtual SingleOrder LongEntry(FillOnBarMode mode, string text)
 {
     return(this.LongEntry(this.instrument, mode, text));
 }
Пример #11
0
 public virtual SingleOrder LongEntry(Instrument instrument, FillOnBarMode mode)
 {
     return(this.LongEntry(instrument, mode, this.Strategy.Name));
 }
Пример #12
0
 public virtual void ShortExit(FillOnBarMode mode)
 {
     this.ShortExit(this.instrument, mode);
 }
Пример #13
0
 public virtual SingleOrder ShortExit(FillOnBarMode mode, string text)
 {
     return(this.ShortExit(this.instrument, mode, text));
 }
Пример #14
0
 public virtual SingleOrder LongExit(FillOnBarMode mode)
 {
     return(this.LongExit(this.instrument, mode));
 }
Пример #15
0
		public virtual SingleOrder ShortEntry(FillOnBarMode mode)
		{
			return this.ShortEntry(this.instrument, mode);
		}
Пример #16
0
		private void dGEFgdOydF()
		{
			if (!(this.PYBF7sahqY is SingleOrder))
				return;
			SingleOrder singleOrder = this.PYBF7sahqY as SingleOrder;
			if (singleOrder.ContainsField(11201))
				this.kUyFaL3cQu = (FillOnBarMode) singleOrder.FillOnBarMode;
			Instrument instrument = singleOrder.Instrument;
			bool flag = !singleOrder.IsStopLimitReady && (singleOrder.OrdType == OrdType.TrailingStop || singleOrder.OrdType == OrdType.TrailingStopLimit || singleOrder.OrdType == OrdType.StopLimit);
			if (singleOrder.OrdType == OrdType.Market)
			{
				if ((this.A8bFJItyyx.FillOnQuote && !flag || this.A8bFJItyyx.TriggerOnQuote && flag) && this.A8bFJItyyx.FillOnQuoteMode == FillOnQuoteMode.LastQuote)
					this.Y18FFPmDy5(instrument.Quote, (Trade) null, (Bar) null);
				if ((this.A8bFJItyyx.FillOnTrade && !flag || this.A8bFJItyyx.TriggerOnTrade && flag) && this.A8bFJItyyx.FillOnTradeMode == FillOnTradeMode.LastTrade)
					this.Y18FFPmDy5((Quote) null, instrument.Trade, (Bar) null);
				if ((this.A8bFJItyyx.FillOnBar && !flag || this.A8bFJItyyx.TriggerOnBar && flag) && ((this.kUyFaL3cQu == FillOnBarMode.LastBarClose || singleOrder.ForceMarketOrder) && this.A8bFJItyyx.BarFilter.Contains(instrument.Bar.BarType, instrument.Bar.Size)))
					this.Y18FFPmDy5((Quote) null, (Trade) null, instrument.Bar);
			}
			else
			{
				if (instrument.Quote != null && (this.A8bFJItyyx.FillOnQuote && !flag || this.A8bFJItyyx.TriggerOnQuote && flag) && this.A8bFJItyyx.FillOnQuoteMode == FillOnQuoteMode.LastQuote)
					this.Y18FFPmDy5(instrument.Quote, (Trade) null, (Bar) null);
				if (instrument.Trade != null && (this.A8bFJItyyx.FillOnTrade && !flag || this.A8bFJItyyx.TriggerOnTrade && flag) && this.A8bFJItyyx.FillOnTradeMode == FillOnTradeMode.LastTrade)
					this.Y18FFPmDy5((Quote) null, instrument.Trade, (Bar) null);
				if (instrument.Bar != null && (this.A8bFJItyyx.FillOnBar && !flag || this.A8bFJItyyx.TriggerOnBar && flag) && (this.A8bFJItyyx.BarFilter.Contains(instrument.Bar.BarType, instrument.Bar.Size) && this.A8bFJItyyx.FillOnBarMode == FillOnBarMode.LastBarClose))
				{
					double close = instrument.Bar.Close;
					if (close != 0.0)
						this.wYBFLwFB4S(close, singleOrder.OrderQty);
				}
			}
			if (this.aXtFGP76FH)
				return;
			if (this.A8bFJItyyx.FillOnQuote || this.A8bFJItyyx.TriggerOnQuote)
				instrument.NewQuote += new QuoteEventHandler(this.PyJFklA8yp);
			if (this.A8bFJItyyx.FillOnTrade || this.A8bFJItyyx.TriggerOnTrade)
				instrument.NewTrade += new TradeEventHandler(this.YGKFrq1UXP);
			this.smCF4MYTNu = instrument.Quote;
			if (this.A8bFJItyyx.FillOnBar || this.A8bFJItyyx.TriggerOnBar)
			{
				if (singleOrder.ForceMarketOrder)
				{
					instrument.NewBar += new BarEventHandler(this.YgkFRBfPV0);
					instrument.NewBarOpen += new BarEventHandler(this.OyPFEsHGL2);
				}
				else if (singleOrder.OrdType == OrdType.Market)
				{
					switch (this.kUyFaL3cQu)
					{
						case FillOnBarMode.LastBarClose:
						case FillOnBarMode.NextBarClose:
							instrument.NewBar += new BarEventHandler(this.YgkFRBfPV0);
							break;
						case FillOnBarMode.NextBarOpen:
							instrument.NewBarOpen += new BarEventHandler(this.OyPFEsHGL2);
							break;
					}
				}
				else
				{
					instrument.NewBar += new BarEventHandler(this.YgkFRBfPV0);
					instrument.NewBarOpen += new BarEventHandler(this.OyPFEsHGL2);
				}
			}
			if ((int) this.PYBF7sahqY.TimeInForce != 54)
				return;
			Clock.AddReminder(new ReminderEventHandler(this.xT1FyAqCPT), this.PYBF7sahqY.ExpireTime, (object) null);
		}
Пример #17
0
 public virtual SingleOrder Buy(FillOnBarMode mode)
 {
     return(this.Buy(this.instrument, mode));
 }
Пример #18
0
 public virtual SingleOrder Sell(string text, FillOnBarMode mode)
 {
     return(this.Sell(this.instrument, mode, text));
 }
Пример #19
0
 public virtual SingleOrder ShortExit(FillOnBarMode mode, string text)
 {
   return this.ShortExit(this.instrument, mode, text);
 }
Пример #20
0
 public virtual SingleOrder SellShort(FillOnBarMode mode)
 {
     return(this.SellShort(this.instrument, mode));
 }
Пример #21
0
 public virtual SingleOrder Buy(Instrument instrument, FillOnBarMode mode)
 {
   return this.Buy(instrument, mode, this.Strategy.Name);
 }
 public virtual SingleOrder Buy(Instrument instrument, FillOnBarMode mode)
 {
     return(this.Buy(instrument, mode, "Buy " + this.Strategy.Name));
 }
Пример #23
0
 public virtual SingleOrder Sell(string text, FillOnBarMode mode)
 {
   return this.Sell(this.instrument, mode, text);
 }
 public virtual SingleOrder SellShort(Instrument instrument, FillOnBarMode mode)
 {
     return(this.Sell(instrument, mode, this.Strategy.Name));
 }
Пример #25
0
 public virtual SingleOrder SellShort(FillOnBarMode mode)
 {
   return this.SellShort(this.instrument, mode);
 }
Пример #26
0
 public virtual SingleOrder ShortEntry(Instrument instrument, FillOnBarMode mode)
 {
     return(this.ShortEntry(instrument, mode, "ShortEntry " + base.Strategy.Name));
 }