How to get all the values from an custom indicator using iCustom function

 

Hi everyone.

I'm new here posting for the first time so kindly pardon me if i may sound rude or straight forward.

I'm using an custom indicator known as Buy Sell Signal which shows two arrows: 1 when its buy signal and 2 when its sell signal. Somehow i found out the way to correctly get the value out of it using iCustom indicator but the issue is that its only showing me value when its sell signal not showing me the value when its buy signal. Somehow from data window i figured it out that it returns or whatever 2 kind of values. Please help me in getting out the value of buy signal as well as i'm new to the EA's market and been developing and testing many EA's and using mql4 for it. 

I'm posting all the necessary data for it below. Thanks. 

void OnTick()
{
   double fractal = NormalizeDouble(iCustom(NULL, 0, "Buy Sell Signal", 24, 0.25, 0, 0), Digits); //Reading value of indicator using iCustom
   Print("BSS:\t", fractal);    //Looking for values
   double actualValue;
   double uselessValue = 2147483647.0;  //useless value because it remains the same all the time just changes when there is a signal

   if(fractal != uselessValue)
      {
         actualValue = fractal; //when actual signal value comes its saves it here in actualValue
         Print("Actual Value: ", actualValue, "Symbol:\t", Symbol());
      }
}

In SS4(ScreenShot4) this is the 2nd value that i want to get as its the buy signal but i don't know how to get this. Whereas in SS6 i'm getting the sell signal each time. Kindly guide me through this.

Files:
 
Tamur Taj:

Hi everyone.

I'm new here posting for the first time so kindly pardon me if i may sound rude or straight forward.

I'm using an custom indicator known as Buy Sell Signal which shows two arrows: 1 when its buy signal and 2 when its sell signal. Somehow i found out the way to correctly get the value out of it using iCustom indicator but the issue is that its only showing me value when its sell signal not showing me the value when its buy signal. Somehow from data window i figured it out that it returns or whatever 2 kind of values. Please help me in getting out the value of buy signal as well as i'm new to the EA's market and been developing and testing many EA's and using mql4 for it. 

I'm posting all the necessary data for it below. Thanks. 

In SS4(ScreenShot4) this is the 2nd value that i want to get as its the buy signal but i don't know how to get this. Whereas in SS6 i'm getting the sell signal each time. Kindly guide me through this.

Hi again everyone. Looks like i found out the solution soon after posting the issue. 

It seems like the argument of mode it needed to be played with. I just changed the mode buffer from 0 to 1 and i started getting the buy signal values as well. Below is the updated code.

void OnTick()
{
   double fractal1 = NormalizeDouble(iCustom(NULL, 0, "Buy Sell Signal", 24, 0.25, 0, 0), Digits);
   double fractal2 = NormalizeDouble(iCustom(NULL, 0, "Buy Sell Signal", 24, 0.25, 1, 0), Digits);
   Print("BSS:\t", fractal1);
   double actualValue1;
   double actualValue2;
   double uselessValue = 2147483647.0;

   if(fractal1 != uselessValue)
      {
         actualValue1 = fractal1;
         Print("Actual Value: ", actualValue1, "Symbol:\t", Symbol());
      }
      
   if(fractal2 != uselessValue)
      {
         actualValue2 = fractal2;
         Print("Actual Value: ", actualValue2, "Symbol:\t", Symbol());
      }
}
 
Tamur Taj: testing many EA's and using mql4 for it.

Why did you post your MT4 question in the MT5 Indicators section instead of the MQL4 section, (bottom of the Root page)?
          General rules and best pratices of the Forum. - General - MQL5 programming forum?
Next time post in the correct place. The moderators will likely move this thread there soon.

 
Tamur Taj:

Hi everyone.

I'm new here posting for the first time so kindly pardon me if i may sound rude or straight forward.

I'm using an custom indicator known as Buy Sell Signal which shows two arrows: 1 when its buy signal and 2 when its sell signal. Somehow i found out the way to correctly get the value out of it using iCustom indicator but the issue is that its only showing me value when its sell signal not showing me the value when its buy signal. Somehow from data window i figured it out that it returns or whatever 2 kind of values. Please help me in getting out the value of buy signal as well as i'm new to the EA's market and been developing and testing many EA's and using mql4 for it. 

I'm posting all the necessary data for it below. Thanks. 

In SS4(ScreenShot4) this is the 2nd value that i want to get as its the buy signal but i don't know how to get this. Whereas in SS6 i'm getting the sell signal each time. Kindly guide me through this.

If I see well, buffer 0 is sell and buffer 1 is buy.

Then why don't declare 2 variables like this :

//Reading sell value of indicator using iCustom
double fractal_sell = NormalizeDouble(iCustom(NULL, 0, "Buy Sell Signal", 24, 0.25, 0, 0), Digits); 

//Reading buy value of indicator using iCustom
double fractal_buy = NormalizeDouble(iCustom(NULL, 0, "Buy Sell Signal", 24, 0.25, 1, 0), Digits); 

and do calculation on it ?