Пример #1
0
 /// <summary>
 /// Update market price of this Security
 /// </summary>
 /// <param name="data">Data to pull price from</param>
 protected virtual void UpdateConsumersMarketPrice(BaseData data)
 {
     if (data is OpenInterest || data.Price == 0m)
     {
         return;
     }
     Holdings.UpdateMarketPrice(Price);
     VolatilityModel.Update(this, data);
 }
Пример #2
0
 /// <summary>
 /// Update any security properties based on the latest market data and time
 /// </summary>
 /// <param name="data">New data packet from LEAN</param>
 public void SetMarketPrice(BaseData data)
 {
     //Add new point to cache:
     if (data == null)
     {
         return;
     }
     Cache.AddData(data);
     Holdings.UpdateMarketPrice(Price);
     VolatilityModel.Update(this, data);
 }