예제 #1
0
 internal Portfolio(FreeQuant.Instruments.Portfolio portfolio)
 {
     this.portfolio    = portfolio;
     this.positions    = new PositionList(portfolio.Positions);
     this.transactions = new TransactionList(portfolio.Transactions);
     this.account      = new PortfolioAccount(portfolio.Account);
 }
예제 #2
0
        private static void AddPortfolio(FreeQuant.Instruments.Portfolio sq_portfolio)
        {
            Portfolio portfolio = new Portfolio(sq_portfolio);

            Map.OQ_FQ_Portfolio[portfolio]    = sq_portfolio;
            Map.FQ_OQ_Portfolio[sq_portfolio] = portfolio;
        }
예제 #3
0
파일: Portfolio.cs 프로젝트: heber/FreeOQ
 internal Portfolio(FreeQuant.Instruments.Portfolio portfolio)
 {
   this.portfolio = portfolio;
   this.positions = new PositionList(portfolio.Positions);
   this.transactions = new TransactionList(portfolio.Transactions);
   this.account = new PortfolioAccount(portfolio.Account);
 }
예제 #4
0
		public TrailingStopOrder(IExecutionProvider provider, Portfolio portfolio, Instrument instrument, Side side, double qty, double delta) : base()
		{
			this.OrdType = OrdType.TrailingStop;
			this.Provider = provider;
			this.Portfolio = portfolio;
			this.Instrument = instrument;
			this.Side = side;
			this.OrderQty = qty;
			this.TrailingAmt = delta;
		}
예제 #5
0
파일: MarketOrder.cs 프로젝트: heber/FreeOQ
		public MarketOrder(IExecutionProvider provider, Portfolio portfolio, Instrument instrument, Side side, double qty, string text) : base()
		{
			this.OrdType = OrdType.Market;
			this.Provider = provider;
			this.Portfolio = portfolio;
			this.Instrument = instrument;
			this.Side = side;
			this.OrderQty = qty;
			this.Text = text;
		}
예제 #6
0
 public void Remove(Portfolio portfolio)
 {
     this.ospEgWBc0j(portfolio);
     this.GG5E1xwBnb(portfolio);
     IDbCommand command = this.connection.CreateCommand();
     command.CommandText = "command11";
     FIXDbServer.SetCommandParameter(command, "dd", DbType.Int32, (object)portfolio.Id);
     command.ExecuteNonQuery();
     command.Dispose();
 }
예제 #7
0
		public ConfigurationInfo(string portfolioName, byte marketDataProviderId, byte executionProviderId)
		{
			this.portfolio = PortfolioManager.Portfolios[portfolioName];
			if (this.portfolio == null)
				this.portfolio = new Portfolio(portfolioName);
			this.marketDataProvider = ProviderManager.MarketDataProviders[marketDataProviderId];
			this.executionProvider = ProviderManager.ExecutionProviders[executionProviderId];
			this.marketDataProviderId = this.marketDataProvider == null ? marketDataProviderId : (byte)0;
			this.executionProviderId = this.executionProvider == null ? executionProviderId : (byte)0;
		}
예제 #8
0
		public StopLimitOrder(IExecutionProvider provider, Portfolio portfolio, Instrument instrument, Side side, double qty, double price, double stopPx) : base()
		{
			this.OrdType = OrdType.StopLimit;
			this.Provider = provider;
			this.Portfolio = portfolio;
			this.Instrument = instrument;
			this.Side = side;
			this.OrderQty = qty;
			this.Price = price;
			this.StopPx = stopPx;
		}
예제 #9
0
		internal void Add(Portfolio portfolio)
		{
			if (this.portfolios.Contains(portfolio.Name))
                throw new ApplicationException("Already added: Name={0}" + portfolio.Name);
			this.portfolios.Add(portfolio.Name, portfolio);
			if (portfolio.Id == -1)
				return;
			if (this.portfoliosById.Contains(portfolio.Id))
                throw new ApplicationException("Already added: Id={0}" + portfolio.Id);
			this.portfoliosById.Add(portfolio.Id, portfolio);
		}
