Download MetaTrader 5

Problem with a custom indicator (won't refresh it self automaticly...)

To add comments, please log in or register
Karish
138
Karish  

TOPIC,

please help if you can, godbless

Files:
iz.mq4 5 kb
whroeder1
15554
whroeder1  
Karish: won't refresh it self automaticly...
  1.       ma_future= iMA(NULL, 0,MA, -1, 2, PRICE_CLOSE,i);
    You can't look at the future when i == 0.
  2. Basing an indicator that looks at future bars is called repainting. Useless for trading.
  3. You look back 9 bars, so do your look back correctly
    // if(counted_bars>0) counted_bars--; unnecessary Contradictory information on IndicatorCounted() - MQL4 forum
    //----
    // limit=bars-counted_bars;               no look back
       limit=bars-MathMax(9,counted_bars); // look back = 9
    //   for(i=0; i<=limit; i++)              when counted=0 you access High[Bars]
    //                                        array exceeded, indicator dies.
         for(i=1; i< limit; i++)
         {
          counter=i;
          Range=0;
          AvgRange=0;
          for(counter=i ;counter<=i+9;counter++)
            {
             AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);
Karish
138
Karish  

WHRoeder,

thank you for your replay, i still can't solve this problem though.., can you maybe upload the complete fixed code for me please if you can

i did tried to change those things you highlighted but now it won't show any arrows until i switch TFs...

 

thank you again, hope to hear from you soon.

Karish
138
Karish  
someone please..?
Karish
138
Karish  
still cant get it to work properly please can someone post the right code..?, thank you
To add comments, please log in or register