Help with iCustom

 

Dear Forum Members,

I am trying to call iFractalEx.ex4 indicator from another indicator so that it alerts me when it returns a down arrow (indicating a Sell)

when there's a fractal and rsi value is greater than 50; and also alert me for a buy when there's a fractal and rsi value is less than 50;

I have attached the iFractalEx code for your reference.

Below is an extract from the calling indicator:

rsi =iRSI(null,15,9,PRICE_CLOSE, 0);

double iFractalEx = iCustom(NULL,0,"i-FractalsEx",0,0);

if (iFractalEx != 0 && rsi == 50) {

CrossUp[i] = Low[i] - Range*0.5;

}

else if (iFractalEx == 0 && rsi < 50) && {

CrossDown[i] = High[i] + Range*0.5;

}

The indicator gives the down arrow when the second condition is satisfied but doesn't work for the first one (i.e. when iFractalEx != 0 && RSI = 50).

Could you please help me pinpoint what I didn't declare properly in my indicator?


Thanks in advance.

Files:
 

Could you be more specific in what it is you want the indicator to do? Does RSI play a role in it, or was that just an example? If so, RSI is never mentioned in the code.

 
25092067:
The indicator gives the down arrow when the second condition is satisfied but doesn't work for the first one (i.e. when iFractalEx != 0 && RSI = 50).

Could you please help me pinpoint what I didn't declare properly in my indicator?


Thanks in advance.

For some reason, the original message got truncated leaving only the last 3 lines. Below is the full message:


I got a fractal indicator (called iFractalEx.mq4) free online. The indicator prints a down arrow for a sell and an up arrow for a buy.

But I want to develop another indicator to add the following RSI conditions:

1. To print a down arrow only if iFractalEx is showing a down arrow and RSI < 50

2. To print an up arrow only if iFractalEx is showing an up arrow and RSI >= 50

However the new indicator works for condition 1 but not for the second condition.

Below is the relevant extract from the indicator:

double iFractalEx = iCustom(NULL,0,"i-FractalsEx",0,0);

if ((iFractalEx != 0) && (RSI >= 50)) {

CrossUp[i] = Low[i] - Range*0.5;

}

else if ((iFractalEx == 0) && (RSI < 50)) {

CrossDown[i] = High[i] + Range*0.5;

}

I would be grateful if you can advise me on how the iFractalsEx should be declared, and on how to ensure the conditions are properly declared in the new indicator.

Thanks and God bless.

 
Don't know why the last 2 messages were truncated.
 

I got a customised fractal indicator (called iFractalEx.mql) that displays a down arrow for a sell and an up arrow for a buy free online, attached in the original message.

I want to develop another indicator that would satisfy the following 2 conditions:

1. For a sell, print down arrow when iFractalEx shows a down arrow and RSI>= 50

2. For a buy, print up arrow when iFractalEx shows a down arrow and RSI < 50.

Below is an extract from the new indicator:

double iFractalEx = iCustom(NULL,0,"i-FractalsEx",0,0);

if ((iFractalEx != 0) && (rsi < 50)) {

CrossUp[i] = Low[i] - Range*0.5;

}

else if ((iFractalEx == 0) && (rsi >= 50)) {

CrossDown[i] = High[i] + Range*0.5;

}

It works for condition 1 but doesn't for the 2nd condition.

Pls advise what I'm doing wrongly.

 
double iFractalEx = iCustom(NULL,0,"i-FractalsEx",0,0); 
this will always be zero as you can't have a fractal until two complete bars less than the third. iCustom(,,0) 1) aand 2) will be zero
Reason: