what problem with this indicator

Back to topics list To post a new topic, please log in or register
avatar
5
forex007 2015.05.27 01:30
 

hi,,

what problem with this indicator

i try use this

 bool up = iCustom(0,0,"OSCILLATOR",0,1)< 5000;
  bool down = iCustom(0,0,"OSCILLATOR",1,1)< 5000;
   bool down2 = iCustom(0,0,"OSCILLATOR",2,1) < 5000;


i want if bar green ==> buy

if red sell

but in this line

 bool up = iCustom(0,0,"OSCILLATOR",0,1)< 5000;

all the time show true ...!!! 

but this line work good

  bool down = iCustom(0,0,"OSCILLATOR",1,1)< 5000;

some time show true and false

how fix this problem ? 

sorry my English not good :(

Attached files:
  oscillator.ex4  (39.47 KB)
avatar
5
forex007 2015.05.27 10:10 #
 
any update ?
avatar
12985
WHRoeder 2015.05.27 12:46 #
 
  1. We humans can't read an ex4, only a mt4 and there are no mindreaders here.
  2. The first paremeter to iCustom is a string. "0" is not a string. If you want the current chart, use NULL.
  3. The second from the last is the buffer index. We can't know if buffer index 1 is correct.
  4. We can't know what values the indicator produces, so less than 5K may always be true.
  5. Detailed explanation of iCustom - MQL4 forum
avatar
5
forex007 2015.05.27 22:52 #
 
WHRoeder:
  1. We humans can't read an ex4, only a mt4 and there are no mindreaders here.
  2. The first paremeter to iCustom is a string. "0" is not a string. If you want the current chart, use NULL.
  3. The second from the last is the buffer index. We can't know if buffer index 1 is correct.
  4. We can't know what values the indicator produces, so less than 5K may always be true.
  5. Detailed explanation of iCustom - MQL4 forum

thank you for reply

and i found .mt4

how fix indicator :)

Attached files:
  oscillator.mq4  (9.62 KB)
avatar
2017
gooly 2015.05.27 23:21 #
 

replace lines 58-60 by:

   SetIndexLabel(0, "up");
   SetIndexLabel(1, "dn");
   SetIndexLabel(2, "buff-2");

Then you see and can call the values.

Back to topics list  

To add comments, please log in or register