Download MetaTrader 5

I can't get the indicator value- urgent

To add comments, please log in or register
mrluck1
902
mrluck1  

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
Keith Watford
Moderator
10541
Keith Watford  
What do you mean it is not compatible?
mrluck1
902
mrluck1  

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



Keith Watford
Moderator
10541
Keith Watford  

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.

mrluck1
902
mrluck1  
you're right it repaints, even 10 candles back, but repaints just a little,  so what to do now?
Marco vd Heijden
Moderator
5957
Marco vd Heijden  
Freelance service at MQL5.com
Freelance service at MQL5.com
  • www.mql5.com
Orders for the development of automated trading programs
mrluck1
902
mrluck1  
i see, thank you for help
Keith Watford
Moderator
10541
Keith Watford  
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.
To add comments, please log in or register