Lean  $LEAN_TAG$
NullShortableProvider.cs
1 /*
2  * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
3  * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14 */
15 
16 using System;
18 
20 {
21  /// <summary>
22  /// Defines the default shortable provider in the case that no local data exists.
23  /// This will allow for all assets to be infinitely shortable, with no restrictions.
24  /// </summary>
26  {
27  /// <summary>
28  /// The null shortable provider instance
29  /// </summary>
30  public static NullShortableProvider Instance { get; } = new ();
31 
32  /// <summary>
33  /// Gets interest rate charged on borrowed shares for a given asset.
34  /// </summary>
35  /// <param name="symbol">Symbol to lookup fee rate</param>
36  /// <param name="localTime">Time of the algorithm</param>
37  /// <returns>zero indicating that it is does have borrowing costs</returns>
38  public decimal FeeRate(Symbol symbol, DateTime localTime)
39  {
40  return 0m;
41  }
42 
43  /// <summary>
44  /// Gets the Fed funds or other currency-relevant benchmark rate minus the interest rate charged on borrowed shares for a given asset.
45  /// E.g.: Interest rate - borrow fee rate = borrow rebate rate: 5.32% - 0.25% = 5.07%.
46  /// </summary>
47  /// <param name="symbol">Symbol to lookup rebate rate</param>
48  /// <param name="localTime">Time of the algorithm</param>
49  /// <returns>zero indicating that it is does have borrowing costs</returns>
50  public decimal RebateRate(Symbol symbol, DateTime localTime)
51  {
52  return 0m;
53  }
54 
55  /// <summary>
56  /// Gets the quantity shortable for the Symbol at the given time.
57  /// </summary>
58  /// <param name="symbol">Symbol to check</param>
59  /// <param name="localTime">Local time of the algorithm</param>
60  /// <returns>null, indicating that it is infinitely shortable</returns>
61  public long? ShortableQuantity(Symbol symbol, DateTime localTime)
62  {
63  return null;
64  }
65  }
66 }