Download MetaTrader 5

Desperate Trying to get Indicator with Icustom

To add comments, please log in or register
noname2
17
noname2  
Hi guys, i have finish many EAs for learning purpose using iCustom, but this time i couldn't make it work ! i Have no idea why. The Indicator show correct value on Data Window but when i use iCustom i get EMPTY_VALUE , no changes at all.I even tried to read Bars[4,3,2,1] But it's the same , it's stay Constant Empty Valule !

Here the Indicator and my iCustom Code

   double UP = iCustom(Symbol(),Period(),"ds_HDiv_OsMA_01",fastEMA,slowEMA,signalEMA,RightBars,LeftBars,MaxFanSize,5,1);
   double DOWN = iCustom(Symbol(),Period(),"ds_HDiv_OsMA_01",fastEMA,slowEMA,signalEMA,RightBars,LeftBars,MaxFanSize,6,1);

Thanks for any help !
Files:
whroeder1
15925
whroeder1  
noname2: , it's stay Constant Empty Valule !
double UP   = iCustom(Symbol(),Period(),"ds_HDiv_OsMA_01",fastEMA,slowEMA,signalEMA,RightBars,LeftBars,MaxFanSize,5,1);
double DOWN = iCustom(Symbol(),Period(),"ds_HDiv_OsMA_01",fastEMA,slowEMA,signalEMA,RightBars,LeftBars,MaxFanSize,6,1);
  1. Of course, all you should ever get with those calls is EMPTY_VALUE.

    You are trying to read Buy[1], but the smallest variable p ever is 1+FractRightBars.
       for(p=1+FractRightBars; p<limit; p++)
         {
          if(FrUpBuffer[p]!=0)
            {
             int count=0;
             for(i=FractLeftBars+p; i<Bars; i++)
               {
                if(FrUpBuffer[i]!=0)
                  {

                   if((FrUpBuffer[i]<FrUpBuffer[p]) && (High[i]>High[p]))
                     {
                      DrawIndicatorTrendLine(Time[i],Time[p],OsmaBuffer[i],OsmaBuffer[p],Red,2);
                      Buy[p] = OsmaBuffer[p];

  2. You should write a self documenting function instead of calling iCustom directly, see Detailed explanation of iCustom - MQL4 forum
  3. Why did you post in the MT5/EA forum with your MT4 code?
noname2
17
noname2  
whroeder1:
  1. Of course, all you should ever get with those calls is EMPTY_VALUE.

    You are trying to read Buy[1], but the smallest variable p ever is 1+FractRightBars.
       for(p=1+FractRightBars; p<limit; p++)
         {
          if(FrUpBuffer[p]!=0)
            {
             int count=0;
             for(i=FractLeftBars+p; i<Bars; i++)
               {
                if(FrUpBuffer[i]!=0)
                  {

                   if((FrUpBuffer[i]<FrUpBuffer[p]) && (High[i]>High[p]))
                     {
                      DrawIndicatorTrendLine(Time[i],Time[p],OsmaBuffer[i],OsmaBuffer[p],Red,2);
                      Buy[p] = OsmaBuffer[p];

  2. You should write a self documenting function instead of calling iCustom directly, see Detailed explanation of iCustom - MQL4 forum
  3. Why did you post in the MT5/EA forum with your MT4 code?


Thanks for getting back



1. I tried another previous bars too , no luck. The FrUpBuffer and FrDownBuffer won't show result either

2. I will read and try that, then will inform you if it work

3. I did try to go to MQL4  it redirected me to this forum, so i thought it's the same with new name now !
To add comments, please log in or register