예제 #10
0
		public TrailingStopLimitOrder(IExecutionProvider provider, Portfolio portfolio, Instrument instrument, Side side, double qty, double delta, double stopPrice, double limitPrice) : base()
		{
			this.OrdType = OrdType.TrailingStopLimit;
			this.Provider = provider;
			this.Portfolio = portfolio;
			this.Instrument = instrument;
			this.Side = side;
			this.OrderQty = qty;
			this.TrailingAmt = delta;
			this.StopPx = stopPrice;
			this.Price = limitPrice;
		}
예제 #11
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);
    }
예제 #12
0
 public void Save(Portfolio portfolio)
 {
     if (portfolio.Id == -1)
     {
         this.lwxEohW3ad(portfolio);
     }
     else
     {
         this.ospEgWBc0j(portfolio);
         this.GG5E1xwBnb(portfolio);
         this.k2YExH5Ue4(portfolio);
     }
     foreach (Transaction transaction in portfolio.Transactions)
         this.Add(portfolio, transaction);
     foreach (AccountTransaction transaction in portfolio.Account.Transactions)
         this.Add(portfolio, transaction);
 }
예제 #13
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();
    }
예제 #14
0
 internal Statistics(FreeQuant.Instruments.Portfolio portfolio)
 {
     this.portfolio = portfolio;
 }
예제 #15
0
 internal static void Add(Portfolio portfolio)
 {
     PortfolioManager.portfolios.Add(portfolio);
     PortfolioManager.EmitPortfolioAdded(portfolio);
 }
예제 #16
0
 public PortfolioEventArgs(Portfolio portfolio) : base()
 {
     this.Portfolio = portfolio;
 }
예제 #17
0
		protected MetaStrategyBase(string name)
		{
			this.name = name;
			this.strategies = new StrategyList();
			this.SimulationManager = StrategyComponentManager.GetComponent("GetComponent", (object)this) as SimulationManager;
			this.OptimizationManager = StrategyComponentManager.GetComponent("GetComponent", (object)this) as OptimizationManager;
			this.ReportManager = StrategyComponentManager.GetComponent("GetComponent", (object)this) as ReportManager;
			this.MetaMoneyManager = StrategyComponentManager.GetComponent("GetComponent", (object)this) as MetaMoneyManager;
			this.portfolio = PortfolioManager.Portfolios[name];
			if (this.portfolio == null)
				this.portfolio = new Portfolio(name);
			this.resetPortfolio = true;
			this.tester = new LiveTester(this.portfolio);
			this.tester.FollowChanges = true;
			this.optimizer = (Optimizer)new BruteForce((IOptimizable)this);
			this.optimizer.BestObjectiveReceived += new EventHandler(this.OnBestObjectiveReceived);
			this.optimizerType = EOptimizerType.BruteForce;
//      this.wufWtLkISI = new J8EmIiFmOtaja37OfO(this);
//      this.ftRWdJyyOv = new cLHjLO4PpuI7TxofSw(this);
//      this.XY4Ww3QE51 = new TGZcynM7UfxwdxKdmx(this);
//      this.J37WmrcrSi = new FZ0WAbPUwn6OHn5Upr(this);
//      this.zVLWf0C4Mc = new ALxag60bMZlMBTZjqL(this);
			this.wH2We9sYJA = new Dictionary<IProvider, List<StrategyBase>>();
			this.vXRWgwkIPm = new Dictionary<IMarketDataProvider, Dictionary<Instrument, List<StrategyBase>>>();
			this.DKMWNa8OX5 = new Dictionary<SingleOrder, StrategyBase>();
			this.sbiWzb0PxN = new Dictionary<IService, List<StrategyBase>>();
			this.EdxRkK8EdT = new Dictionary<IExecutionService, List<StrategyBase>>();
			this.maxConnectionTime = 10;
			this.simulator = (ProviderManager.MarketDataSimulator as SimulationDataProvider).Simulator;
			this.simulator.StateChanged += new EventHandler(this.md8Wiw2OiW);
			this.isRunning = false;
			this.isOptimizing = false;
			this.optimizationParemeters = new ArrayList();
			this.drawingPrimitives = new Hashtable();
			this.portfolioStopList = new StopList();
			this.portfolios = new Dictionary<Instrument, Portfolio>();
			this.testers = new Dictionary<Instrument, LiveTester>();
			this.executionServicesEnabled = false;
			this.componentTypeList = new List<ComponentType>();
			this.componentTypeList.Add(ComponentType.SimulationManager);
			this.componentTypeList.Add(ComponentType.MetaMoneyManager);
			this.componentTypeList.Add(ComponentType.OptimizationManager);
			this.componentTypeList.Add(ComponentType.ReportManager);
		}
예제 #18
0
 internal void Remove(Portfolio portfolio)
 {
     this.portfolios.Remove(portfolio.Name);
     this.portfoliosById.Remove(portfolio.Id);
 }
예제 #19
0
파일: Portfolio.cs 프로젝트: smther/FreeOQ
 public Portfolio Reconstruct(DateTime dateTime)
 {
     Portfolio portfolio = new Portfolio();
     foreach (Transaction transaction in this.transactions)
     {
         if (transaction.DateTime <= dateTime)
             portfolio.Add(transaction);
     }
     portfolio.Account.Clear();
     foreach (AccountTransaction transaction in this.account.Transactions)
     {
         if (transaction.DateTime <= dateTime)
             portfolio.Account.Add(transaction);
     }
     return portfolio;
 }
예제 #20
0
파일: Portfolio.cs 프로젝트: smther/FreeOQ
 public void ConsolidateFrom(Portfolio[] portfolioList)
 {
     this.ConsolidateFrom(portfolioList, false);
 }
예제 #21
0
 public void Save(Portfolio portfolio)
 {
 }
예제 #22
0
 public void Update(Portfolio portfolio)
 {
 }
예제 #23
0
 public MarginManager1(Portfolio portfolio)
 {
     this.nTCs7Rw8ms = new Hashtable();
     this.portfolio  = portfolio;
     this.Connect();
 }
예제 #24
0
    protected StrategyBase(string name, string description)
    {
      this.metaStrategyBase = (MetaStrategyBase) null;
      this.name = name;
      this.description = description;
      this.isEnabled = true;
      this.isActive = true;
			this.ReportManager = StrategyComponentManager.GetComponent("getcom", (object) this) as ReportManager;
			this.MarketManager = StrategyComponentManager.GetComponent("getcom", (object) this) as MarketManager;
      this.portfolio = PortfolioManager.Portfolios[name];
      if (this.portfolio == null)
        this.portfolio = new Portfolio(name);
      this.tester = new LiveTester(this.portfolio);
      this.stops = new StopList();
      this.triggers = new TriggerList();
      this.marketDataProvider = (IMarketDataProvider) null;
      this.executionProvider = (IExecutionProvider) null;
      this.newsProvider = (INewsProvider) null;
      this.executionService = (IExecutionService) null;
      this.orders = new OrderTable();
      this.global = new Hashtable();
      this.activeInstruments = new InstrumentList();
      this.barSliceManager = new BarSliceManager();
      this.componentTypeList = new List<ComponentType>();
      this.componentTypeList.Add(ComponentType.MarketManager);
      this.componentTypeList.Add(ComponentType.ReportManager);
      this.activeStops = new Dictionary<Instrument, List<StopBase>>();
      this.portfolios = new Dictionary<Instrument, Portfolio>();
      this.testers = new Dictionary<Instrument, LiveTester>();
      this.statisticsPerInstrumentEnabled = false;
    }
예제 #25
0
 internal static void Add(Portfolio portfolio, Transaction transaction)
 {
     PortfolioManager.server.Add(portfolio, transaction);
 }
예제 #26
0
 internal static void vwIs2WhnRQ(Portfolio position, AccountTransaction transaction)
 {
     PortfolioManager.server.Add(position, transaction);
 }
예제 #27
0
 public static void Remove(Portfolio portfolio)
 {
     PortfolioManager.server.Remove(portfolio);
     PortfolioManager.portfolios.Remove(portfolio);
     PortfolioManager.EmitPortfolioRemoved(portfolio);
 }
예제 #28
0
파일: StopOrder.cs 프로젝트: heber/FreeOQ
		public StopOrder(IExecutionProvider provider, Portfolio portfolio, Instrument instrument, Side side, double qty, double stopPx)
			: this(provider, portfolio, instrument, side, qty, stopPx, null)
		{
		}
예제 #29
0
 public void Add(Portfolio portfolio, Transaction transaction)
 {
 }
예제 #30
0
		public PortfolioStatistics(Portfolio portfolio)
		{
			this.portfolio = portfolio;
		}
예제 #31
0
파일: Performance.cs 프로젝트: heber/FreeOQ
 public Performance(Portfolio portfolio)
 {
     this.enabled = true;
     this.equitySeries = new DoubleSeries("Equity");
     this.coreEquitySeries = new DoubleSeries("CoreEquity");
     this.pnlSeries = new DoubleSeries("PnL");
     this.drawdownSeries = new DoubleSeries("Drawdown");
     this.drawdownPercentSeries = new DoubleSeries("DrawdownPercent");
     this.InjBy1lkoo = double.NaN;
     this.MrYBqYV87G = double.NaN;
     this.portfolio = portfolio;
     this.CalculatePnL = true;
     this.CalculateDrawdown = true;
     this.portfolio.ValueChanged += new PositionEventHandler(this.RLrBXT2waX);
 }
예제 #32
0
파일: Portfolio.cs 프로젝트: smther/FreeOQ
 public Portfolio Consolidate(Portfolio portfolio)
 {
     TransactionList transactionList = new TransactionList();
     foreach (Transaction transaction in this.Transactions)
         transactionList.Add(transaction, false);
     foreach (Transaction transaction in portfolio.Transactions)
         transactionList.Add(transaction, false);
     transactionList.Sort();
     Portfolio portfolio1 = new Portfolio();
     foreach (Transaction transaction in transactionList)
         portfolio1.Add(transaction);
     portfolio1.Account.Clear();
     AccountTransactionList accountTransactionList = new AccountTransactionList();
     foreach (AccountTransaction transaction in this.Account.Transactions)
         accountTransactionList.Add(transaction);
     foreach (AccountTransaction transaction in portfolio.Account.Transactions)
         accountTransactionList.Add(transaction);
     foreach (AccountTransaction transaction in accountTransactionList)
         portfolio1.Account.Add(transaction);
     return portfolio1;
 }
예제 #33
0
 internal static void Update(Portfolio portfolio)
 {
     PortfolioManager.server.Update(portfolio);
 }
예제 #34
0
파일: Portfolio.cs 프로젝트: smther/FreeOQ
        public void ConsolidateFrom(Portfolio[] portfolioList, bool cloneTransactions)
        {
            if (this.ConsolidationStarted != null)
                this.ConsolidationStarted(this, EventArgs.Empty);

            this.Mk5dJuOhmC = true;
            this.Clear(false);
            List<Portfolio> list1 = new List<Portfolio>();
            List<int> list2 = new List<int>();
            foreach (Portfolio portfolio in portfolioList)
            {
                if (portfolio.Transactions.Count > 0)
                {
                    list1.Add(portfolio);
                    list2.Add(0);
                }
            }
            while (list1.Count > 0)
            {
                DateTime dateTime1 = DateTime.MaxValue;
                int index1 = -1;
                for (int index2 = 0; index2 < list1.Count; ++index2)
                {
                    DateTime dateTime2 = list1[index2].Transactions[list2[index2]].DateTime;
                    if (dateTime2 < dateTime1)
                    {
                        dateTime1 = dateTime2;
                        index1 = index2;
                    }
                }
                Transaction transaction = cloneTransactions ? (Transaction)list1[index1].Transactions[list2[index1]].Clone() : list1[index1].Transactions[list2[index1]];
                this.Add(transaction);
                this.account.Add(transaction.CashFlow, transaction.Currency, transaction.DateTime, transaction.Text);
                List<int> list3;
                int index3;
                (list3 = list2)[index3 = index1] = list3[index3] + 1;
                if (list2[index1] == list1[index1].Transactions.Count)
                {
                    list2.RemoveAt(index1);
                    list1.RemoveAt(index1);
                }
            }
            this.Mk5dJuOhmC = false;
            if (this.ConsolidationFinished != null)
                this.ConsolidationFinished(this, EventArgs.Empty);
        }
예제 #35
0
		public PortfolioEventArgs(Portfolio portfolio) : base()
		{
			this.Portfolio = portfolio;
		}
