-
Notifications
You must be signed in to change notification settings - Fork 52
/
manager.h
170 lines (164 loc) Β· 5.83 KB
/
manager.h
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
//+------------------------------------------------------------------+
//| EA31337 - multi-strategy advanced trading robot |
//| Copyright 2016-2023, EA31337 Ltd |
//| https://github.com/EA31337 |
//+------------------------------------------------------------------+
/*
* This file is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Prevents processing this includes file multiple times.
#ifndef STRATEGIES_MANAGER_H
#define STRATEGIES_MANAGER_H
class StrategiesManager {
public:
/**
* Initialize strategy with the specific timeframe.
*
* @param
* _tf - timeframe to initialize
*
* @return
* Returns strategy pointer on successful initialization, otherwise NULL.
*/
template <typename SClass>
static Strategy* StrategyInit(ENUM_TIMEFRAMES _tf) {
return ((SClass*)NULL).Init(_tf);
}
/**
* Initialize strategy by enum type.
*
* @param
* _sid - Strategy type
*
* @return
* Returns strategy pointer on successful initialization, otherwise NULL.
*/
static Strategy* StrategyInitByEnum(ENUM_STRATEGY _sid, ENUM_TIMEFRAMES _tf = PERIOD_CURRENT) {
switch (_sid) {
case STRAT_AC:
return StrategyInit<Stg_AC>(_tf);
case STRAT_AD:
return StrategyInit<Stg_AD>(_tf);
case STRAT_ADX:
return StrategyInit<Stg_ADX>(_tf);
case STRAT_AMA:
return StrategyInit<Stg_AMA>(_tf);
case STRAT_ARROWS:
return StrategyInit<Stg_Arrows>(_tf);
case STRAT_ASI:
return StrategyInit<Stg_ASI>(_tf);
case STRAT_ATR:
return StrategyInit<Stg_ATR>(_tf);
case STRAT_ALLIGATOR:
return StrategyInit<Stg_Alligator>(_tf);
case STRAT_AWESOME:
return StrategyInit<Stg_Awesome>(_tf);
case STRAT_BWMFI:
return StrategyInit<Stg_BWMFI>(_tf);
case STRAT_BANDS:
return StrategyInit<Stg_Bands>(_tf);
case STRAT_BEARS_POWER:
return StrategyInit<Stg_BearsPower>(_tf);
case STRAT_BULLS_POWER:
return StrategyInit<Stg_BullsPower>(_tf);
case STRAT_CCI:
return StrategyInit<Stg_CCI>(_tf);
case STRAT_CHAIKIN:
return StrategyInit<Stg_Chaikin>(_tf);
case STRAT_DEMA:
return StrategyInit<Stg_DEMA>(_tf);
case STRAT_DPO:
return StrategyInit<Stg_DPO>(_tf);
case STRAT_DEMARKER:
return StrategyInit<Stg_DeMarker>(_tf);
case STRAT_ENVELOPES:
return StrategyInit<Stg_Envelopes>(_tf);
case STRAT_FORCE:
return StrategyInit<Stg_Force>(_tf);
case STRAT_FRACTALS:
return StrategyInit<Stg_Fractals>(_tf);
case STRAT_GATOR:
return StrategyInit<Stg_Gator>(_tf);
case STRAT_HEIKEN_ASHI:
return StrategyInit<Stg_HeikenAshi>(_tf);
case STRAT_ICHIMOKU:
return StrategyInit<Stg_Ichimoku>(_tf);
case STRAT_INDICATOR:
return StrategyInit<Stg_Indicator>(_tf);
case STRAT_MA:
return StrategyInit<Stg_MA>(_tf);
case STRAT_MA_BREAKOUT:
return StrategyInit<Stg_MA_Breakout>(_tf);
case STRAT_MA_CROSS_PIVOT:
return StrategyInit<Stg_MA_Cross_Pivot>(_tf);
case STRAT_MA_CROSS_SHIFT:
return StrategyInit<Stg_MA_Cross_Shift>(_tf);
case STRAT_MA_CROSS_SUP_RES:
return StrategyInit<Stg_MA_Cross_Sup_Res>(_tf);
case STRAT_MA_TREND:
return StrategyInit<Stg_MA_Trend>(_tf);
case STRAT_MACD:
return StrategyInit<Stg_MACD>(_tf);
case STRAT_MFI:
return StrategyInit<Stg_MFI>(_tf);
case STRAT_MOMENTUM:
return StrategyInit<Stg_Momentum>(_tf);
case STRAT_OBV:
return StrategyInit<Stg_OBV>(_tf);
case STRAT_OSCILLATOR:
return StrategyInit<Stg_Oscillator>(_tf);
case STRAT_OSCILLATOR_DIVERGENCE:
return StrategyInit<Stg_Oscillator_Divergence>(_tf);
case STRAT_OSCILLATOR_MULTI:
return StrategyInit<Stg_Oscillator_Multi>(_tf);
case STRAT_OSCILLATOR_CROSS:
return StrategyInit<Stg_Oscillator_Cross>(_tf);
case STRAT_OSCILLATOR_CROSS_SHIFT:
return StrategyInit<Stg_Oscillator_Cross_Shift>(_tf);
case STRAT_OSCILLATOR_CROSS_ZERO:
return StrategyInit<Stg_Oscillator_Cross_Zero>(_tf);
case STRAT_OSCILLATOR_RANGE:
return StrategyInit<Stg_Oscillator_Range>(_tf);
case STRAT_OSCILLATOR_TREND:
return StrategyInit<Stg_Oscillator_Trend>(_tf);
case STRAT_OSMA:
return StrategyInit<Stg_OsMA>(_tf);
case STRAT_PATTERN:
return StrategyInit<Stg_Pattern>(_tf);
case STRAT_PINBAR:
return StrategyInit<Stg_Pinbar>(_tf);
case STRAT_PIVOT:
return StrategyInit<Stg_Pivot>(_tf);
case STRAT_RSI:
return StrategyInit<Stg_RSI>(_tf);
case STRAT_RVI:
return StrategyInit<Stg_RVI>(_tf);
case STRAT_SAR:
return StrategyInit<Stg_SAR>(_tf);
case STRAT_STDDEV:
return StrategyInit<Stg_StdDev>(_tf);
case STRAT_STOCHASTIC:
return StrategyInit<Stg_Stochastic>(_tf);
case STRAT_WPR:
return StrategyInit<Stg_WPR>(_tf);
case STRAT_ZIGZAG:
return StrategyInit<Stg_ZigZag>(_tf);
default:
case STRAT_NONE:
break;
}
return NULL;
}
};
#endif // STRATEGIES_MANAGER_H