Skip to content

Commit

Permalink
Indicator: Sets SetDataSource by default when source is NULL [WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
kenorb committed Oct 15, 2021
1 parent 48552b9 commit 203e04c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Indicator.enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ enum ENUM_INDICATOR_TYPE {

/* Defines type of source data for indicator. */
enum ENUM_IDATA_SOURCE_TYPE {
IDATA_BUILTIN, // Platform built-in
IDATA_BUILTIN = 0, // Platform built-in
IDATA_CHART, // Chart calculation
IDATA_ICUSTOM, // iCustom: Custom indicator file
IDATA_ICUSTOM_LEGACY, // iCustom: Custom, legacy, provided by MT indicator file
Expand Down
3 changes: 2 additions & 1 deletion Indicator.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ class Indicator : public IndicatorBase {
break;
case IDATA_INDICATOR:
if (indi_src == NULL) {
// SetDataSource(Indi_Price::GetCached(iparams.GetShift(), GetTf(), PRICE_TYPICAL, _period), true);
// Indi_Price* _indi_price = Indi_Price::GetCached(GetSymbol(), GetTf(), iparams.GetShift());
// SetDataSource(_indi_price, true, PRICE_OPEN);
}
break;
}
Expand Down
1 change: 1 addition & 0 deletions Indicator.struct.cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

// Includes.
#include "Refs.mqh"
#include "Storage/ValueStorage.h"

/**
* Holds buffers used to cache values calculated via OnCalculate methods.
Expand Down
6 changes: 2 additions & 4 deletions Indicator.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ struct IndicatorParams {
/* Special methods */
// Constructor.
IndicatorParams(ENUM_INDICATOR_TYPE _itype = INDI_NONE, unsigned int _max_modes = 1,
ENUM_DATATYPE _dtype = TYPE_DOUBLE, ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN,
string _name = "")
ENUM_DATATYPE _dtype = TYPE_DOUBLE, ENUM_TIMEFRAMES _tf = PERIOD_CURRENT,
ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, string _name = "")
: custom_indi_name(""),
dtype(_dtype),
name(_name),
Expand All @@ -395,7 +395,6 @@ struct IndicatorParams {
indi_color(clrNONE),
draw_window(0),
tf(_tf) {
SetDataSourceType(_idstype);
Init();
};
IndicatorParams(string _name, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN)
Expand All @@ -411,7 +410,6 @@ struct IndicatorParams {
is_draw(false),
indi_color(clrNONE),
draw_window(0) {
SetDataSourceType(_idstype);
Init();
};
// Copy constructor.
Expand Down

0 comments on commit 203e04c

Please sign in to comment.