Beispiel #1
0
    public PortfolioStop(StrategyBase strategy, DateTime time, bool stopStrategy)
			:base(){
      this.dUqRtBdT71 = StopType.Trailing;
      this.Wa9RdDJEOa = StopMode.Percent;
      this.rfci6isjj5 = StopFillMode.Stop;
      this.sKmRoRmeN5 = strategy;
      this.ElNRan0isi = strategy.Portfolio;
      this.RUQiAxBBaC = stopStrategy;
      this.dUqRtBdT71 = StopType.Time;
      this.XoERmcoQ62 = Clock.Now;
      this.xTNRf1TvWo = time;
      this.FuNRz16ilo = this.ElNRan0isi.GetValue();
      if (!(this.xTNRf1TvWo > this.XoERmcoQ62))
        return;
      Clock.AddReminder(new ReminderEventHandler(this.AaPRYK2epA), this.xTNRf1TvWo, (object) null);
    }
Beispiel #2
0
		public Stop(StrategyBase strategy, Position position, DateTime time):base()
    {
      this.Udd6EeE9v6 = strategy;
      this.fPosition = position;
      this.fInstrument = position.Instrument;
      this.fQty = position.Qty;
      this.fSide = position.Side;
      this.fType = StopType.Time;
      this.fCreationTime = Clock.Now;
      this.fCompletionTime = time;
      this.fStopPrice = this.fInstrument.Price();
      if (!(this.fCompletionTime > this.fCreationTime))
        return;
      Clock.AddReminder(new ReminderEventHandler(this.mSa6vRBe3Z), this.fCompletionTime, (object) null);
      this.Udd6EeE9v6.AddStop((StopBase) this);
    }
Beispiel #3
0
    public Stop(StrategyBase strategy, Position position, double level, StopType type, StopMode mode)
			:base()
		{
      this.Udd6EeE9v6 = strategy;
      this.fPosition = position;
      this.fInstrument = position.Instrument;
      this.fQty = position.Qty;
      this.fSide = position.Side;
      this.fLevel = level;
      this.fType = type;
      this.fMode = mode;
      this.fCurrPrice = this.fInstrument.Price();
      this.fTrailPrice = this.fCurrPrice;
      this.fStopPrice = this.SlN6PMZ5Ct();
      this.fCreationTime = Clock.Now;
      this.fCompletionTime = DateTime.MinValue;
      this.Udd6EeE9v6.AddStop((StopBase) this);
      this.t276DXCuDr();
    }
Beispiel #4
0
    public PortfolioStop(StrategyBase strategy, double level, StopType type, StopMode mode, bool stopStrategy)
			:base(){
      this.dUqRtBdT71 = StopType.Trailing;
      this.Wa9RdDJEOa = StopMode.Percent;
      this.rfci6isjj5 = StopFillMode.Stop;
      this.sKmRoRmeN5 = strategy;
      this.ElNRan0isi = strategy.Portfolio;
      this.QqtReC8Evy = level;
      this.dUqRtBdT71 = type;
      this.Wa9RdDJEOa = mode;
      this.RUQiAxBBaC = stopStrategy;
      this.oURRNWOggg = this.ElNRan0isi.GetValue();
      this.uLLipPWdua = this.oURRNWOggg;
      this.FuNRz16ilo = this.aIZRlrvLwJ();
      this.XoERmcoQ62 = Clock.Now;
      this.xTNRf1TvWo = DateTime.MinValue;
      this.i7uRq8Sj1g();
      this.agAikbNDtv = this.oURRNWOggg;
      this.uLLipPWdua = this.oURRNWOggg;
      this.QJSRn03JW5();
    }
Beispiel #5
0
		private void FYDWx9TtsR(IService obj0, StrategyBase obj1)
		{
			List<StrategyBase> list;
			if (!this.sbiWzb0PxN.TryGetValue(obj0, out list))
			{
				list = new List<StrategyBase>();
				this.sbiWzb0PxN.Add(obj0, list);
			}
			if (!list.Contains(obj1))
				list.Add(obj1);
//      this.J37WmrcrSi.DgojM4ZghC(obj0);
			if (!(obj0 is IExecutionService))
				return;
			IExecutionService key = obj0 as IExecutionService;
			if (!this.EdxRkK8EdT.TryGetValue(key, out list))
			{
				list = new List<StrategyBase>();
				this.EdxRkK8EdT.Add(key, list);
			}
			if (!list.Contains(obj1))
				list.Add(obj1);
//      this.zVLWf0C4Mc.J12jYHwSJS(key);
		}
Beispiel #6
0
		private void fkKW08cp5Q(IProvider obj0, StrategyBase obj1)
		{
			List<StrategyBase> list = (List<StrategyBase>)null;
			if (!this.wH2We9sYJA.TryGetValue(obj0, out list))
			{
				list = new List<StrategyBase>();
				this.wH2We9sYJA.Add(obj0, list);
			}
			if (list.Contains(obj1))
				return;
			list.Add(obj1);
		}
Beispiel #7
0
		private void gKXWX8nbQ1(IMarketDataProvider obj0, Instrument obj1, StrategyBase obj2)
		{
			Dictionary<Instrument, List<StrategyBase>> dictionary = (Dictionary<Instrument, List<StrategyBase>>)null;
			if (!this.vXRWgwkIPm.TryGetValue(obj0, out dictionary))
			{
				dictionary = new Dictionary<Instrument, List<StrategyBase>>();
				this.vXRWgwkIPm.Add(obj0, dictionary);
			}
			List<StrategyBase> list = (List<StrategyBase>)null;
			if (!dictionary.TryGetValue(obj1, out list))
			{
				list = new List<StrategyBase>();
				dictionary.Add(obj1, list);
			}
			if (list.Contains(obj2))
				return;
			list.Add(obj2);
		}
Beispiel #8
0
		public virtual void Withdraw(StrategyBase strategy, double amount, DateTime datetime, FreeQuant.Instruments.Currency currency, string comment)
    {
      strategy.qZcLyn7Uf(amount, currency, datetime, comment);
    }
Beispiel #9
0
    public Stop(StrategyBase strategy, double level, StopType type, StopMode mode)
			:  this(strategy, (Position) null, level, type, mode) {
    }
Beispiel #10
0
		public void Add(StrategyBase strategy)
		{
			if (!this.DesignMode)
				throw new InvalidOperationException();
			this.strategies.Add(strategy);
			strategy.MetaStrategyBase = this;
		}
Beispiel #11
0
		internal void Add(StrategyBase strategy)
		{
			if (this.strategies.Contains(strategy.Name))
				throw new ApplicationException(strategy.Name);
			this.strategies.Add(strategy.Name, strategy);
		}
Beispiel #12
0
 public Stop(StrategyBase strategy, double level, StopType type, StopMode mode)
     :  this(strategy, (Position)null, level, type, mode)
 {
 }
Beispiel #13
0
		public StrategyEventArgs(StrategyBase strategy) : base()
		{
			this.Strategy = strategy;
		}
Beispiel #14
0
		public virtual void Withdraw(StrategyBase strategy, double amount, FreeQuant.Instruments.Currency currency, string comment)
    {
      this.Withdraw(strategy, amount, Clock.Now, currency, comment);
    }
Beispiel #15
0
		internal void cWMWqoTObJ(StrategyBase obj0, SingleOrder obj1)
		{
			obj1.Portfolio = this.portfolio;
			switch (this.metaStrategyMode)
			{
				case MetaStrategyMode.Simulation:
					obj1.Provider = ProviderManager.ExecutionSimulator;
					break;
				case MetaStrategyMode.Live:
					obj1.Provider = obj0.MarketManager.UyiAAd6ITD[obj1.Instrument];
					if (this.saveOrders)
					{
						obj1.Persistent = true;
						break;
					}
					else
						break;
			}
			obj1.StrategyMode = MetaStrategyBase.FIX_MODES[this.metaStrategyMode];
			this.DKMWNa8OX5.Add(obj1, obj0);
		}
Beispiel #16
0
		internal void mhsWZDndbE(StrategyBase obj0, ExecutionReport obj1)
		{
			IExecutionService service = (IExecutionService)null;
			switch (this.metaStrategyMode)
			{
				case MetaStrategyMode.Simulation:
					service = ServiceManager.ExecutionSimulator;
					break;
				case MetaStrategyMode.Live:
					service = obj0.ExecutionService;
					break;
			}
			OrderManager.SellSide.SendExecutionReport(service, obj1);
		}
Beispiel #17
0
		internal void Remove(StrategyBase strategy)
		{
			this.strategies.Remove(strategy.Name);
		}
Beispiel #18
0
		public void Remove(StrategyBase strategy)
		{
			if (!this.DesignMode)
				throw new InvalidOperationException();
			this.strategies.Remove(strategy);
			strategy.MetaStrategyBase = (MetaStrategyBase)null;
		}
Beispiel #19
0
 public virtual void Deposit(StrategyBase strategy, double amount, DateTime datetime, FreeQuant.Instruments.Currency currency, string comment)
 {
     strategy.cXaFP441d(amount, currency, datetime, comment);
 }
Beispiel #20
0
 public virtual void Withdraw(StrategyBase strategy, double amount, DateTime datetime, FreeQuant.Instruments.Currency currency, string comment)
 {
     strategy.qZcLyn7Uf(amount, currency, datetime, comment);
 }
Beispiel #21
0
 public virtual void Withdraw(StrategyBase strategy, double amount, FreeQuant.Instruments.Currency currency, string comment)
 {
     this.Withdraw(strategy, amount, Clock.Now, currency, comment);
 }
Beispiel #22
0
 public StrategyEventArgs(StrategyBase strategy) : base()
 {
     this.Strategy = strategy;
 }
Beispiel #23
0
		public virtual void Deposit(StrategyBase strategy, double amount, DateTime datetime, FreeQuant.Instruments.Currency currency, string comment)
    {
      strategy.cXaFP441d(amount, currency, datetime, comment);
    }