Errors, bugs, questions - page 1165

 

Hello. Need some help. Can anyone suggest how to reduce the font size on the strategy tester chart so that it doesn't cover the chart and fits entirely on the chart, like in the picture below (option 2):

 
Akromix:

Hello. Need some help. Can anyone suggest how to reduce the font size on the strategy tester chart so that it doesn't cover the chart and fits entirely on the chart, like in the picture below (option 2):

Try selecting the standard system font size in the Windows settings, or even reducing it.
 
marketeer:
Try selecting the standard system font size in the Windows settings, or even reducing it.
This change only reduces the font with the name of the terminal window, but the font is not reduced in the tester graphic.
 
barabashkakvn:

When committing changes in MQL5 Storage, error 170004 occurred. This is the second time I've seen this.

I guess I need to update before committing.
 
TheXpert:
Well apparently you have to update before you commit.
Is this a prescription? Does it help? Just updated from storage in the morning, then worked for half a day and here's the error#170004 when committing.
 
barabashkakvn:
Is this a prescription? Does this kind of thing help? Just updated from repository in the morning, then worked for half a day and here at fixing such error#170004.
Well, if it says that the repository is not up to date, then it is logical to try to update it.
 
TheXpert:
Well, if it says that the repository is out of date, then it's logical to try to update it.
It feels like another computer updated my repository while I was working. I of course tried updating after the error occurred. Didn't help.
 

More of a question:

Looking for an existing GV of the terminal by name. Through it the ID of the chart on which the EA is running is passed to the indicator. The indicator hangs on another symbol. I.e., I want to pass to the indicator the ID of the chart the Expert Advisor is running on. I am looking for it like this:

   for(int i=0; i<GlobalVariablesTotal(); i++) {
      string gv_name=GlobalVariableName(i);
      if(StringFind(gv_name,"Multick")<0) continue;
      if(StringFind(gv_name,"chart_id")>0) {
         Print("Нашли такую переменную: "+gv_name);
         string xxx=IntegerToString(long(GlobalVariableGet(gv_name)));
         Print("Значение в ней = "+xxx);
         }
      }
   //2014.07.05 01:54:06.111    ChartsAgent NZDUSD,H1: ID главного = 130392553686025168
   //                                                а истинный ID = 130392553686025170

This is what the terminal tells me:


I tried to read the variable. I put it directly to the string and put it to the journal, as well as in variables of different types - all the same. It's two different.

What's wrong?

 
artmedia70:

More like a question:

What's wrong?

I'd also like to see the code that writes to the variable (especially when and how often it happens).
 
marketeer:
I'd also like to see the code that writes to the variable (especially when and how often it happens).

Simple. In OnInit()

   symbol=Symbol();
   tf=Period();
   other.initNames(symbol,tf,Prefix,Magic);  // Создаём префикс и магик

// -------------------------------------------------------------

//----------------------------
   string gv_chart_id_name=Prefix+"_chart_id";
   long chart_id=get.GetChartID(symbol);
   if(chart_id>=0) GlobalVariableSet(gv_chart_id_name,chart_id); // chart_id==0 в тестере
   else graph.Message("Чё-та нету chart_id : Symbol()="+symbol+", chart_id="+IntegerToString(chart_id));
//----------------------------

// -------------------------------------------------------------

//+------------------------------------------------------------------+
   void COtherClass::initNames(string sy, int timeframe, string &prefix, int &mn) {
      string postf="_r", nm=WindowExpertName();
      if(IsDemo()) postf="_d";
      if(IsTesting()) postf="_t";
      if(IsVisualMode()) postf="_v";
      if(IsOptimization()) postf="_o";
      prefix=nm+"_"+sy+"-"+get.GetNameTF(timeframe)+postf;  
      mn=GetMagic(nm+sy,Period()); 
      }
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
   long CGetDataClass::GetChartID(string sy) {
      long id=-1, currChart,prevChart=ChartFirst();
      int i=0,limit=300;
      if(ChartSymbol(prevChart)==sy) id=prevChart;
      else {
         while(i<limit) {
            currChart=ChartNext(prevChart); 
            if(currChart<0) break;          
            if(ChartSymbol(currChart)==sy) {
               id=currChart;
               break;
               }
            prevChart=currChart;
            i++;
            }
         }
      return(id);
   }
//+------------------------------------------------------------------+

Something like this ...