Indicator not giving the previous values.

To add comments, please log in or register
jaffer wilson
766
jaffer wilson  

I am trying the following custom indicator in my expert from here: https://www.mql5.com/en/code/13229. For my analysis, I tried to gather the previous historic data but I am not able to. I am getting zeros everywhere when I tried. While I am using the strategy tester, I am able to get the data one by one, but it is damn slow process of gathering the data.    


I thought of getting the buffer of the values with 1000 candles but could not get anything. Then I tried to look at the chart and I found that the values were missing for the past. see the image:  

captured image

Kindly, help me in getting what might have caused the indicator from gathering the past data. Please let me know.

Carl Schreiber
Moderator
7069
Carl Schreiber  

Please prived the code with which you try to get the values (and fail).

May be you should put the cursor on iCustom and press F1 and then read and use the example there!

Ernst Van Der Merwe
5749
Ernst Van Der Merwe  

Updated version.

Files:
Correlate.mq5 22 kb
jaffer wilson
766
jaffer wilson  
Carl Schreiber:

Please prived the code with which you try to get the values (and fail).

May be you should put the cursor on iCustom and press F1 and then read and use the example there!

Here is the code that I am trying to retrieve the values:  

   correlate = iCustom(_Symbol,_Period,"correlate",Indicator,MA,MAPeriod,MAMethod,MAPrice,MACD,FastEMA,SlowEMA,SignalSMA,MACDPrice,
                                                   Stochastic,Kperiod,Dperiod,Slowing,PriceField,RSI,RSIPeriod,RSIPrice,CCI,CCIPeriod,
                                                   CCIPrice,RVI,RVIPeriod,DeMarker,DeMarkerPeriod,Momentum,MomentumPeriod,MomentumPrice,
                                                   TriX,TrixPeriod,TrixPrice,_,Sfix,bAUD,bCAD,bCHF,bEUR,
                                                   bGBP,bNZD,bJPY,bUSD);

void OnTick()
  {
   CopyOpen(_Symbol,_Period,0,2,o);CopyHigh(_Symbol,_Period,0,2,h);CopyLow(_Symbol,_Period,0,2,l);CopyClose(_Symbol,_Period,0,2,c);
   CopyTime(_Symbol,_Period,0,2,t); 
   CopyBuffer(correlate,0,0,2,aud);CopyBuffer(correlate,1,0,2,cad);CopyBuffer(correlate,2,0,2,chf);CopyBuffer(correlate,3,0,2,eur);
   CopyBuffer(correlate,4,0,2,gbp);CopyBuffer(correlate,5,0,2,nzd);CopyBuffer(correlate,6,0,2,jpy);CopyBuffer(correlate,7,0,2,usd);
   //aud[],cad[],chf[],eur[],gbp[],nzd[],jpy[],usd[]
   //Print(NormalizeDouble(aud[0],3),"  ",NormalizeDouble(cad[0],3),"  ",NormalizeDouble(chf[0],3),"  ",NormalizeDouble(eur[0],3),"  ",
   //      NormalizeDouble(gbp[0],3),"  ",NormalizeDouble(nzd[0],3),"  ",NormalizeDouble(jpy[0],3),"  ",NormalizeDouble(usd[0],3));
   if(newbar.IsNewBar(_Symbol,_Period))
   {
     FileWrite(file,t[1],o[1],h[1],l[1],c[1],NormalizeDouble(aud[1],3),NormalizeDouble(cad[1],3),NormalizeDouble(chf[1],3),
     NormalizeDouble(eur[1],3),NormalizeDouble(gbp[1],3),NormalizeDouble(nzd[1],3),NormalizeDouble(jpy[1],3),NormalizeDouble(usd[1],3));
   }   
  }

I have read how the iCustom works. and I am abide by how to use it. So the above code is what I tried. Please let me know if there is anything I can try.

jaffer wilson
766
jaffer wilson  
Ernst Van Der Merwe:

Updated version.

Not working my friend. I tried it but there is nothing on the screen. This is what I am seeing.

Seeing this.

jaffer wilson
766
jaffer wilson  
Can anyone please answer this question of mine I am in trouble.
Sergey Golubev
Moderator
106081
Sergey Golubev  
jaffer wilson:
Can anyone please answer this question of mine I am in trouble.

I was reading this thread but I am not a coder sorry.
I hope someone will reply.

jaffer wilson
766
jaffer wilson  
Thank you moderator sir for your reply.
Ernst Van Der Merwe
5749
Ernst Van Der Merwe  

These attached files were tested and working fine.

2018.09.03 10:38:57.474 2018.08.29 05:51:00   Buy EURUSD
2018.09.03 10:38:57.474 2018.08.29 05:51:03   Buy EURUSD
2018.09.03 10:38:57.474 2018.08.29 05:51:07   Buy EURUSD
Files:
jaffer wilson
766
jaffer wilson  
Ernst Van Der Merwe:

These attached files were tested and working fine.

Brother, I have applied the indicator. It still has the same problem that I have. The previous history is not at all with the indicator. I am trying to obtain historic data for my research in MQL5. But I do not understand why this indicator is not holding the historic data of the symbol?

Any indicator when moved backward creates historic lines for the indication for the prices.

Please let me know if there is any confusion I will try and explain it again.

Ernst Van Der Merwe
5749
Ernst Van Der Merwe  
jaffer wilson:

Brother, I have applied the indicator. It still has the same problem that I have. The previous history is not at all with the indicator. I am trying to obtain historic data for my research in MQL5. But I do not understand why this indicator is not holding the historic data of the symbol?

Any indicator when moved backward creates historic lines for the indication for the prices.

Please let me know if there is any confusion I will try and explain it again.

The problem is, with multiple symbols the indicator takes too long to load all the history and the amount of bars are not the same on the higher timeframes. That's why I limited the amount of bars to count. The attached indicator checks for the symbol with the lowest amount of bars in history, but is not always working, even when using BarsCalculated().

Files:
Correlate.mq5 25 kb
12
To add comments, please log in or register