[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 241

 

Hello Dear forum members!!!

If it's not too much trouble, can you give me a hint?

There is such an indicator

signalTable.mq4

located
https://www.mql5.com/ru/code/8179
I decided at my leisure to remake it for me........The error
'\end_of_program' - unbalanced left parenthesis	C:\Program Files\MetaTrader - Alpari\experts\indicators\signalTable_v1.mq4 (114, 1)
keeps appearing during compilation

114 line - it's clear, but the FIRST KNOWLEDGE as it is not very

Maybe someone will suggest a sensible .......

The code itself is below. (I decided to replace SAR with MACD)

//----
#property indicator_chart_window
extern int scaleX=20,
           scaleY=20,
           offsetX=35,
           offsetY=20,
           fontSize=20,
           corner=2,
           symbolCodeBuy=67,
           symbolCodeSell=68,
           symbolCodeNoSignal=73;
extern color signalBuyColor=Gold,
             signalSellColor=MediumPurple,
             noSignalColor=WhiteSmoke,
             textColor=Gold;
int period[]={1,5,15,30,60,240,1440,10080,43200};
string periodString[]={"M1","M5","M15","M30","H1","H4","D1","W1","MN1"},
       // создаем еще один массив с названиями индикаторов
       signalNameString[]={"MA","WPR","MACD"};
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {
   // таблица сигналов
   for(int x=0; x<9; x++)
      for(int y=0; y<3; y++)
        {
         ObjectCreate("signal"+ x+ y,OBJ_LABEL,0,0,0,0,0);
         // изменяем угол привязки
         ObjectSet("signal"+ x+ y, OBJPROP_CORNER, corner);
         ObjectSet("signal"+ x+ y, OBJPROP_XDISTANCE, x* scaleX+ offsetX);
         ObjectSet("signal"+ x+ y, OBJPROP_YDISTANCE, y* scaleY+20);
         ObjectSetText("signal"+ x+ y,CharToStr( symbolCodeNoSignal),
                       fontSize,"Wingdings", noSignalColor);
        }
   // названия таймфреймов    
   for( x=0; x<9; x++)
     {
      ObjectCreate("textPeriod"+ x,OBJ_LABEL,0,0,0,0,0);
      // изменяем угол привязки      
      ObjectSet("textPeriod"+ x, OBJPROP_CORNER, corner);
      ObjectSet("textPeriod"+ x, OBJPROP_XDISTANCE, x* scaleX+ offsetX);
      ObjectSet("textPeriod"+ x, OBJPROP_YDISTANCE, offsetY-10);
      ObjectSetText("textPeriod"+ x, periodString[ x],8,"Tahoma", textColor);
     }
   // названия индикаторов 
   for( y=0; y<3; y++)
     {
      ObjectCreate("textSignal"+ y,OBJ_LABEL,0,0,0,0,0);
      // изменяем угол привязки      
      ObjectSet("textSignal"+ y, OBJPROP_CORNER, corner);
      ObjectSet("textSignal"+ y, OBJPROP_XDISTANCE, offsetX-25);
      ObjectSet("textSignal"+ y, OBJPROP_YDISTANCE, y*( scaleY)+ offsetY+8);
      ObjectSetText("textSignal"+ y, signalNameString[ y],8,"Tahoma", textColor);
     }
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   for(int x=0; x<9; x++)
     {
      // сигнал на покупку
      if(iMA(Symbol(), period[ x],13,0,0,0,0)>iMA(Symbol(), period[ x],24,0,0,0,0))
         ObjectSetText("signal"+ x+"0",CharToStr( symbolCodeBuy), fontSize,"Wingdings", signalBuyColor);
      // сигнал на продажу   
      else if(iMA(Symbol(), period[ x],13,0,0,0,0)<iMA(Symbol(), period[ x],24,0,0,0,0))
          ObjectSetText("signal"+ x+"0",CharToStr( symbolCodeSell), fontSize,"Wingdings", signalSellColor);
     }
   for( x=0; x<9; x++)
     {
      // сигнал на покупку
      if(MathAbs(iWPR(Symbol(), period[ x],13,0))<20.0)
         ObjectSetText("signal"+ x+"1",CharToStr( symbolCodeBuy), fontSize,"Wingdings", signalBuyColor);
      // сигнал на продажу   
      else if(MathAbs(iWPR(Symbol(), period[ x],13,0))>80.0)
            ObjectSetText("signal"+ x+"1",CharToStr( symbolCodeSell), fontSize,"Wingdings", signalSellColor);
      // нет сигнала
      else
           ObjectSetText("signal"+ x+"1",CharToStr( symbolCodeNoSignal), fontSize,"Wingdings", noSignalColor);
     }
   for( x=0; x<9; x++)
     {
      // сигнал на покупку
      if(iMACD(Symbol(), period[ x],(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)<Close[0])
         ObjectSetText("signal"+ x+"2",CharToStr( symbolCodeBuy), fontSize,"Wingdings", signalBuyColor);
      // сигнал на продажу   
      else if(iMACD(Symbol(), period[ x],(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)>Close[0])
         ObjectSetText("signal"+ x+"2",CharToStr( symbolCodeSell), fontSize,"Wingdings", signalSellColor);
     }
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int deinit()
  {
   // при удалении нашего индикатора нужно удалить все объекты,
   // которые мы уже создали
   ObjectsDeleteAll();
   return(0);
  }
//+------------------------------------------------------------------+
 
dmmikl86 >> :

How do I assign names to buffers in custom indicators?


SetIndexLabel(int index, string label);

 
igrok2008 >> :

Hello Dear forum members!!!

If it's not too much trouble, can you give me a hint?

There is such an indicator

located I decided at some point to rearrange it for me........I keep getting an error during compilation

114 line - it's clear, but the FIRST KNOWLEDGE as it is not very

Maybe someone will suggest a sensible .......

The code itself is below. (decided to replace the SAR to the MACD)

      if(iMACD(Symbol(), period[ x],(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)<Close[0]))
         ObjectSetText("signal"+ x+"2",CharToStr( symbolCodeBuy), fontSize,"Wingdings", signalBuyColor);
      // сигнал на продажу   
      else if(iMACD(Symbol(), period[ x],(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)>Close[0]))
         ObjectSetText("signal"+ x+"2",CharToStr( symbolCodeSell), fontSize,"Wingdings", signalSellColor);

in the first and third line, pay attention to the last closing parenthesis - you have them missing

 

Thank you very much alsu, but the 114th line is

      if(MathAbs(iWPR(Symbol(), period[ x],13,0))<20.0)
         ObjectSetText("signal"+ x+"1",CharToStr( symbolCodeBuy), fontSize,"Wingdings", signalBuyColor);
      // сигнал на продажу   
      else if(MathAbs(iWPR(Symbol(), period[ x],13,0))>80.0)
            ObjectSetText("signal"+ x+"1",CharToStr( symbolCodeSell), fontSize,"Wingdings", signalSellColor);
      // нет сигнала
      else                                      это114 строка
           ObjectSetText("signal"+ x+"1",CharToStr( symbolCodeNoSignal), fontSize,"Wingdings", noSignalColor);
so when you compile, the link goes to that line, that's what's wrong with.........................................
 

Greetings all!

I've been thinking for a long time, so I decided to ask for help from the experts.

Especially since the question is a trivial one, as I see it.

I think you can handle it. :)

Here's the deal.

There is an exel-file. Cells contain data. (I will try to be as literate as possible).

kolo/6895.jpg

kolo/6896.jpg

kolo/6897.jpg

kolo/7353.jpg

kolo/8899.jpg

....

etc.

How can I make it work with Find/Replace?

kolo/6895.jpg,kolo/6895.jpg,kolo/6895.jpg

kolo/6896.jpg,kolo/6896.jpg,kolo/6896.jpg

kolo/7353.jpg,kolo/7353.jpg,kolo/7353.jpg

kolo/8898.jpg,kolo/8898.jpg,kolo/8898.jpg

kolo/6899.jpg,kolo/6899.jpg,kolo/6899.jpg

there's so much to write about..... :)

Thanks so much for the tip!


 
Sokil >> :

Greetings all!

I've been thinking for a long time, so I decided to ask for help from the experts.

Especially since the question is a trivial one, as I see it.

I think you can handle it. :)

Here's the deal.

There is an exel-file. Cells contain data. (I will try to be as literate as possible).

kolo/6895.jpg

kolo/6896.jpg

kolo/6897.jpg

kolo/7353.jpg

kolo/8899.jpg

....

etc.

How can I make it work with Find/Replace?

kolo/6895.jpg,kolo/6895.jpg,kolo/6895.jpg

kolo/6896.jpg,kolo/6896.jpg,kolo/6896.jpg

kolo/7353.jpg,kolo/7353.jpg,kolo/7353.jpg

kolo/8898.jpg,kolo/8898.jpg,kolo/8898.jpg

kolo/6899.jpg,kolo/6899.jpg,kolo/6899.jpg

there's so much to write about..... :)

Thanks so much for the good advice!



You have to duplicate the content three times and separated by comma. The easiest way to do it is to use formula =RC[-1]&","&RC[-1]&","&RC[-1]".

You can then copy the cells and paste the contents as values.

 
Thanks, that's a thought!
 

How about making the task more difficult?

Got it: kolo/6895.jpg

Do: kolo/6895.jpg,kolo/6895.jpg,kolo/6895_.jpg

=RC[-1]&","&RC[-1]&","&RC[-1]" is no good here as far as I'm concerned.

 
For some instruments, e.g. EUR/USD, the quotes are 5 decimal places. But in my environment variables, the values have only 4 digits. How can I get the full value of the environment variables?
 
Sokil >> :

How about making the task more difficult?

Got it: kolo/6895.jpg

Do: kolo/6895.jpg,kolo/6895.jpg,kolo/6895_.jpg

=RC[-1]&","&RC[-1]&","&RC[-1]" will not help here as far as I understand


What's the complication?

There are at least two options, the first is to remove the ".jpg" and then add it in the formula, the second one in longer formula like =RC[-1]&","&RC[-1]&","&LEVSIMV(RC[-1]; DLSTR(RC[-1])-4)&"_"&PRAWSIMW(RC[-1];4), if needed you can look for the separator through find, or an elementary loop is done through VBA altogether.

There is a solution for every problem, but the problem must be set precisely.

Reason: