I can't get the indicator value- urgent

 

Hi, i'm having a problem, and i cant get this indicator value, on journal, the value isn't compatible with 

buffer 0, could anyone help me, i don't have any idea why the value is different, thanks.


int alert;

void OnTick()
  {

double fxfish= iCustom (NULL,0,"FX Fish",10,0,false,false,0,0);

if (alert==0)
{
Alert( fxfish);
alert=1;
}
   
  }
Files:
FX_Fish.mq4  4 kb
 
What do you mean it is not compatible?
 

the value is different from what i see on the chart compared to the journal, on the alert of the first candle of the day



 

Check that the indicator does not repaint.

You could take a screenshot at the same time as the alert is created.

I guess that the alert is created at the open of the bar, but you are looking at the value at the close of the bar.

 
you're right it repaints, even 10 candles back, but repaints just a little,  so what to do now?
 
Freelance service at MQL5.com
Freelance service at MQL5.com
  • www.mql5.com
Orders for the development of automated trading programs
 
i see, thank you for help
 
mrluck1:
you're right it repaints, even 10 candles back, but repaints just a little,  so what to do now?

Ditch the indicator. Any indicator that repaints closed bars is normally useless for real-time trading. It just looks good on historical bars.
Reason: