[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 243

 
what is the maximum slippage value?
 
joo:
Tried different projects - same problem.
Add a .def file. There are many differences between MT5 and MT4 in this regard, and for the better.
 
TheXpert:
Add a .def file. There are a lot of differences between MT5 and MT4 in this regard, and for the better.

Added it, didn't help.

 

Hi all. Can you tell me how to convert int variable to string, so that the length of string was always the same - 2 characters (just that I have different two-digit and one-digit, and it's annoying). Advice on what to run from, I do not ask for a specific solution:) Thanks in advance.


PS: In principle, you can do (if x < 10) and add a zero on the left, but maybe there is some built-in data conversion function?

 
joo:

Added it, didn't help.

Probably didn't add it properly.
 

Friends, tell me what my logic is...

Bottom line:

 bool signal_MACD() 
  { 
    bool signal_MACD = false; //изначально сигнал стоит false
    double tmp = iMACD(Symbol(),TF,fast_ema,slow_ema,signal_period,PRICE_CLOSE,MODE_MAIN,0); //это текущий бар MACD
    for(int i=1;i<=7;i++) //цикл for первый
    { 
      for(int j=2;j<=7;j++) //цикл for второй (я подозреваю, что именно в for у меня ошибка)
      {
            if((iMACD(Symbol(),TF,fast_ema,slow_ema,signal_period,PRICE_CLOSE,MODE_MAIN,j)*tmp)>0.0) //если текущий бар MACD находится по одну сторону с одним из баров MACD, сдвинутых на 2 назад
            { 
              if((iMACD(Symbol(),TF,fast_ema,slow_ema,signal_period,PRICE_CLOSE,MODE_MAIN,i)*tmp)<0.0) //если текущий бар MACD находится по разные стороны с одним из баров MACD, сдвинутых на 1 назад

              {
            
                 signal_MACD = true; 
                 break; 
            
              }   
            } 
      }      
    } 
    return(signal_MACD);
  } 

i.e. MACD was on one side of 0, then ended up on the other side and came back again. The MACD sort of breaks through the zero line and comes back... but in the strategy tester, it's not even close... the question is... why?

 
nadya:
What is the maximum slippage value?

How much do you need?


Pyro:

Hi all. Can you please advise how to convert int variable to string, so that the length of string was always the same - 2 characters (just she I have different happens and two-digit and single-valued, and it annoys). Advice on what to run from, I do not ask a specific solution:) Thanks in advance.


PS: Basically, you could do (if x < 10) and add a zero on the left, but maybe there is some inbuilt data conversion function?

I always do exactly that.
 
nemo811:
I'm not laughing...

It's just that the spread at different times of the day and on different days can be very different. So it's no laughing matter.
 
prorab:

I did something with the editable file <indicator.mq4>, either moved it somewhere or copied it under a different name, but after compilation, in the list of indicators of the terminal, the name became gray and inactive.

However, the indicator is available through the side menu in the left window bar in the "list tree" and is dragged on to the chart.

If you have encountered such a situation, please advise how to remedy it?

Sincerely.

You will not believe it!

The reason was very obvious: too many indicators in the folder <indicators>!

Once I moved unnecessary *.mq4 to <Arxiv>, reducing the number of indicators in the folder by 2/3, everything works.

Who would have thought?

 
CLAIN:

Friends, tell me what my logic is...

Bottom line:

i.e. MACD was on one side of 0, then ended up on the other side and came back again. The MACD sort of breaks through the zero line and comes back... but in the strategy tester, it's not even close... the question is... why?

for(int i=1;i<=7;i++) //цикл for первый
    { 
      for(int j=2;j<=7;j++) //цикл for второй (я подозреваю, что именно в for у меня ошибка)

after that print the i and j values and see what happens

I assume that we need to correct the second loop to

for(int j=i+1;j<=7;j++)
Reason: