コード例 #1
0
ファイル: QCAlgorithm.cs プロジェクト: marejp/Lean
 /// <summary>
 /// Set the maximum number of assets allowable to ensure good memory usage / avoid linux killing job.
 /// </summary>
 /// <param name="minuteLimit">Maximum number of minute level assets the live mode can support with selected server</param>
 /// <param name="secondLimit">Maximum number of second level assets the live mode can support with selected server</param>
 /// /// <param name="tickLimit">Maximum number of tick level assets the live mode can support with selected server</param>
 /// <param name="ramEstimate">Estimate of the max ram usage possible</param>
 /// <remarks>Sets the live behaviour of the algorithm including the selected server (ram) limits.</remarks>
 public void SetAssetLimits(int minuteLimit = 500, int secondLimit = 100, int tickLimit = 30)
 {
     if (!_locked)
     {
         Securities.SetLimits(minuteLimit, secondLimit, tickLimit);
     }
 }
コード例 #2
0
ファイル: AlgorithmStub.cs プロジェクト: zhangxia85/Lean
 public AlgorithmStub(Resolution resolution = Resolution.Second, List <string> equities = null, List <string> forex = null)
 {
     Securities.SetLimits(1000, 1000, 1000);
     foreach (var symbol in equities ?? new List <string>())
     {
         AddSecurity(SecurityType.Equity, symbol, resolution);
         Securities[symbol].Exchange = new SecurityExchange(SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork));
     }
     foreach (var symbol in forex ?? new List <string>())
     {
         AddSecurity(SecurityType.Forex, symbol, resolution);
         Securities[symbol].Exchange = new SecurityExchange(SecurityExchangeHours.AlwaysOpen(TimeZones.EasternStandard));
     }
 }