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:
- 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.
- "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.
-
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. - We can't know what indicator "Envelope" is or what version. There are no mind readers here and our crystal balls are cracked.
- 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.
- "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.
- On chart indicators return a price. So your tests are always true.
- We can't know what indicator "Envelope" is or what version. There are no mind readers here and our crystal balls are cracked.
Added to my do not help list. I am happy, I won't be wasting my time, trying to help you, ever again.
Added to my do not help list. I am happy, I won't be wasting my time, trying to help you, ever again.
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.
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.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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: