Failed to compile file

 
When i try to download some indicators for my MT5 trading platform, sometimes I get this message in Journal: failed to compile file "C:\Program Files\MT5\Indicators\Downloads\<indicator name>.mq5". Most indicators work well but some just don't and i would like to understand why is it so. Thanks for reply.
 
Gantrithor:
When i try to download some indicators for my MT5 trading platform, sometimes I get this message in Journal: failed to compile file "C:\Program Files\MT5\Indicators\Downloads\<indicator name>.mq5". Most indicators work well but some just don't and i would like to understand why is it so. Thanks for reply.

My indicators (the ones I download manually) go here:

%APPDATA%\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5\Indicators\Downloads\

Maybe check to see if your indicators are going in the right place.

My next thought is to load and compile offending indicators using MetaEditor. That may give you the exact compilation error message.

 
Gantrithor:
When i try to download some indicators for my MT5 trading platform, sometimes I get this message in Journal: failed to compile file "C:\Program Files\MT5\Indicators\Downloads\<indicator name>.mq5". Most indicators work well but some just don't and i would like to understand why is it so. Thanks for reply.

Be sure to save your indicator to the right folder.

To determine if its the right folder, open MetaTrader 5.

Click on File>Data folder. 

Click into the MQL5 > Indicators folder. Save your indicator here.

Next, open MetaEditor by pressing F4 in MetaTrader.

A pop up will appear. Click on your indicator from the navigator window to view the code.

Then click compile and see if there are any errors. The errors will appear in the toolbox window.

If there are errors, means there is some problem with the code. Solve these errors and you will be good to go.


Cheers,

Bryan

 
forexp18:


It shows 2 errors in these 2 lines:


input Smooth_Method MA_Method_=MODE_EMA; //method of averaging

input Smooth_Method Signal_Method_=MODE_EMA; //method of averaging of MACD


saying:


"MODE_EMA" - cannot convert enum


in both cases.

Any idea? Thanks for reply.    


Edit: Nevermind, that editor is so user friendly so it offered me solution that fixed it. Thanks for help. Cheers.

 
Gantrithor #:

It shows 2 errors in these 2 lines:


input Smooth_Method MA_Method_=MODE_EMA; //method of averaging

input Smooth_Method Signal_Method_=MODE_EMA; //method of averaging of MACD


saying:


"MODE_EMA" - cannot convert enum


in both cases.

Any idea? Thanks for reply.    


Edit: Nevermind, that editor is so user friendly so it offered me solution that fixed it. Thanks for help. Cheers.

Yes, MODE_EMA is one value of the mql proprietary "ENUM_MA_METHOD". For that matter it can't be used in a self defined enum like "Smooth_Method".

Reason: