Use iCustom double (?)

 
double Ebuy=iCustom(Symbol(),0,"Envelope",0,1); //buy
double Esell=iCustom(Symbol(),0,"Envelope",1,1); //sell

Hi. If I want to use a condition to use these doubles, what should I write?

I tried with this but it doesn't work:

if (Ebuy>0) OPBUY;
if (Esell>0) OPSELL;
 
Jox90:

Hi. If I want to use a condition to use these doubles, what should I write?

I tried with this but it doesn't work:

  1. How should we know what you want? Until you can concretely state your criteria, no once can help you. There are no mind readers here and our crystal balls are cracked.

  2. "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here and our crystal balls are cracked.

  3. double Ebuy=iCustom(Symbol(),0,"Envelope",0,1); //buy
    double Esell=iCustom(Symbol(),0,"Envelope",1,1); //sell
    if (Ebuy>0) OPBUY;
    if (Esell>0) OPSELL;
    On chart indicators return a price. So your tests are always true.

  4. We can't know what indicator "Envelope" is or what version. There are no mind readers here and our crystal balls are cracked.

 
William Roeder:
  1. How should we know what you want? Until you can concretely state your criteria, no once can help you. There are no mind readers here and our crystal balls are cracked.

  2. "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. We can't see your broken code. There are no mind readers here and our crystal balls are cracked.

  3. On chart indicators return a price. So your tests are always true.

  4. We can't know what indicator "Envelope" is or what version. There are no mind readers here and our crystal balls are cracked.

I complained about your comment, so you are happy...
 
Jox90: so you are happy...

Added to my do not help list. I am happy, I won't be wasting my time, trying to help you, ever again.

 
William Roeder:

Added to my do not help list. I am happy, I won't be wasting my time, trying to help you, ever again.

You didn't help me. You never did. You just rail against people every time instead of giving concrete suggestions, and this is not the first time you have this behaviour with me. STAY AWAY!
 

We don't know what OPSELL and OPBUY means.

They are not function calls so they are considered variables but nothing is assigned to them whenever the conditions becomes true or false.

The code seems incomplete.

The envelopes indicator returns a price value, not a level value above or below a zero crossing.

You would have to provide more info about what it is exactly that you are trying to do.

 
Marco vd Heijden:

We don't know what OPSELL and OPBUY means.

They are not function calls so they are considered variables but nothing is assigned to them.

The code seems incomplete.

The envelopes indicator returns a price value, not a level value above or below a zero crossing.

You would have to provide more info about what it is exactly that you are trying to do.

double Ebuy=iCustom(Symbol(),0,"Envelope",0,1); //buy
double Esell=iCustom(Symbol(),0,"Envelope",1,1); //sell

0 and 1 (yellow) are the index buffers number, 1 is the shift. they correspond to the only 2 buffers of the indicator, they are arrows buffers. It cannot be in a different way, there are only that two.

The two 1 (red) is the shift.

The indicator has only one input double that should remain fixed, so I set it in the indicator, and it should not be needed to add it in the code, however I did it adding the value of 2 like this but obviously the result is the same:

double Ebuy=iCustom(Symbol(),0,"Envelope",2,0,1); //buy
double Esell=iCustom(Symbol(),0,"Envelope",2,1,1); //sell

OPBUY and OPSELL correspond to the opening of a BUY or SELL order (it is an EA).

If I use a simple stochastic instead of the iCustom and set it like this:

double Stoch=iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,0)

if (Stoch>50) OPBUY;
if (Stoch<50) OPSELL;

...it works correctly. So the ea works, the problem is in the iCustom...I just need to open a BUY order when the BUY ARROW (buffer 0) is given, and SELL order when SELL ARROW (buffer 1)  is given.

I tried with Ebuy>0 and Esell>0....but this is not the right condition: it is not a stochastic that I set >50 and it works, it is an arrow, I tried with Ebuy==TRUE, but nothing changed...no orders are opened.

I just need to know what is the condition to make the EA understand to open a buy/sell order when an arrow appears.

 

Well i still don't understand your code because they are not function calls but you can try to see if you understand this:

if(bid>iCustom(...))
 {

 }

if(bid<iCustom(...))
 {

 }
Because like i said, envelopes returns a price value and not a standardized level.
 
Marco vd Heijden:

Well i still don't understand your code because they are not function calls but you can try to see if you understand this:

Because like i said, envelopes returns a price value and not a standardized level.
it works. Thank you Heidi jen .
Reason: