Coding help - page 684

 
bilbao:

dear mladen

this ma indicator have little bug

could you fix it?

kind regard 

 

 

sometimes draw wrong line similar this picture

Hi  bilbao, is it non repainting 
 
shiva12:
Hi  bilbao, is it non repainting 

hi

it's only 2 ma but only draw line

perfect for busy chart's

 

 
bilbao:

hi

it's only 2 ma but only draw line

perfect for busy chart's

 

so you mean its a non repainting but , i have seen sometimes its not updating 
 
mladen:
One thing might prevent that : checking all the symbols for ranges on each and every tick is going to be (does not matter how it is made) a burden for the terminal that can prevent normal terminal work. It is not difficult to make it display some text(s), but checking all that on each tick does not have a "fast way" (even when the minimal checking is used)

need similar this:

 

 
bilbao:

need similar this:

 

I know

But you specifically asked for "all the symbols". I have tried to tell what will happen when you try to do that for all the symbols. For limited list of symbols there is no such a problem. Now you decide : is it going to be a limited list of symbols (which can work with less CPU burden) or "all the symbols" (which is almost sure to make your terminal slow down like crazy)

 

Since if it is for the limited list of symbols, it is as simple as this :

#property indicator_chart_window
#property indicator_buffers 0

extern string Symbols="EURUSD;EURJPY;GBPUSD;GBPJPY;USDJPY";;

//------------------------------------------------------------------
//
//------------------------------------------------------------------
string aSymbols[];
int init()
{
   Symbols = StringTrimLeft(StringTrimRight(Symbols));
   if (StringSubstr(Symbols,StringLen(Symbols)-1,1) != ";")
                    Symbols = StringConcatenate(Symbols,";");

         //
         //
         //
         //
         //
   
         int s=0,i=StringFind(Symbols,";",s);
         string current;
         while (i > 0)
         {
            current = StringSubstr(Symbols,s,i-s);
               ArrayResize(aSymbols,ArraySize(aSymbols)+1);
                           aSymbols[ArraySize(aSymbols)-1] = current;
                           s = i + 1;
                           i = StringFind(Symbols,";",s);
         }
   return(0);
}
int start()
{
   string comment="";
   for (int i=0; i<ArraySize(aSymbols); i++)
      comment = comment+aSymbols[i]+" "+(string)((iHigh(aSymbols[i],PERIOD_D1,0)-iLow(aSymbols[i],PERIOD_D1,0))/MarketInfo(aSymbols[i],MODE_POINT))+" points\n";
      Comment(comment);
   return(0);
}
 

Dear mladen seems be to good enough if its a non repainting  , but not updating and forming additional lines, originally submitted  by  bilbao....

 please try to rectify 

Files:
LineMA.mq4  4 kb
 
shiva12:

Dear mladen seems be to good enough if its a non repainting  , but not updating and forming additional lines, originally submitted  by  bilbao....

 please try to rectify 

This is just a quick and dirty fix
Files:
LineMA.mq4  4 kb
 
mladen:
This is just a quick and dirty fix
ohhh thanks alot  dear master
 
mladen:

Since if it is for the limited list of symbols, it is as simple as this :

thanks a lot mladen