Output indicator values to screen

To add comments, please log in or register
Russ
218
Russ  

I have two indicators that I believe might be sending different values to the platform than what they are showing on the indicator window. Can someone add code to my indicators that will output the values that they're sending to the platform?

Thanks.

Files:
William Roeder
20001
William Roeder  
russmt4:
add code to my indicators

You already have what you need (control-d) opens the data window and you have the values.

What you probably need is to verify what the EA is getting via iCustom.

Since there are no slaves here, there are only two choices: learn to code and add some Print() statments or pay someone. We're not going to code it FOR you. We are willing to HELP you.
Russ
218
Russ  

WHRoeder , thanks for responding. While I can appreciate your sentiment; you may have gone a tad bit overboard equating a line of code to slavery. I tried to add a comment line to the end of the indicator code. Something like this: Comment("buffer 0 is" + BUFFER0[i] + " buffer 1 is " + BUFFER1[i]);

I'm just not sure how to correctly name the buffers. I have paid for quite a few jobs in the jobs section of the mql5 site, including the EA I had built for these indicators. I was told the EA might not be pulling the values from the buffers, so the data window is moot. I've never minded paying for code, i just want to know what the issue is before I take it back to the job section to get it recoded.

Could you elaborate on "What the EA is getting via iCustom", if you don't mind?

Thanks.

Simon Gniadkowski
17202
Simon Gniadkowski  
russmt4:

Could you elaborate on "What the EA is getting via iCustom", if you don't mind?

Thanks.

Your EA can get buffer values from an Indicator using the function iCustom() in the iCustom call you pass some parameters, symbol, timeframe, Indicator name, Indicator extern parameters, buffer number and shift . . . then you get back the Indicator Buffer value you asked for . . .

You have posted 2 Indicator in your first post . . . they both have 2 buffers each . . . in the first they are imaginatively named . . . UpBuffer and DownBuffer

   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,  UpBuffer  );

   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,  DownBuffer  );

In the second they are helpfully called . . . Buffer1 and Buffer2

  SetIndexBuffer(0,  Buffer1  );
  SetIndexBuffer(1,  Buffer2  );

You should add Print statements to your EA code for the iCustom calls so you can see what is going on and being returned . . . if you need to add then you should have words with your Developer and ask why they didn't add this functionality to your EA as a matter of course as some find of debugging.

Russ
218
Russ  

RaptorUK I really appreciate you responding and explaining things to me.

Simon Gniadkowski
17202
Simon Gniadkowski  
russmt4:

RaptorUK I really appreciate you responding and explaining things to me.

You are welcome, hope it helped. :-)
onewithzachy
1863
onewithzachy  

Hi russmt4,

I've checked the FF link you gave (https://www.mql5.com/en/forum/7089), and download the indy from there too - a little different than yours though. I think that user in FF was making mistake in calling the iCustom () from his EA. So his EA value differs from the indy. I don't see any differs from value shown the indy windows and MT data window.

Anyway on your trendy, scroll down to bottom and add this just before return (0), like this (I highlighted what you have to add)

      DownBuffer[shift]=NormalizeDouble(downtotal/indietotal,6)*100;
        
   }
   Comment ("\n",WindowExpertName()," Up ",DoubleToStr (UpBuffer[0], Digits),". Down ",DoubleToStr (DownBuffer[0], Digits) );
   return(0);
  }

same thing on Mod Tredy MTF, just different syntax,

   }
//
//==============================
   Comment ("\n",WindowExpertName()," Up ",DoubleToStr (Buffer1[0], Digits),". Down ",DoubleToStr (Buffer2[0], Digits) );
        return(0);
}

bool isNewBar(

That will show values from bar 0, if you want to see value from bar 7, change the number in[0] into [7], got it ?

Anyway you can only see one comment from one source only, so if you attach both indy, you may only see comment from either trendy or mod trendy mtf.

:D

Russ
218
Russ  

Thanks alot onewithzachy. I'm going to have my coder check and see where the EA is pulling its value from.

To add comments, please log in or register