Lean
$LEAN_TAG$
CMEStrikePriceScalingFactors.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.Collections.Generic;
17
18
namespace
QuantConnect.Securities.FutureOption
19
{
20
/// <summary>
21
/// Provides a means to get the scaling factor for CME's quotes API
22
/// </summary>
23
public
class
CMEStrikePriceScalingFactors
24
{
25
/// <summary>
26
/// CME's option chain quotes strike price scaling factor
27
/// </summary>
28
private
static
readonly IReadOnlyDictionary<string, decimal> _scalingFactors =
new
Dictionary<string, decimal>
29
{
30
{
"SI"
, 0.1m },
31
{
"NG"
, 5m }
32
};
33
34
/// <summary>
35
/// Gets the option chain strike price scaling factor for the quote response from CME
36
/// </summary>
37
/// <param name="underlyingFuture">Underlying future Symbol to normalize</param>
38
/// <returns>Scaling factor for the strike price</returns>
39
public
static
decimal
GetScaleFactor
(
Symbol
underlyingFuture)
40
{
41
return
_scalingFactors.ContainsKey(underlyingFuture.
ID
.
Symbol
)
42
? _scalingFactors[underlyingFuture.
ID
.
Symbol
]
43
: 1m;
44
}
45
}
46
}
Common
Securities
FutureOption
Api
CMEStrikePriceScalingFactors.cs
Generated by
1.8.17