[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 675

 

The indicator does not rewrite the comments, but adds with each measure

here is the code, this is the end of the start() function

    Var_Comment = Var_Comment + "\nТФ_" + String_TF + "  Последнее событие: " + Last_Event + "\n" + Trend_Sum_Average2;
    Comment(Var_Comment);  
//+------------------------------------------------------------------+
//----
   return(0);
}
 
valenok2003:

The indicator does not rewrite the comments, but adds with each measure

here's the code, this is the end of the start() function

Of course it does :)

Var_Comment = Var_Comment + "\nТФ_" + String_TF + "  Последнее событие: " + Last_Event + "\n" + Trend_Sum_Average2;
Try deleting this entry and it should work.
 
drknn:


If the textbook declares arrays this way, it's quite strange. Would you have highlighted with a comment the section of code that YOU contributed.

I haven't read that textbook either. And how does the author there justify the validity of this array declaration?

That's what I highlighted =) here it is:

//-------------------изменения------V---------------------------------
double Macd_M_D1=iMACD(NULL,1440,12,26,9,PRICE_CLOSE,MODE_MAIN,0);
// Вверху - обращение к МАКД расчет на дневках основной линии
double Macd_S_D1=iMACD(NULL,1440,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0);
// Это обращение к МАКД и расчет Сигнальной линии на дневках
double Macd_M_H4=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0);
// Это обращение к МАКД и расчет основной линии на текущем таймфрейме
double Macd_S_H4=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0);
// Это обращение к МАКД и расчет сигнальной линии на текущем таймфрейме
//-------------------изменения----^-----------------------------------
string Nom_Lin =Line + "_"; // Строка - номер линии
// string Nom_Lin = DoubleToStr(Line,0)+"_";// Можно и так
string Str_Time=TimeToStr(T_Bar); // Строка - время откр.

string His_Name=Prefix+Nom_Lin+Str_Time;// Имя созаваемого объект

//-------------------изменения-------V--------------------------------

if ((Macd_M_D1 < Macd_S_D1)&&(Macd_M_H4 < Macd_S_H4))Color=Blue;
if ((Macd_M_D1 > Macd_S_D1)&&(Macd_M_H4 > Macd_S_H4))Color=Red;
//
//if (O_Bar < C_Bar) Color=Blue; // Выбор цвета в зависимости..
//if (O_Bar > C_Bar) Color=Red; // .. от характеристик бара
//if (O_Bar ==C_Bar) Color=Green;
//-------------------изменения------^---------------------------------


Here it is. Seems to have done everything scientifically....

 
ToLik_SRGV:

Of course it does, you said so yourself :)

Try to delete this entry, it should work.


Thanks, that's what I missed.

Another question, how do I get the comments into the indicator window?

 
valenok2003:


Thank you, I missed that.

Another question, how do I get the comments into the indicator window?


The Comment() function is not associated with any window, there is only one place for it - the upper left corner.
To output the comments in the indicator window, you will need to use graphical objects.
 
ToLik_SRGV:

The Comment() function is not associated with any window, there is only one place for it - the top left corner.
You will have to use graphical objects to display the indicator in the window.

thanks
 
Can you advise whether it is possible to divide the opening of trades in the EA, for example, that the EA would open trades only on every second signal?
 
didivi:
Can you advise whether it is possible to divide the opening of trades in the EA, for example, that the EA would open trades only on every second signal?

Put a signal counter and set a flag on the second account to allow opening.
 
How can I see all the alerts issued by the scripts? If you have already closed the window with them. Are there any logs to keep?
 
Mathers:
How can I see all the alerts issued by the scripts? If you have already closed the window with them. Maybe they are saved in some logs?

Always saved in MetaTrader\experts\logs
Reason: