Hi, need some help
I have converted an Indicator to EA, but it still seems to think that it is an Indicator.
"no indicator window property is defined, indicator_chart_window is applied 0 0"
I have gone through the coding and everything looks good, except I think it might be due to the Buffer, which I can't seem to figure out how to change that for the EA.
long chartID = ChartID();
#define LabelBox "LabelBox"
#define Label1 "Label1"
#define Label2 "Label2"
#define Label3 "Label3"
#define Label4 "Label4"
string label1 = "Spread ",
label2 = "Range";
and further down
//--- indicator buffers mapping
#define OP_NONE -1
my God you need to follow up basic programming tutorials.
your code is a mess
You cannot convert an indicator to an EA.
You can use iCustom to retrieve buffer values from the indicator.
Don't try to do that. There are no buffers, no IndicatorCounted() or prev_calculated. No way to know if older bars have changed or been added (history update.)
Just get the value(s) of the indicator(s) into EA/indicator (using iCustom) and do what you want with it.
You should encapsulate your iCustom calls to make your code self-documenting. Detailed explanation of iCustom - MQL4 programming forum #33 2017.05.23