Download MetaTrader 5

Indicator returning 0 as value

To add comments, please log in or register
flexea
120
flexea  

I can't seem to distinguish between red or green bars that this indicator displays.

MFIGreen = iCustom(NULL, 15, "__MFI Meter", 0, 1);

MFIRed = iCustom(NULL, 15, "__MFI Meter", 1, 1); 


Both these just return 0 when Printing them to journal. Any idea how I can return something to distinguish between green and red?

Files:
Keith Watford
Moderator
9642
Keith Watford  

As there seem to be 100 buffers in the indicator, it is difficult to work out what is going on.


   for (int x=0;x<100;x++)
   {
   double MFIGreen = iCustom(NULL, 15, "__mficmeter", x, 1);
   if(MFIGreen>0)
      Print("Indicator=",MFIGreen," Buffer=",x);
   }

Try this for different bars and you may be able to work out what is going on

flexea
120
flexea  
GumRai:

As there seem to be 100 buffers in the indicator, it is difficult to work out what is going on.


Try this for different bars and you may be able to work out what is going on

2016.03.25 21:01:05.654    2016.01.04 05:32  EA USDCAD,H4: Indicator=1 Buffer=91

2016.03.25 21:01:05.389    2016.01.04 03:50  EA USDCAD,H4: Indicator=1 Buffer=41


Hmm it just returns either buffer 91 or 41

To add comments, please log in or register