コード例 #1
0
ファイル: PortfolioStop.cs プロジェクト: heber/FreeOQ
    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);
    }
コード例 #2
0
ファイル: Stop.cs プロジェクト: heber/FreeOQ
		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);
    }
コード例 #3
0
ファイル: Stop.cs プロジェクト: heber/FreeOQ
    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();
    }
コード例 #4
0
ファイル: PortfolioStop.cs プロジェクト: heber/FreeOQ
    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();
    }
コード例 #5
0
ファイル: MetaStrategyBase.cs プロジェクト: heber/FreeOQ
		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);
		}
コード例 #6
0
ファイル: MetaStrategyBase.cs プロジェクト: heber/FreeOQ
		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);
		}
コード例 #7
0
ファイル: MetaStrategyBase.cs プロジェクト: heber/FreeOQ
		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);
		}
コード例 #8
0
ファイル: MetaMoneyManager.cs プロジェクト: heber/FreeOQ
		public virtual void Withdraw(StrategyBase strategy, double amount, DateTime datetime, FreeQuant.Instruments.Currency currency, string comment)
    {
      strategy.qZcLyn7Uf(amount, currency, datetime, comment);
    }
コード例 #9
0
ファイル: Stop.cs プロジェクト: heber/FreeOQ
    public Stop(StrategyBase strategy, double level, StopType type, StopMode mode)
			:  this(strategy, (Position) null, level, type, mode) {
    }
コード例 #10
0
ファイル: MetaStrategyBase.cs プロジェクト: heber/FreeOQ
		public void Add(StrategyBase strategy)
		{
			if (!this.DesignMode)
				throw new InvalidOperationException();
			this.strategies.Add(strategy);
			strategy.MetaStrategyBase = this;
		}
コード例 #11
0
ファイル: StrategyList.cs プロジェクト: heber/FreeOQ
		internal void Add(StrategyBase strategy)
		{
			if (this.strategies.Contains(strategy.Name))
				throw new ApplicationException(strategy.Name);
			this.strategies.Add(strategy.Name, strategy);
		}
コード例 #12
0
ファイル: Stop.cs プロジェクト: zhuzhenping/FreeOQ
 public Stop(StrategyBase strategy, double level, StopType type, StopMode mode)
     :  this(strategy, (Position)null, level, type, mode)
 {
 }
コード例 #13
0
ファイル: StrategyEventArgs.cs プロジェクト: heber/FreeOQ
		public StrategyEventArgs(StrategyBase strategy) : base()
		{
			this.Strategy = strategy;
		}
コード例 #14
0
ファイル: MetaMoneyManager.cs プロジェクト: heber/FreeOQ
		public virtual void Withdraw(StrategyBase strategy, double amount, FreeQuant.Instruments.Currency currency, string comment)
    {
      this.Withdraw(strategy, amount, Clock.Now, currency, comment);
    }
コード例 #15
0
ファイル: MetaStrategyBase.cs プロジェクト: heber/FreeOQ
		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);
		}
コード例 #16
0
ファイル: MetaStrategyBase.cs プロジェクト: heber/FreeOQ
		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);
		}
コード例 #17
0
ファイル: StrategyList.cs プロジェクト: heber/FreeOQ
		internal void Remove(StrategyBase strategy)
		{
			this.strategies.Remove(strategy.Name);
		}
コード例 #18
0
ファイル: MetaStrategyBase.cs プロジェクト: heber/FreeOQ
		public void Remove(StrategyBase strategy)
		{
			if (!this.DesignMode)
				throw new InvalidOperationException();
			this.strategies.Remove(strategy);
			strategy.MetaStrategyBase = (MetaStrategyBase)null;
		}
コード例 #19
0
 public virtual void Deposit(StrategyBase strategy, double amount, DateTime datetime, FreeQuant.Instruments.Currency currency, string comment)
 {
     strategy.cXaFP441d(amount, currency, datetime, comment);
 }
コード例 #20
0
 public virtual void Withdraw(StrategyBase strategy, double amount, DateTime datetime, FreeQuant.Instruments.Currency currency, string comment)
 {
     strategy.qZcLyn7Uf(amount, currency, datetime, comment);
 }
コード例 #21
0
 public virtual void Withdraw(StrategyBase strategy, double amount, FreeQuant.Instruments.Currency currency, string comment)
 {
     this.Withdraw(strategy, amount, Clock.Now, currency, comment);
 }
コード例 #22
0
 public StrategyEventArgs(StrategyBase strategy) : base()
 {
     this.Strategy = strategy;
 }
コード例 #23
0
ファイル: MetaMoneyManager.cs プロジェクト: heber/FreeOQ
		public virtual void Deposit(StrategyBase strategy, double amount, DateTime datetime, FreeQuant.Instruments.Currency currency, string comment)
    {
      strategy.cXaFP441d(amount, currency, datetime, comment);
    }