forked from MeowBot/OpenQuant.API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProject.cs
More file actions
95 lines (95 loc) · 1.67 KB
/
Copy pathProject.cs
File metadata and controls
95 lines (95 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
using System;
using System.Collections.Generic;
namespace OpenQuant.API.Engine
{
public class Project
{
private Statistics statistics;
public string Name
{
get;
private set;
}
public ParameterSet Parameters
{
get;
private set;
}
public bool ReportEnabled
{
get;
set;
}
public bool Enabled
{
get;
set;
}
public Portfolio Portfolio
{
get;
private set;
}
public Performance Performance
{
get;
private set;
}
public Statistics Statistics
{
get
{
if (this.statistics == null)
{
this.statistics = new Statistics(this.Portfolio.portfolio);
return this.statistics;
}
return this.statistics;
}
}
public InstrumentList Instruments
{
get;
private set;
}
private Project()
{
this.Instruments = new InstrumentList();
}
private void Init(string name, Portfolio portfolio, bool reportEnabled, List<Parameter> parameters)
{
this.Name = name;
this.Portfolio = portfolio;
this.Performance = new Performance(portfolio);
this.ReportEnabled = reportEnabled;
this.Parameters = new ParameterSet(parameters);
}
public void AddInstrument(string symbol)
{
this.Instruments.Add(symbol);
}
public void AddInstrument(Instrument instrument)
{
this.Instruments.Add(instrument);
}
public void RemoveInstrument(string symbol)
{
this.Instruments.Remove(symbol);
}
public void RemoveInstrument(Instrument instrument)
{
this.Instruments.Remove(instrument);
}
public void ClearInstruments()
{
this.Instruments.Clear();
}
internal void OnStart()
{
if (this.statistics != null)
{
this.statistics.IsCalculated = false;
}
}
}
}