Lean
$LEAN_TAG$
BacktestingBrokerageFactory.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
using
QuantConnect
.
Interfaces
;
18
using
QuantConnect
.
Packets
;
19
using
QuantConnect
.
Securities
;
20
21
namespace
QuantConnect.Brokerages.Backtesting
22
{
23
/// <summary>
24
/// Factory type for the <see cref="BacktestingBrokerage"/>
25
/// </summary>
26
public
class
BacktestingBrokerageFactory
:
BrokerageFactory
27
{
28
/// <summary>
29
/// Gets the brokerage data required to run the IB brokerage from configuration
30
/// </summary>
31
/// <remarks>
32
/// The implementation of this property will create the brokerage data dictionary required for
33
/// running live jobs. See <see cref="IJobQueueHandler.NextJob"/>
34
/// </remarks>
35
public
override
Dictionary<string, string>
BrokerageData
36
{
37
get
{
return
new
Dictionary<string, string>(); }
38
}
39
40
/// <summary>
41
/// Gets a new instance of the <see cref="InteractiveBrokersBrokerageModel"/>
42
/// </summary>
43
/// <param name="orderProvider">The order provider</param>
44
public
override
IBrokerageModel
GetBrokerageModel
(
IOrderProvider
orderProvider) =>
new
InteractiveBrokersBrokerageModel
();
45
46
/// <summary>
47
/// Creates a new IBrokerage instance
48
/// </summary>
49
/// <param name="job">The job packet to create the brokerage for</param>
50
/// <param name="algorithm">The algorithm instance</param>
51
/// <returns>A new brokerage instance</returns>
52
public
override
IBrokerage
CreateBrokerage
(
LiveNodePacket
job,
IAlgorithm
algorithm)
53
{
54
return
new
BacktestingBrokerage
(algorithm);
55
}
56
57
/// <summary>
58
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
59
/// </summary>
60
/// <filterpriority>2</filterpriority>
61
public
override
void
Dispose
()
62
{
63
// NOP
64
}
65
66
/// <summary>
67
///Initializes a new instance of the <see cref="BacktestingBrokerageFactory"/> class
68
/// </summary>
69
public
BacktestingBrokerageFactory
()
70
: base(typeof(
BacktestingBrokerage
))
71
{
72
}
73
}
74
}
Brokerages
Backtesting
BacktestingBrokerageFactory.cs
Generated by
1.8.17