Skip to content

Commit 2bc78a3

Browse files
committed
Fixes compatibility with classes v3.001-dev
1 parent e1d80e3 commit 2bc78a3

File tree

1 file changed

+11
-20
lines changed

1 file changed

+11
-20
lines changed

Stg_Retracement.mqh

+11-20
Original file line numberDiff line numberDiff line change
@@ -239,84 +239,75 @@ class Stg_Retracement : public Strategy {
239239
IndiAMAParams _indi_params(::Retracement_Indi_AMA_InpPeriodAMA, ::Retracement_Indi_AMA_InpFastPeriodEMA,
240240
::Retracement_Indi_AMA_InpSlowPeriodEMA, ::Retracement_Indi_AMA_InpShiftAMA,
241241
PRICE_TYPICAL, ::Retracement_Indi_AMA_Shift);
242-
_indi_params.SetDataSourceType(::Retracement_Indi_AMA_SourceType);
243242
_indi_params.SetTf(Get<ENUM_TIMEFRAMES>(STRAT_PARAM_TF));
244-
SetIndicator(new Indi_AMA(_indi_params), ::Retracement_Indi_Type);
243+
SetIndicator(new Indi_AMA(_indi_params, ::Retracement_Indi_AMA_SourceType), ::Retracement_Indi_Type);
245244
break;
246245
}
247246
case STG_RETRACEMENT_TYPE_DEMA: // DEMA
248247
{
249248
IndiDEIndiMAParams _indi_params(::Retracement_Indi_DEMA_Period, ::Retracement_Indi_DEMA_MA_Shift,
250249
::Retracement_Indi_DEMA_Applied_Price, ::Retracement_Indi_DEMA_Shift);
251-
_indi_params.SetDataSourceType(::Retracement_Indi_DEMA_SourceType);
252250
_indi_params.SetTf(Get<ENUM_TIMEFRAMES>(STRAT_PARAM_TF));
253-
SetIndicator(new Indi_DEMA(_indi_params), ::Retracement_Indi_Type);
251+
SetIndicator(new Indi_DEMA(_indi_params, ::Retracement_Indi_DEMA_SourceType), ::Retracement_Indi_Type);
254252
break;
255253
}
256254
case STG_RETRACEMENT_TYPE_FRAMA: // FrAMA
257255
{
258256
IndiFrAIndiMAParams _indi_params(::Retracement_Indi_FrAMA_Period, ::Retracement_Indi_FrAMA_MA_Shift,
259257
::Retracement_Indi_FrAMA_Applied_Price, ::Retracement_Indi_FrAMA_Shift);
260-
_indi_params.SetDataSourceType(::Retracement_Indi_FrAMA_SourceType);
261258
_indi_params.SetTf(Get<ENUM_TIMEFRAMES>(STRAT_PARAM_TF));
262-
SetIndicator(new Indi_FrAMA(_indi_params), ::Retracement_Indi_Type);
259+
SetIndicator(new Indi_FrAMA(_indi_params, ::Retracement_Indi_FrAMA_SourceType), ::Retracement_Indi_Type);
263260
break;
264261
}
265262
case STG_RETRACEMENT_TYPE_ICHIMOKU: // Ichimoku
266263
{
267264
IndiIchimokuParams _indi_params(
268265
::Retracement_Indi_Ichimoku_Period_Tenkan_Sen, ::Retracement_Indi_Ichimoku_Period_Kijun_Sen,
269266
::Retracement_Indi_Ichimoku_Period_Senkou_Span_B, ::Retracement_Indi_Ichimoku_Shift);
270-
_indi_params.SetDataSourceType(::Retracement_Indi_Ichimoku_SourceType);
271267
_indi_params.SetTf(Get<ENUM_TIMEFRAMES>(STRAT_PARAM_TF));
272-
SetIndicator(new Indi_Ichimoku(_indi_params), ::Retracement_Indi_Type);
268+
SetIndicator(new Indi_Ichimoku(_indi_params, ::Retracement_Indi_Ichimoku_SourceType), ::Retracement_Indi_Type);
273269
break;
274270
}
275271
case STG_RETRACEMENT_TYPE_MA: // MA
276272
{
277273
IndiMAParams _indi_params(::Retracement_Indi_MA_Period, ::Retracement_Indi_MA_MA_Shift,
278274
::Retracement_Indi_MA_Method, ::Retracement_Indi_MA_Applied_Price,
279275
::Retracement_Indi_MA_Shift);
280-
_indi_params.SetDataSourceType(::Retracement_Indi_MA_SourceType);
281276
_indi_params.SetTf(Get<ENUM_TIMEFRAMES>(STRAT_PARAM_TF));
282-
SetIndicator(new Indi_MA(_indi_params), ::Retracement_Indi_Type);
277+
SetIndicator(new Indi_MA(_indi_params, ::Retracement_Indi_MA_SourceType), ::Retracement_Indi_Type);
283278
break;
284279
}
285280
case STG_RETRACEMENT_TYPE_PRICE_CHANNEL: // Price Channel
286281
{
287282
IndiPriceChannelParams _indi_params(::Retracement_Indi_PriceChannel_Period,
288283
::Retracement_Indi_PriceChannel_Shift);
289-
_indi_params.SetDataSourceType(::Retracement_Indi_PriceChannel_SourceType);
290284
_indi_params.SetTf(Get<ENUM_TIMEFRAMES>(STRAT_PARAM_TF));
291-
SetIndicator(new Indi_PriceChannel(_indi_params), ::Retracement_Indi_Type);
285+
SetIndicator(new Indi_PriceChannel(_indi_params, ::Retracement_Indi_PriceChannel_SourceType), ::Retracement_Indi_Type);
292286
break;
293287
}
294288
case STG_RETRACEMENT_TYPE_SAR: // SAR
295289
{
296290
IndiSARParams _indi_params(::Retracement_Indi_SAR_Step, ::Retracement_Indi_SAR_Maximum_Stop,
297291
::Retracement_Indi_SAR_Shift);
298-
_indi_params.SetDataSourceType(::Retracement_Indi_SAR_SourceType);
299292
_indi_params.SetTf(Get<ENUM_TIMEFRAMES>(STRAT_PARAM_TF));
300-
SetIndicator(new Indi_SAR(_indi_params), ::Retracement_Indi_Type);
293+
SetIndicator(new Indi_SAR(_indi_params, ::Retracement_Indi_SAR_SourceType), ::Retracement_Indi_Type);
301294
break;
302295
}
303296
case STG_RETRACEMENT_TYPE_TEMA: // TEMA
304297
{
305298
IndiTEMAParams _indi_params(::Retracement_Indi_TEMA_Period, ::Retracement_Indi_TEMA_MA_Shift,
306299
::Retracement_Indi_TEMA_Applied_Price, ::Retracement_Indi_TEMA_Shift);
307-
_indi_params.SetDataSourceType(::Retracement_Indi_TEMA_SourceType);
308300
_indi_params.SetTf(Get<ENUM_TIMEFRAMES>(STRAT_PARAM_TF));
309-
SetIndicator(new Indi_TEMA(_indi_params), ::Retracement_Indi_Type);
301+
SetIndicator(new Indi_TEMA(_indi_params, ::Retracement_Indi_TEMA_SourceType), ::Retracement_Indi_Type);
310302
break;
311303
}
312304
case STG_RETRACEMENT_TYPE_VIDYA: // VIDYA
313305
{
314306
IndiVIDYAParams _indi_params(::Retracement_Indi_VIDYA_Period, ::Retracement_Indi_VIDYA_MA_Period,
315307
::Retracement_Indi_VIDYA_MA_Shift, ::Retracement_Indi_VIDYA_Applied_Price,
316308
::Retracement_Indi_VIDYA_Shift);
317-
_indi_params.SetDataSourceType(::Retracement_Indi_VIDYA_SourceType);
318309
_indi_params.SetTf(Get<ENUM_TIMEFRAMES>(STRAT_PARAM_TF));
319-
SetIndicator(new Indi_VIDYA(_indi_params), ::Retracement_Indi_Type);
310+
SetIndicator(new Indi_VIDYA(_indi_params, ::Retracement_Indi_VIDYA_SourceType), ::Retracement_Indi_Type);
320311
break;
321312
}
322313
case STG_RETRACEMENT_TYPE_0_NONE: // (None)
@@ -340,7 +331,7 @@ class Stg_Retracement : public Strategy {
340331
int _direction = Order::OrderDirection(_cmd, _mode);
341332
uint _ishift = 0;
342333
Chart *_chart = trade.GetChart();
343-
IndicatorBase *_indi = GetIndicator(::Retracement_Indi_Type);
334+
IndicatorData *_indi = GetIndicator(::Retracement_Indi_Type);
344335

345336
double _pp, _r1, _r2, _r3, _r4, _s1, _s2, _s3, _s4;
346337
ChartEntry _ohlc_range = _chart.GetEntry(::Retracement_Levels_Tf, _ishift + 1, _chart.GetSymbol());
@@ -384,7 +375,7 @@ class Stg_Retracement : public Strategy {
384375
*/
385376
bool SignalOpen(ENUM_ORDER_TYPE _cmd, int _method = 0, float _level = 0.0f, int _shift = 0) {
386377
Chart *_chart = trade.GetChart();
387-
IndicatorBase *_indi = GetIndicator(::Retracement_Indi_Type);
378+
IndicatorData *_indi = GetIndicator(::Retracement_Indi_Type);
388379
// uint _ishift = _indi.GetParams().GetShift(); // @todo: Convert into Get().
389380
// bool _result = _indi.GetFlag(INDI_ENTRY_FLAG_IS_VALID, _shift); // @fixme
390381
uint _ishift = _shift;

0 commit comments

Comments
 (0)