How to get the keyboard function?? - page 2

 
phy:

To get a repaint on a tick, run back through as many bars as you want repainted. Don't limit the loop with the IndicatorCounted() value.

Hi Phy,


Thanks again for your respond.

By the way, how to do that? would you please set me up an example?


Thank you

 

Some people use the IndicatorCounted() function when setting the limits of the loop that "paints" the indicator.

   int limit;
   int counted_bars=IndicatorCounted();
//---- check for possible errors
   if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//---- main loop
   for(int i=0; i<limit; i++){
   indicator processing;

}

If you want all bars repainted on each tick, then your loop might look like this:

for(int i = Bars-1; i >= 0; i--){

   indicator processing;

}
 

Hi Phy,


Below is the indicator's main part.

The loop calculation seems complex and involve other function. I'd like to put the whole code here, but I can't because it's not mine.


extern int input = 1;
int x = -1;
 
int start() 
{
   limit = Bars - IndicatorCounted() - 1;
   
   if(now+(minuterefresh*60)<=TimeCurrent())
    {
      now=TimeCurrent();
      red();
    }
   
   while (limit > 0) 
   {
      if (input == 1) limit  -= HighFirst(limit );
      else limit -= LowFirst(limit );
      if (x >= 0) 
      {
         input = x;
         x = -1;
      }
   }
   return (0);
}

Or can we write a separate function to refresh the indicator so we can get the same effect compared to if we click on the indicator until the indicator's properties pop up and then we click ok?


Thank you.

 

So much is omitted above I have no idea what it does.

If it is "not yours" then have the creator look at it.

 
My friend got it from another programmer in ex4 file, too bad he can't contact the programmer then ask for my help.

May I have your email Phy? My friend doesn't want the code reveal in public. My email is ardian1899 at hotmail dot com.

But of course I understand if you prefer not to reveal your email.


Thank you.