예제 #36
0
		public void Start(bool doStep)
		{
			DataManager.ClearDataArrays();
			this.drawingPrimitives.Clear();
			this.wH2We9sYJA.Clear();
			this.vXRWgwkIPm.Clear();
			this.DKMWNa8OX5.Clear();
//      this.wufWtLkISI.EHNjIxPXeI();
//      this.ftRWdJyyOv.CRrjLvZRte();
//      this.XY4Ww3QE51.WlPpnQStx6();
			this.sbiWzb0PxN.Clear();
			this.EdxRkK8EdT.Clear();
//      this.J37WmrcrSi.PICjBUA7Ya();
//      this.zVLWf0C4Mc.G7CjuFqKCk();
			if (this.metaStrategyMode == MetaStrategyMode.Simulation)
			{
				this.simulationManager.Requests.Clear();
				this.simulationManager.Init();
				Clock.ClockMode = ClockMode.Simulation;
				Clock.SetDateTime(this.simulationManager.EntryDate);
				foreach (string request in (CollectionBase) this.simulationManager.StaticRequests)
					this.simulationManager.SendMarketDataRequest(request);
				this.simulator.Intervals.Clear();
				this.simulator.Intervals.Add(this.simulationManager.EntryDate, this.simulationManager.ExitDate);
				this.simulator.SimulationMode = this.simulationManager.Mode;
				this.simulator.SpeedMultiplier = this.simulationManager.SpeedMultiplier;
				this.simulator.Step = this.simulationManager.Step;
				OrderManager.RemoveOrders(11104, (object)MetaStrategyBase.FIX_MODES[this.metaStrategyMode]);
				OrderManager.OCA.Clear();
				OrderManager.SellSide.RemoveOrders(11104, (object)MetaStrategyBase.FIX_MODES[this.metaStrategyMode]);
			}
			if (this.metaStrategyMode == MetaStrategyMode.Simulation || this.metaStrategyMode == MetaStrategyMode.Live && this.resetPortfolio)
			{
				this.portfolio.Clear();
				this.portfolios.Clear();
				this.testers.Clear();
				this.tester.FriendlyTesters.Clear();
			}
			this.tester.Disconnect();
			this.tester.Connect();
			this.tester.Reset();
			bool flag = this.portfolio.Account.Transactions.Count == 0;
			if (flag)
				this.portfolio.Account.Deposit(this.simulationManager.Cash, this.simulationManager.Currency, Clock.Now, "");
			this.portfolio.TransactionAdded += new TransactionEventHandler(this.zYSWMuDaZ6);
			this.portfolio.PositionOpened += new PositionEventHandler(this.DBwWbS3fHQ);
			this.portfolio.PositionChanged += new PositionEventHandler(this.dHgWygCawL);
			this.portfolio.PositionClosed += new PositionEventHandler(this.fBgWGZmneO);
			this.portfolio.ValueChanged += new PositionEventHandler(this.lrZWS42MFZ);
			this.portfolio.Monitored = true;
			this.optimizationManager.Init();
			if (!this.isOptimizing)
			{
				this.reportManager.Tester = this.tester;
				this.reportManager.Init();
			}
			this.metaMoneyManager.Init();
			this.OnInit();
			foreach (StrategyBase strategyBase in this.strategies)
			{
				if (strategyBase.IsEnabled)
					strategyBase.ztfTe4jp4();
			}
			if (flag)
				this.OnMoneyAllocation();
			if (this.statisticsPerInstrumentEnabled)
			{
				foreach (LiveTester liveTester in this.testers.Values)
				{
					liveTester.Connect();
					liveTester.Reset();
				}
				foreach (StrategyBase strategyBase in this.strategies)
				{
					if (strategyBase.IsEnabled)
					{
						foreach (Instrument key in (FIXGroupList) strategyBase.MarketManager.Instruments)
						{
							if (!this.portfolios.ContainsKey(key))
							{
								Portfolio portfolio = new Portfolio();
								portfolio.Name = string.Format("dfds", (object)this.name, (object)key.Symbol);
								LiveTester liveTester = new LiveTester(portfolio);
								liveTester.FollowChanges = true;
								this.portfolios.Add(key, portfolio);
								this.testers.Add(key, liveTester);
								this.tester.FriendlyTesters.Add(key, liveTester);
								portfolio.Account.Deposit(this.portfolio.GetAccountValue(), this.portfolio.Account.Currency, Clock.Now, "fdsdfs");
							}
						}
					}
				}
			}
			foreach (StrategyBase strategyBase in this.strategies)
			{
				if (strategyBase.IsEnabled)
				{
					switch (this.metaStrategyMode)
					{
						case MetaStrategyMode.Simulation:
//              this.XY4Ww3QE51.opTpuIsCq8(ProviderManager.ExecutionSimulator);
//              this.wufWtLkISI.q4hj9rUKgj((IProvider) ProviderManager.MarketDataSimulator);
//              this.wufWtLkISI.q4hj9rUKgj((IProvider) ProviderManager.ExecutionSimulator);
							this.fkKW08cp5Q((IProvider)ProviderManager.MarketDataSimulator, strategyBase);
							this.fkKW08cp5Q((IProvider)ProviderManager.ExecutionSimulator, strategyBase);
							break;
						case MetaStrategyMode.Live:
							using (Dictionary<Instrument, IExecutionProvider>.ValueCollection.Enumerator enumerator = strategyBase.MarketManager.UyiAAd6ITD.Values.GetEnumerator())
							{
								while (enumerator.MoveNext())
								{
									IExecutionProvider current = enumerator.Current;
									this.fkKW08cp5Q((IProvider)current, strategyBase);
//                  this.XY4Ww3QE51.opTpuIsCq8(current);
//                  this.wufWtLkISI.q4hj9rUKgj((IProvider) current);
								}
								break;
							}
					}
					foreach (KeyValuePair<Instrument, IMarketDataProvider> keyValuePair in strategyBase.MarketManager.jcIApP7GcT)
					{
						Instrument key = keyValuePair.Key;
						switch (this.metaStrategyMode)
						{
							case MetaStrategyMode.Simulation:
								foreach (string str in (CollectionBase) this.simulationManager.Requests)
//                  this.ftRWdJyyOv.s8pj3BZbXy(ProviderManager.MarketDataSimulator, key, str);
                this.gKXWX8nbQ1(ProviderManager.MarketDataSimulator, key, strategyBase);
								continue;
							case MetaStrategyMode.Live:
								IMarketDataProvider marketDataProvider = keyValuePair.Value;
//                this.ftRWdJyyOv.s8pj3BZbXy(marketDataProvider, key, (string) null);
//                this.wufWtLkISI.q4hj9rUKgj((IProvider) marketDataProvider);
								this.fkKW08cp5Q((IProvider)marketDataProvider, strategyBase);
								this.gKXWX8nbQ1(marketDataProvider, key, strategyBase);
								continue;
							default:
								continue;
						}
					}
				}
			}
//      this.wufWtLkISI.qGIjh9udFb(this.a0bRpgOve7 * 1000);
//      this.ftRWdJyyOv.ONMjs3DrA4();
//      this.XY4Ww3QE51.W2BpYr8f5G();
			if (this.executionServicesEnabled)
			{
				foreach (StrategyBase strategyBase in this.strategies)
				{
					switch (this.metaStrategyMode)
					{
						case MetaStrategyMode.Simulation:
							this.FYDWx9TtsR(ServiceManager.ExecutionSimulator, strategyBase);
							continue;
						case MetaStrategyMode.Live:
							if (strategyBase.ExecutionService != null)
							{
								this.FYDWx9TtsR((IService)strategyBase.ExecutionService, strategyBase);
								continue;
							}
							else
								continue;
						default:
							continue;
					}
				}
//        this.J37WmrcrSi.D3Cjbhc7hR();
//        this.zVLWf0C4Mc.alJjoPx37X();
			}
			this.isRunning = true;
			switch (this.metaStrategyMode)
			{
				case MetaStrategyMode.Simulation:
					if (doStep)
					{
						this.simulator.DoStep(false);
						while (this.isRunning)
							Thread.Sleep(1);
						break;
					}
					else
					{
						this.simulator.Start(true);
						break;
					}
				case MetaStrategyMode.Live:
					this.Y5hW7EWwMM();
					while (this.isRunning)
						Thread.Sleep(1);
					break;
			}
		}
