-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDayTradeSystem.java
More file actions
104 lines (78 loc) · 2.82 KB
/
DayTradeSystem.java
File metadata and controls
104 lines (78 loc) · 2.82 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
96
97
98
99
100
101
102
103
104
/*
*
* Author : ACIMS(Arizona Centre for Integrative Modeling & Simulation)
* Version : DEVSJAVA 2.7
* Date : 08-15-02
*/
package StockSim;
import java.awt.Dimension;
import java.awt.Point;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Map;
import GenCol.entity;
import view.modeling.ViewableAtomic;
import view.modeling.ViewableComponent;
import view.modeling.ViewableDigraph;
public class DayTradeSystem extends ViewableDigraph{
private ArrayList<String> stockSymbols;
private Map <String, Map> stocksMap;
public DayTradeSystem(String name){
super(name);
ReadExcel stockReader = new ReadExcel();
try {
stocksMap = stockReader.read();
stockSymbols = stockReader.getStockSymbolList();
} catch (IOException e) {
e.printStackTrace();
}
DayTradeSystemConstruct(1,100);
}
public DayTradeSystem(String nm,double int_arr_t,double observe_t){
super(nm);
DayTradeSystemConstruct(int_arr_t,observe_t);
}
public void initialize(){
super.initialize();
}
public void DayTradeSystemConstruct(double int_arr_t,double observe_t){
addInport("InPrices");
addInport("InState");
addOutport("OutTrendBalance");
addOutport("OutScalpBalance");
ViewableAtomic macd = new MACD("MACD");
ViewableAtomic dtt = new StockDayTradeTrend("DayTradeTrend", stockSymbols);
ViewableAtomic dts = new StockDayTradeScalp("DayTradeScalp", stockSymbols);
add(macd);
add(dtt);
add(dts);
initialize();
addCoupling(this,"InPrices",macd,"InPrices");
addCoupling(this,"InState",macd,"InState");
addCoupling(this,"InPrices",dtt,"InPrices");
addCoupling(this,"InState",dtt,"InState");
addCoupling(macd,"MACD",dtt,"InMACD");
addCoupling(macd,"Signal",dtt,"InSignal");
addCoupling(this,"InPrices",dts,"InPrices");
addCoupling(this,"InState",dts,"InState");
addCoupling(macd,"MACD",dts,"InMACD");
addCoupling(macd,"Signal",dts,"InSignal");
addCoupling(dtt,"BuySellBalance",this,"OutTrendBalance");
addCoupling(dts,"BuySellBalance",this,"OutScalpBalance");
preferredSize = new Dimension(600, 350);
macd.setPreferredLocation(new Point(15, 100));
dtt.setPreferredLocation(new Point(154, 267));
dts.setPreferredLocation(new Point(154, 267));
}
/**
* Automatically generated by the SimView program.
* Do not edit this manually, as such changes will get overwritten.
*/
public void layoutForSimView()
{
preferredSize = new Dimension(600, 342);
((ViewableComponent)withName("DayTradeScalp")).setPreferredLocation(new Point(156, 53));
((ViewableComponent)withName("MACD")).setPreferredLocation(new Point(-3, 141));
((ViewableComponent)withName("DayTradeTrend")).setPreferredLocation(new Point(151, 229));
}
}