Hi
I wrote a pivot indicator which when attached to a graph plots the pivots according to a timeframe parameter.
When trying to call this indicator from a script, I get the above error #4802 -
ERR_INDICATOR_CANNOT_CREATE.
the code that creates the handle:
ArrayResize(params,2);
params[0].type =TYPE_STRING;
params[0].string_value ="My Pivots Indicator";
params[1].type =TYPE_INT;
params[1].integer_value = PERIOD_D1;
DP = IndicatorCreate(Symbol(), 0,IND_CUSTOM,2,params);
if (DP==INVALID_HANDLE) Print("invalid handle for DP",GetLastError() );
am I doing something wrong?
Can you provide a source code of your indicator?
You can send it via private messages.
I got the reason, the ex5 of the custom indicator must reside in terminal path (and not common path).
I still don't get how to work correctly with paths (which element should be in which path).
Thanks.
Rosh,
I've installed MT5 on d:\program files\metatrader 5.
So my path variables are:
terminal_data_path= C:\Users\A J\AppData\Roaming\MetaQuotes\Terminal\E6E3D0917DD641581E4779524EB3B1AA
common_data_path= C:\ProgramData\MetaQuotes\Terminal\Common
terminal_path= D:\Program files\metatrader 5
My ex5 indicator is in terminal_path and still, the getlasterror() returns 4802.
But if I place the ex5 on the terminal_data_path - it works. according to docs it should be vice versa (in terminal_path).
Is it a bug or I misunderstood the docs?
One more thing, the custom indicator can't work in a subfolder of the terminal_path?
Thanks.
from the windows start command I started the terminal with /portable and I get those paths:
TERMINAL_COMMONDATA_PATH = C:\ProgramData\MetaQuotes\Terminal\Common
TERMINAL_DATA_PATH = D:\Program Files\MetaTrader 5
TERMINAL_PATH = D:\Program Files\MetaTrader 5
but now I get 4802 even if the ex5 indicator exist in "D:\program files\metatrader 5\indicators" and also in "C:\ProgramData\MetaQuotes\Terminal\Common".
both cases I get the -1 handle with 4802.
Rosh -
I'm sorry, when starting from the start command with /portable it works fine from TERMINAL_PATH.
Can the indicator be operated from a sub-folder in TERMINAL_PATH(D:\Program files\MetaTrader 5\Indicators\My Indicators)?
Thanks

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi
I wrote a pivot indicator which when attached to a graph plots the pivots according to a timeframe parameter.
When trying to call this indicator from a script, I get the above error #4802 -
ERR_INDICATOR_CANNOT_CREATE.
the code that creates the handle:
ArrayResize(params,2);
params[0].type =TYPE_STRING;
params[0].string_value ="My Pivots Indicator";
params[1].type =TYPE_INT;
params[1].integer_value = PERIOD_D1;
DP = IndicatorCreate(Symbol(), 0,IND_CUSTOM,2,params);
if (DP==INVALID_HANDLE) Print("invalid handle for DP",GetLastError() );
am I doing something wrong?