Discussion on the implementation of councillors. - page 6

 
Ivan_Invanov:
Hello. Could you please tell me what is the market entry signal of this EA and where it is located in the code?

You connect the signals module of the custom indicator in the line

//--- available signals
#include <Expert\Signal\SignalMA.mqh>


and hereyou can checkthe trading signals of this indicator


There is enough information at this point and you need to digest it. I also recommend that you read the following articles

Документация по MQL5: Стандартная библиотека / Модули стратегий / Модули торговых сигналов / Сигналы индикатора Moving Average
Документация по MQL5: Стандартная библиотека / Модули стратегий / Модули торговых сигналов / Сигналы индикатора Moving Average
  • www.mql5.com
Цена пересекла индикатор сверху вниз(цена Open анализируемого бара выше линии индикатора, а цена Close - ниже), но индикатор растет (слабый сигнал на отбой от линии индикатора). Цена пересекла индикатор нижней тенью (цены Open и Close анализируемого бара выше линии индикатора, а цена Low ниже) и индикатор растет (сигнал на отбой от линии...
 

Guys, here's a question

What is the right way to make a parameter optimization constraint so that they don't climb on top of each other, there are too many unnecessary overshoots.

input  int                Profit_Lev1        = 5;           // |     1-я фиксация прибыли 
sinput string _p1="";//---
input  int                Profit_Lev2        = 7;           // |     2-я фиксация прибыли 
sinput string _p2="";//---
input  int                Profit_Lev3        = 10;          // |     3-я фиксация прибыли


We have 3 levels of profit taking, the 1st should not be higher than the 2nd and 3rd and the 2nd should not be higher than the 3rd

//+------------------------------------------------------------------+
//| Проверяет внешние параметры                                      |
//+------------------------------------------------------------------+
bool CheckInputParameters()
  {
     if(Profit_Lev1 >= Profit_Lev2  || Profit_Lev1 >= Profit_Lev3 || Profit_Lev2 >= Profit_Lev3)
       {
         Print(_Symbol,
               ": 1-й уровень профита ("+IntegerToString(Profit_Lev1)+") "
               "должен быть больше 2-го и 3-го уровня профита ("+IntegerToString(Profit_Lev2)+"   "+IntegerToString(Profit_Lev3)+")!");
         return(false);
        }                     
//--- Параметры корректны
   return(true);
  }

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  { 


//--- Проверим внешние параметры
   if(!CheckInputParameters())
      return(INIT_PARAMETERS_INCORRECT);


//--- Инициализаия прошла успешно
   return(INIT_SUCCEEDED);
  }


I start optimization

The log starts getting a lot of errors, maybe something that resets the robot


But the thing is, the robot is optimized for 20 minutes and optimization stops, although if I don't specify a limit and let things run their course, where the first can be higher than the second, then the optimization is fully operational more than a day.

I don't want them to go one by one and not jump over each other, because there are some other logics in the form of points and shifts in the algorithm for each level of TP.

 
Konstantin Seredkin:

Guys, here's a question

What is the right way to make a parameter optimization constraint so that they don't climb on top of each other, too many unnecessary overshoots.


We have 3 levels of profit taking, 1st should not be higher than 2nd and 3rd and 2nd should not be higher than 3rd

Introduce not three "profit levels" but "base level", "2nd level over base level" and "3rd level over 2nd level".

That's it. We do a full overshoot.

If we want all three levels to fit into some fixed range, then we introduce variables "range width" and two "boundaries between levels", where the first boundary is a fraction of the range, and the second boundary is a fraction of the remaining (after the first boundary) part of the range.

I would do it this way...

 
Georgiy Merts:

Introduce not three "profit levels" but "base level", "exceeding the second level over the base level" and "exceeding the third level over the second level".

That's it. We do a full overshoot.

If we want all three levels to fit into some fixed range, then we introduce variables "range width" and two "boundaries between levels", where the first boundary is a fraction of the range, and the second boundary is a fraction of the remaining (after the first boundary) part of the range.

I would do it this way...

Does it make any difference if I check the first level with the second and third, or if I check the third level with the first and second, because the meaning is the same.
 
Konstantin Seredkin:
So from the change of places of the summand will be the difference that I check the first level with the second and third, that the third level with the first and second check, the meaning of the same.

You have invalid parameters when the first level is greater than the second, etc., and in the proposed version these checks will disappear, and all sets will be correct.

 
Konstantin Seredkin:
So, will it make any difference if I check the first level with the second and third, or check the third level with the first and second, the meaning is the same.

The question was sort of how to go over "no overlap". If the first level is, for example, 10% of the range - there is no way the second level will climb it, as it is measured in the remaining 90%.

 
Georgiy Merts:

The question was sort of how to go over "no overlap". If the first level, for example, is 10% of the range - there is no way the second level will climb into it, as it is measured in the remaining 90%.

I still don't understand.

It's not just static variables, it's external variables in which I set 3 take profit.


Robot trades 3 lots

in 100 pips I want to close 1 lot = this is the first level of profit

200 lots more = second level of profit

300 lots more = third level of profit


But with the first level robot sets a stop loss at Breakeven

At the second level it transfers this stop to the first profit level.

If there were no Breakeven, it would not matter how the optimizer would select these levels, even if the 1st level were 300, the second 50 points and the third 150

but the Breakeven method needs a precise order, so I don't want the optimizer to pick them like this

300 50 150

50 300 150

etc.

I just want things to go normally.

50 100 200

150 160 170

etc.

Checking for correctness of entered parameters

//+------------------------------------------------------------------+
//| Проверяет внешние параметры                                      |
//+------------------------------------------------------------------+
bool CheckInputParameters()
  {
     if(Profit_Lev1 >= Profit_Lev2  || Profit_Lev1 >= Profit_Lev3 || Profit_Lev2 >= Profit_Lev3)
       {
         Print(_Symbol,
               ": 1-й уровень профита ("+IntegerToString(Profit_Lev1)+") "
               "должен быть больше 2-го и 3-го уровня профита ("+IntegerToString(Profit_Lev2)+"   "+IntegerToString(Profit_Lev3)+")!");
         return(false);
        }                     
//--- Параметры корректны
   return(true);
  }

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  { 


//--- Проверим внешние параметры
   if(!CheckInputParameters())
      return(INIT_PARAMETERS_INCORRECT);


//--- Инициализаия прошла успешно
   return(INIT_SUCCEEDED);
  }

When optimizing there writes that there were skips on a bunch of runs, it is good that it resets the settings that cannot be applied, but the optimizer works for a few minutes and then shuts down.

I guess this check has to be played in some other way.

What you suggest I can't figure out without an example of what you're talking about.

 
Konstantin Seredkin:

I still don't understand.

It's not just static variables, it's external variables that I set 3 take profits into


Robot is trading 3 lots

in 100 pips I want to close 1 lot = this is the first level of profit

200 lots more = second level of profit

300 more lots = third level of profit


But with the first level robot sets a stop loss at Breakeven

At the second level it transfers this stop to the first profit level.

If there were no Breakeven, it would not matter how the optimizer would select these levels, even if the 1st level were 300, the second 50 points and the third 150

but the Breakeven method needs a precise order, so I don't want the optimizer to pick them like this

300 50 150

50 300 150

etc.

I just want it to go normally.

50 100 200

150 160 170

etc.

Checking for correctness of parameters entered

When optimizing there writes that there were skips on a bunch of runs, it is good that it resets the settings that cannot be applied, but the optimizer works for a few minutes and then shuts down.

I guess this check has to be played in some other way.

I cannot figure out what you suggest without an example.

In the input, do not set levels, but distances between them.

input uint firstLevel=20 ; // пунктов от цены до первого ТП

input uint secondDistance=30; // пунктов от первого ТП до второго

input uint thirdDistance=50; // пунктов от второго ТП до конечного

Then the optimizer physically will not be able to swap levels

 

Good afternoon, there are some guys who remotely set up an EA on mt4, which automatically trades, on a vm machine on yandex cloud. If I'm not mistaken, I will be able to get a copy of the game on my hard drive and make it work. Cp

P.s sorry for my obtuse language, I do not understand the terminology and the essence of these things.

 

Good afternoon!

I have decided to write an EA. In this regard, there is a need to change the signals that will be used by the EA to open orders. For example, the indicator DeMarker - I want my Expert Advisor to open orders only when this indicator crosses 0.3 from bottom to top (buy) and 0.7 from top to bottom (sell). Do I correctly understand that I need to correct the file SignalDeMarker.mqh (the code sections with the comments "Voting" that price will grow. and "Voting" that price will fall.)?