예제 #37
0
 internal static void Save(Portfolio portfolio)
 {
     PortfolioManager.server.Save(portfolio);
 }
예제 #38
0
 public void Save(Portfolio portfolio)
 {
 }
예제 #39
0
 internal static void Clear(Portfolio portfolio)
 {
     PortfolioManager.server.Clear(portfolio);
 }
예제 #40
0
    internal void ztfTe4jp4()
    {
      this.isActive = true;
      this.global.Clear();
      this.stops.Clear();
      this.activeStops.Clear();
//      if (this.JEmpWIimOt != null)
//        this.JEmpWIimOt((object) this, EventArgs.Empty);
      this.triggers.Clear();
//      if (this.DGvp78okLv != null)
//        this.DGvp78okLv((object) this, EventArgs.Empty);
      this.activeInstruments.Clear();
      if (this.metaStrategyBase.MetaStrategyMode == MetaStrategyMode.Simulation || this.metaStrategyBase.MetaStrategyMode == MetaStrategyMode.Live && this.metaStrategyBase.ResetPortfolio)
      {
        this.portfolio.Clear();
        this.portfolios.Clear();
        this.testers.Clear();
        this.tester.FriendlyTesters.Clear();
      }
      this.portfolio.TransactionAdded += new TransactionEventHandler(this.wFewIKaO9);
      this.portfolio.PositionOpened += new PositionEventHandler(this.tqpmkcdnl);
      this.portfolio.PositionChanged += new PositionEventHandler(this.qmsfx90ud);
      this.portfolio.PositionClosed += new PositionEventHandler(this.iIIeZBW7d);
      this.portfolio.ValueChanged += new PositionEventHandler(this.zqRghd2Zu);
      this.portfolio.Monitored = true;
      this.orders.Clear();
      this.marketManager.Instruments.Clear();
      this.marketManager.jcIApP7GcT.Clear();
      if (this.metaStrategyBase.MetaStrategyMode == MetaStrategyMode.Live)
      {
        this.marketManager.OM26eKMfqS = this.marketDataProvider;
        this.marketManager.TOY6zSGlVT = this.executionProvider;
      }
      this.marketManager.Init();
      this.tester.Disconnect();
      this.tester.Connect();
      this.tester.Reset();
      if (this.statisticsPerInstrumentEnabled)
      {
        foreach (LiveTester liveTester in this.testers.Values)
        {
          liveTester.Connect();
          liveTester.Reset();
        }
      }
      foreach (Instrument key in (FIXGroupList) this.marketManager.Instruments)
      {
        key.Reset();
        BarSeries barSeries = this.Bars[key];
        this.activeStops[key] = new List<StopBase>();
        if (this.statisticsPerInstrumentEnabled && !this.portfolios.ContainsKey(key))
        {
          Portfolio portfolio = new Portfolio();
					portfolio.Name = string.Format("dfs", (object) this.name, (object) key.Symbol);
          if (this.metaStrategyBase.MetaStrategyMode == MetaStrategyMode.Live && !this.metaStrategyBase.ResetPortfolio)
						portfolio.Account.Deposit(this.portfolio.GetAccountValue(), this.portfolio.Account.Currency, Clock.Now,"");
          LiveTester liveTester = new LiveTester(portfolio);
          liveTester.FollowChanges = true;
          this.portfolios.Add(key, portfolio);
          this.testers.Add(key, liveTester);
          this.tester.FriendlyTesters.Add(key, liveTester);
        }
      }
      this.barSliceManager.InstrumentsCount = this.marketManager.Instruments.Count;
      this.barSliceManager.Clear();
      this.OnInit();
      this.reportManager.Tester = this.tester;
      if (this.MetaStrategyBase.dBEWaCEkLk)
        return;
      this.reportManager.Init();
    }
예제 #41
0
 public void Remove(Portfolio portfolio)
 {
 }
예제 #42
0
 public void Remove(Portfolio portfolio)
 {
 }
예제 #43
0
 public void Update(Portfolio portfolio)
 {
 }
예제 #44
0
 public void Clear(Portfolio portfolio)
 {
 }
예제 #45
0
 public void Clear(Portfolio portfolio)
 {
 }
예제 #46
0
 public void Add(Portfolio portfolio, AccountTransaction transaction)
 {
 }
예제 #47
0
 public void Add(Portfolio portfolio, Transaction transaction)
 {
 }
예제 #48
0
파일: LimitOrder.cs 프로젝트: heber/FreeOQ
		public LimitOrder(IExecutionProvider provider, Portfolio portfolio, Instrument instrument, Side side, double qty, double price)
			: this(provider, portfolio, instrument, side, qty, price, null)
		{
		}
예제 #49
0
 public void Add(Portfolio portfolio, AccountTransaction transaction)
 {
 }