Aurix Exchange

How to diable an indicator


Hello -

How do you disable an indicator? I am messing around with some free EAs and I'd like to be able to disable specific indicators like MACD = True or False. I do not know how to code however, I would think that this would be easy enough to accomplish with simple instructions. Thanks!


for basic coding is

trying to find where is MACD then

if checkMACD == true
here is the code where you want MACD to run.


New member
if you wanna edit the code. you have to search all related iMACD in this case.

first, you have to find any var that get values from iMACD by search iMACD(
you may get lines like
a = iMACD( ...
b = iMACD( ...

then you find any line related to those var (a and b above)
and if they are used to other like
c = a + ...
d = b + ...
so u have to keep tracking further about c and d

now when you get all things you wanna disable, you just put the "//" before the line to exclude it from compiling
but if those var are used in "if" condition like
if (a > 50 && something
you have to delete the condition related to it too.

hope it can help you.
sorry for my bad english


Active member
What I do is add a parameter at the top, such as: extern int UseMACD=true;

Then, I add it in the "if" statement. Let's say the original statement goes like this: if (CurrentMACD>PreviousMACD && CurrentMACD>MACDSignal && .....

Now, to add the new parameter, you must find every test for the MACD, and change it like this: if ((!UseMACD || (CurrentMACD>PreviousMACD && CurrentMACD>MACDSignal)) && ....

It can get quite complicated. However, if the MACD test is encased in a separate function which returns true or false, you can just add this line to the beginning of the function: if (UseMACD) return(true);

Aurix Exchange