iMA(), iAC() and iMACD() in an expert advisor

 

Hello,

I’m planning to sell some expert I have developed in the mql5.com market.

My issue is that I’m using standard function such as iMa(), iRSI(), iATR() in the code and a buyer can modify these functions and make the expert not work correctly.

The only solution I have currently is to rewrite the entire code by using #resource and iCustom() which is going to take time (the code contains many indicators and many lines).

Do you have any idea about a simple alternative to this?

Thank you in advance.

 
  1. Buyer can not modify those functions.
  2. Buyer can not modify your EXn. No alternative needed.
 

Hello WILLIAM,

Your answer was a little strange to me. Indeed, I have already modified some indicators (MA, RSI) present in MT4 and MT5 on several occasions.

when I researched regarding this topic, I found this:

All functions like iMA, iAC, iMACD, iIchimoku etc. create a copy of the corresponding technical indicator in the global cache of the client terminal.
If a copy of the indicator with such parameters already exists, the new copy is not created, and the counter of references to the existing copy increases.

https://www.mql5.com/en/docs/indicators

What I understand is that theses functions are independent from the indicators files present in MT4 and MT5 terminals and can work even if indicators files are removed.

 

You may have modified some indicators. So what? To use them  you have to use iCustom.

What part of "independent from the indicator files" is not clear to you? No alternative needed.

 

Hi,

I mean by independent from the indicator files that if I use iWPR() in my EA for example and I have a modified version the WPR indicator in my terminal indicator file the code will always call the standard iWPR function (not the code I modified).

All functions like iMA, iAC, iMACD, iIchimoku etc. create a copy of the corresponding technical indicator in the global cache of the client terminal.
If a copy of the indicator with such parameters already exists, the new copy is not created, and the counter of references to the existing copy increases.

That means if I modify the existing codes in my indicator’s files MT4 or MT5 will create a copy similar to the standard version in the cache and will work with.

The version I have modified will be ignored when calling iWPR() or iATR().

But if I want to use the modified version. Then in this case I should use iCustom because the iWPR() will not use my version for calculation but the original version of the indicator.

Is that correct?

 
Zakaria Rachid # :


Create your indicator and then use it with Resources .

Custom Moving Average as a resource

Documentation on MQL5: MQL5 programs / Resources
Documentation on MQL5: MQL5 programs / Resources
  • www.mql5.com
Resources - MQL5 programs - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Reason: