Help needed with indicator that will not refresh

To add comments, please log in or register

Hi There.

I made this indicator which works OK on historical charts, but will not refresh when new ticks come along. The only way I can get it to refresh is to switch time frames. 

Any help would be greatly appreciated 




 #property  copyright "Copyright © 2004, MetaQuotes Software Corp."

#property  link      ""

#property  indicator_separate_window

#property  indicator_buffers 1

#property  indicator_color1  Silver

#property  indicator_width1  2

double     Buffer[];

 int period = 15;

 int Mode = 0;           // 0= MA, 1=EMA, 2=SMMA, 3=LWMA

 int Price = 5;    //0=Close, 4=Median, 5=Typical, 6=Weighted

 int init()











  int deinit()





 int start()



   int limit;

   int counted_bars=IndicatorCounted(); 

   if(counted_bars>0) counted_bars--;


   for(int i=0; i<limit; i++)




     Buffer[i]= iClose("EURJPY",0,i) - (iClose("AUDUSD",0,i) *     

                (iMA("EURJPY",0,period,0,Mode,Price,i+1) / iMA("AUDUSD",0,period,0,Mode,Price,i+1)));






MetaTrader 5 Trading Platform / MetaQuotes Software Corp.
MetaTrader 5 trading platform designed to arrange brokerage services in Forex, CFD, Futures, as well as equity markets
To add comments, please log in or register