Any questions from a PROFI to a SUPER PROFI - 1. - page 40

 
olyakish:

can you give me an example of what number you set

20 or 0.00020 ?


Of course 20! It is always set in points:

   int      slippage,            // проскальзывание

But that's not enough for a 5-digit spread! As already advised above, more spread is reasonable, or better still double the spread!

 
borilunad:

Of course, 20! Always set in points:

But that's not enough for a 5-digit spread! Advised above, more spread is sensible, or better still double the spread!

Thank you I am aware of that. You answered a question that was not addressed to you.

 
olyakish:

Thank you, I am aware of that. You answered a question that was not addressed to you.


Sorry, I didn't know you were taking an exam! ;)
 

Is there a mode in the terminal where it logs crashes?

I mean silent crashes, when the terminal just closes without an error.

I want to find the reason why the terminal sometimes crashes during optimization. The strategy uses dll. All code is wrapped in try - catch, with its own logging, but it does not show any errors, nevertheless terminal crashes sometimes at massive genetics. The overall system is undetectable, may crash on 100 iterations, or may survive on 10,000, with absolutely identical set and range of parameters.

Task manager doesn't show any memory leaks (I understand that it's not the best tool for such purposes, but still).

 
TomKein:

Is there a mode in the terminal where it logs crashes?

I mean silent crashes, when the terminal just closes without an error.

I want to find the reason why the terminal sometimes crashes during optimization. The strategy uses dll. All code is wrapped in try - catch, with its own logging, but it does not show any errors, nevertheless terminal crashes sometimes at massive genetics. The overall system is undetectable, may crash on 100 iterations, or may survive on 10,000, with absolutely identical set and range of parameters.

Task manager doesn't show any memory leaks (I understand that it's not the best tool for such purposes, but still).

In my opinion, the dll in the tester doesn't work, so it doesn't slow down the process!
 

Why write something you have no idea about?

 
TomKein:

Does the terminal have a mode where it logs crashes?

If the terminal notifies you about the crash, you can dump it manually and then use it to figure it out.

If terminal just closes without crash notification window, you have to make dump by yourself. I've got one project called breakpad out of chrome, it's not too difficult to connect to almost any project and do dump dump instantly. At one time I debugged the dll for the terminal that way.

 

Is there a way to get the variable name as a string?

int varTakeProfit = 1;
Print( VarName( varTakeProfit ), " = ", varTakeProfit ); // varTakeProfit = 1

string VarName( int Var )
{
   ???
}
 
#define  VarName(x) #x


int varTakeProfit = 1;
Print( VarName( varTakeProfit ), " = ", varTakeProfit ); //  varTakeProfit = 1

 
Andrey Khatimlianskii:

Is there a way to get the variable name as a string?

There is no such thing in MQL. If such a task arises, I do the following:

struct ValueAndName
{
   double   fValue;                     // Значение переменной
   string   sName;                      // Имя переменной

   ValueAndName(double _fValue, string _sName)
   {
      SetData(_fValue, _sName);
   }

   void SetData(double _fValue, string _sName)
   {
      fValue = _fValue;
      sName = _sName;
   }
};

VarAndName g_stVarTakeProfit(12.0, "VarTakeProfit");
VarAndName g_stVarStopLoss(20.0, "VarStopLoss");

void OnStart()
{
  Print("Значение переменной ", g_stVarTakeProfit.sName, " равно: ", g_stVarTakeProfit.fValue);
  Print("Значение переменной ", g_stVarStopLoss.sName, " равно: ", g_stVarStopLoss.fValue);
}