Lean
$LEAN_TAG$
Index.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
QuantConnect
.
Data
;
17
using
QuantConnect
.
Orders
.
Fees
;
18
using
QuantConnect
.
Orders
.
Fills
;
19
using
QuantConnect
.
Orders
.
Slippage
;
20
21
namespace
QuantConnect.Securities.Index
22
{
23
/// <summary>
24
/// INDEX Security Object Implementation for INDEX Assets
25
/// </summary>
26
/// <seealso cref="Security"/>
27
public
class
Index
:
Security
28
{
29
/// <summary>
30
/// Constructor for the INDEX security
31
/// </summary>
32
/// <param name="exchangeHours">Defines the hours this exchange is open</param>
33
/// <param name="quoteCurrency">The cash object that represent the quote currency</param>
34
/// <param name="config">The subscription configuration for this security</param>
35
/// <param name="symbolProperties">The symbol properties for this security</param>
36
/// <param name="currencyConverter">Currency converter used to convert <see cref="CashAmount"/>
37
/// instances into units of the account currency</param>
38
/// <param name="registeredTypes">Provides all data types registered in the algorithm</param>
39
public
Index
(
SecurityExchangeHours
exchangeHours,
40
Cash
quoteCurrency,
41
SubscriptionDataConfig
config,
42
SymbolProperties
symbolProperties,
43
ICurrencyConverter
currencyConverter,
44
IRegisteredSecurityDataTypesProvider
registeredTypes)
45
: base(config,
46
quoteCurrency,
47
symbolProperties,
48
new
IndexExchange
(exchangeHours),
49
new
IndexCache
(),
50
new
SecurityPortfolioModel
(),
51
new
ImmediateFillModel
(),
52
new
ConstantFeeModel
(0),
53
NullSlippageModel
.Instance,
54
new
ImmediateSettlementModel
(),
55
Securities.
VolatilityModel
.Null,
56
new
SecurityMarginModel
(50m),
57
new
IndexDataFilter
(),
58
new
SecurityPriceVariationModel
(),
59
currencyConverter,
60
registeredTypes,
61
Securities.
MarginInterestRateModel
.Null
62
)
63
{
64
IsTradable
=
false
;
//Index are non tradable by default
65
Holdings
=
new
IndexHolding
(
this
, currencyConverter);
66
}
67
68
/// <summary>
69
/// Constructor for the INDEX security
70
/// </summary>
71
/// <param name="symbol">The security's symbol</param>
72
/// <param name="exchangeHours">Defines the hours this exchange is open</param>
73
/// <param name="quoteCurrency">The cash object that represent the quote currency</param>
74
/// <param name="symbolProperties">The symbol properties for this security</param>
75
/// <param name="currencyConverter">Currency converter used to convert <see cref="CashAmount"/>
76
/// instances into units of the account currency</param>
77
/// <param name="registeredTypes">Provides all data types registered in the algorithm</param>
78
/// <param name="securityCache">Cache to store security information</param>
79
public
Index
(
Symbol
symbol,
80
SecurityExchangeHours
exchangeHours,
81
Cash
quoteCurrency,
82
SymbolProperties
symbolProperties,
83
ICurrencyConverter
currencyConverter,
84
IRegisteredSecurityDataTypesProvider
registeredTypes,
85
SecurityCache
securityCache)
86
: base(symbol,
87
quoteCurrency,
88
symbolProperties,
89
new
IndexExchange
(exchangeHours),
90
securityCache,
91
new
SecurityPortfolioModel
(),
92
new
ImmediateFillModel
(),
93
new
ConstantFeeModel
(0),
94
NullSlippageModel
.Instance,
95
new
ImmediateSettlementModel
(),
96
Securities.
VolatilityModel
.Null,
97
new
SecurityMarginModel
(50m),
98
new
IndexDataFilter
(),
99
new
SecurityPriceVariationModel
(),
100
currencyConverter,
101
registeredTypes,
102
Securities.
MarginInterestRateModel
.Null
103
)
104
{
105
IsTradable
=
false
;
//Index are non tradable by default
106
Holdings
=
new
IndexHolding
(
this
, currencyConverter);
107
}
108
}
109
}
Common
Securities
Index
Index.cs
Generated by
1.8.17