Where error 4802 comes from
An iCustom or built-in indicator constructor returned INVALID_HANDLE because the indicator path, inputs, symbol, timeframe, or required resource was not valid in that context. The numeric value is listed in the official runtime error table, which is separate from MetaEditor compilation errors and trade server return codes.
Reset the last-error state before the suspected call, save its direct return value, and read GetLastError immediately afterward. This produces a causal log instead of a stale code.
