Errors, bugs, questions - page 1290

 
Tapochun:
Thank you, I understand that OnTrade() and OnTradeTransaction() cannot be used anyway?
You understand correctly. You can't.
 

1. Why when I change the language on one terminal, it changes on all the others after restarting them?

In detail: I have 10 MT4/765 terminals running, I changed the language in one of them from Russian to English and restarted it. After restarting the other terminals, their language also changes!

2. Why is the profile not automatically remembered when I change it - settings of indicators, Expert Advisors, charts?

To be specific: Yesterday I configured a profile, traded on it, and today it got blacked out and when I restarted the terminals, no changes were saved and only the ones I had before changes were downloaded.
It would be a good idea to automatically remember the profile after a certain time, e.g. every 10 minutes or every 1 hour.

 
Novikov:

2. Why is the profile not automatically remembered when changes are made to it - indicator settings, Expert Advisors, charts?

The profile is saved when you close the application normally.
If you need to save it, close the terminal and reopen it, then you will be happy :)
 
fyords:
The profile is saved when you close the application normally.
If you need to save it, close the terminal and reopen it, then you will be happy :)

"what would I do without you" :)

3. Where do the quotes go?

When I download m1 quotes to build RENCO charts, after an incorrect shutdown of the terminal (power outage), the quotes have to be reloaded!

 
why is it that when you access another person's profile from an android mobile, there is no button to write a message? of the messages, you have to type in the username of the new correspondent .... this is very inconvenient...
 
Novikov:

"what would I do without you" :)

3. Where do the quotes go?

I download m1 quotes to build RENCO charts, but after the terminal terminates incorrectly (power outage), the quotes have to be reloaded!

you are told that all changes are saved with the correct shutdown .... including downloaded quotes
 

I understand that a structure member cannot be used as an indicator buffer, for example like this:

struct Buffers
{
    double buffer [];
};

but then what to do if you need several dozens of buffers and it doesn't work like this:

struct Buffers
{
    double buffer [];
};

Buffers IndBuff;

void Func()
{
  IndBuff[0].buffer[0]=3.1415926;
}
 
paladin800:
Yeah, I stumbled across this function too. I can't figure out how to make one variable in external parameters as 4AM and the other as 5PM and then just compare the result of TimeGMT() with them.

Haven't looked in for a while.

4AM is 04:00
5PM is 17:00

 
joo:

It is my understanding that a structure member cannot be used as an indicator buffer, e.g:

Can
 
joo:

I understand that a structure member cannot be used as an indicator buffer, for example like this:

But what to do if you need several dozens of buffers and it does not work like this:

I found such example from not unknown author. )

//+------------------------------------------------------------------+
//|                                                  EMA_Rainbow.mq5 |
//|                                       Copyright 2012, MetaDriver |
//|                                            MetaDriver@rambler.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaDriver"
#property link      "MetaDriver@rambler.ru"
#property version   "1.00"
//---
#define  CountLine  50
//---
#property indicator_chart_window
#property indicator_buffers CountLine
#property indicator_plots   CountLine

//--- Внешние параметры
input int   FastPeriod   =5;
input int   PeriodStep   =5;
input color FastColor    =clrAqua;
input color MiddleColor  =clrDodgerBlue;
input color SlowColor    =clrBlue;
input color LFastColor   =clrYellow;
input color LMiddleColor =clrOrange;
input color LSlowColor   =clrOrangeRed;
//--- 
struct SBuffer
  {
   double            B[];
  };
//--- indicator buffers
SBuffer       EmaBuffer[CountLine];
//---
color Colors[CountLine];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   InitColors();
//---
   for(int i=0; i<CountLine; i++)
      InitBuffers(i);
//---
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int    rates_total,
                const int    prev_calculated,
                const int    begin,
                const double &price[])
  {
//---
   int limit=rates_total-prev_calculated;
//---
   if(limit==1)
      limit++;
//---
   if(prev_calculated==0)
     {
      limit-=begin+1;
      for(int i=0; i<CountLine; i++)
         EmaBuffer[i].B[limit]=price[limit];
     }
//---
   if(limit!=0)
     {
      for(int i=0; i<CountLine; i++)
        {
         double p=2./(FastPeriod+PeriodStep*(CountLine-i)+1);
         //---
         for(int j=limit-1; j>=0; j--)
            EmaBuffer[i].B[j]=price[j]*p+EmaBuffer[i].B[j+1]*(1.-p);
        }
     }
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
//| Инициализация цветных буферов                                    |
//+------------------------------------------------------------------+
void InitColors()
  {
   int Half=CountLine/2;
//---
   for(int i=0; i<Half; i++)
     {
      if(i%4==3)
         Colors[i]=MixColor(LSlowColor,LMiddleColor,i*1.0/Half);
      else
         Colors[i]=MixColor(SlowColor,MiddleColor,i*1.0/Half);
     }
//---
   for(int i=Half; i<CountLine; i++)
     {
      if(i%4==3)
         Colors[i]=MixColor(LMiddleColor,LFastColor,(i-Half)*1.0/Half);
      else
         Colors[i]=MixColor(MiddleColor,FastColor,(i-Half)*1.0/Half);
     }
  }
//+------------------------------------------------------------------+
//| Определение цвета                                                |
//+------------------------------------------------------------------+
color MixColor(color A,color B,double mix)
  {
   int r = (int)MathRound((B     & 0xFF) * mix + (A     & 0xFF) * (1. - mix));
   int g = (int)MathRound((B>>8  & 0xFF) * mix + (A>>8  & 0xFF) * (1. - mix));
   int b = (int)MathRound((B>>16 & 0xFF) * mix + (A>>16 & 0xFF) * (1. - mix));
   return color(r|g<<8|b<<16);
  }
//+------------------------------------------------------------------+
//| Инициализация индикаторных буферов                               |
//+------------------------------------------------------------------+
void InitBuffers(int index)
  {
   SetIndexBuffer(index,EmaBuffer[index].B,INDICATOR_DATA);
   PlotIndexSetInteger(index,PLOT_DRAW_TYPE,DRAW_LINE);
   PlotIndexSetInteger(index,PLOT_LINE_COLOR,Colors[index]);
   PlotIndexSetDouble(index,PLOT_EMPTY_VALUE,EMPTY_VALUE);
//---
   if(index%8==7) PlotIndexSetInteger(index,PLOT_LINE_WIDTH,1);
  }
//+------------------------------------------------------------------+