Opening, closing in Expert Advisor generated by MQL5 Wizard - page 3

 

and can you tell me what value SignalITF eventually returns? Can you tell me what empty_value means?

 
PeretsCHILI:

and can you tell me what value SignalITF eventually returns? Can you explain to me, who is not smart, what empty_value means?


I don't even remember anymore, so far I've found this:

Intraday Time Filter Signals

 

This module seems to have a slightly different logic, first it works by returning "Against" and "Not Against" the opening of a position, and then the calculation of the arithmetic mean of the signals from the other signal modules comes out.

 
Andy:

Closes if the long and short signals are both 100.


Take a look at your signal builder: what are the weights of the patterns?

(Something like this:

//+------------------------------------------------------------------+
//| Constructor                                                      |
//+------------------------------------------------------------------+
CSignalDEMA::CSignalDEMA(void) : m_ma_period(12),
                                 m_ma_shift(0),
                                 m_ma_applied(PRICE_CLOSE),
                                 m_pattern_0(20),
                                 m_pattern_1(60),
                                 m_pattern_2(80),
                                 m_pattern_3(60)
  {

)

 
Andy:

I just have a signal = 100 in both buy and sell conditions. Only one condition: bull bar > 30 pips - buy, bearish - sell.


So, do not give out 100, but 80. In that case you can set Signal threshold value to close [0...100] equal to 100 in your EA and forbid closing at all.

 
Andy:

...

By the way - how can I make the standard position trailing module only put the stop at breakeven and not trailing further?

...


You need to write your own module of position management. Read more in this article:MQL5 Wizard: How to Create Your Own Module to Support Open Pos itions


What is the difference between the two EAs?

...

Can I also make a simple closing of a position during a trend reversal without opening the opposite one?

Yes, you can. You need to inherit from CExpert and write your own rules in the resulting class.
 
Andy:

When using the module you specified, errors are displayed in the Expert Advisor log while loading the Expert Advisor on the chart:

2017.09.06 00:28:29.873 1 (EURUSD,M5) OnInit: error initializing indicators

2017.09.06 00:31:20.256 1 (EURUSD,M5) CExpertBase::SetPriceSeries: changing of timeseries is forbidden

2017.09.06 00:31:20.256 1 (EURUSD,M5) CExpertBase::SetOtherSeries: changing of timeseries is forbidden

2017.09.06 00:31:20.256 1 (EURUSD,M5) CExpertBase::InitIndicators: parameters of setting are not checked

2017.09.06 00:31:20.256 1 (EURUSD,M5) CExpert::InitIndicators: error initialization indicators of trailing object

2017.09.06 00:31:20.256 1 (EURUSD,M5) OnInit: error initializing indicators

Perhaps it is out of date, where can I get a new one or what should I fix in this one?

To get answers, please use TITTING of posts:

Respecting the person you are talking to

 
Andy:

When using the module you specified, errors are displayed in the Expert Advisor log while loading the Expert Advisor on the chart:

2017.09.06 00:28:29.873 1 (EURUSD,M5) OnInit: error initializing indicators

2017.09.06 00:31:20.256 1 (EURUSD,M5) CExpertBase::SetPriceSeries: changing of timeseries is forbidden

2017.09.06 00:31:20.256 1 (EURUSD,M5) CExpertBase::SetOtherSeries: changing of timeseries is forbidden

2017.09.06 00:31:20.256 1 (EURUSD,M5) CExpertBase::InitIndicators: parameters of setting are not checked

2017.09.06 00:31:20.256 1 (EURUSD,M5) CExpert::InitIndicators: error initialization indicators of trailing object

2017.09.06 00:31:20.256 1 (EURUSD,M5) OnInit: error initializing indicators

Maybe it's out of date, where to get a new one or what to fix in this one?

I replied in the discussion of this article:

Forum on trading, automated trading systems and strategy tester

Discussing the article "MQL5 Wizard: How to write your own module of open positions maintenance".

Vladimir Karputov, 2017.09.06 07:26


Modify the trailing module "sampleTrailing.mqh":

//+------------------------------------------------------------------+
//| Проверка параметров настройки.                                   |
//| INPUT:  нет.                                                     |
//| OUTPUT: true-если настройки правильные, иначе false.             |
//| REMARK: нет.                                                     |
//+------------------------------------------------------------------+
bool CSampleTrailing::ValidationSettings()
  {
   if(!CExpertTrailing::ValidationSettings())
      return(false);
//--- а вдруг не вызывался метод Init
   if(m_symbol==NULL) return(false);
//--- проверка параметров
   if((m_profit-m_stop_level)*m_adjusted_point<=m_symbol.StopsLevel()*m_symbol.Point() && m_profit!=0.0)
     {
      printf(__FUNCTION__+": уровень пороговой прибыли должен быть больше уровня установки ордеров");
      return(false);
     }
//--- ok
   return(true);
  }

 
Andy:

And in the standard MA and RSI signal modules, how to determine what the signal strength is at that moment

***


Are you, as a user, sure you need it?


Andy:

***

What value should be set for opening and closing a position?


Select levels for opening and closing experimentally:

Signal threshold value to open [0...100]
Signal threshold value to close [0...100]


as well asthe values of the weights in the input parameters

Moving Average(12,0,...) Weight [0...1.0]
Relative Strength Index(8,...) Weight [0...1.0]


That is, everything is picked experimentally for each individual case (symbol and timeframe).

 
Andy:
And in the MA module, what is the signal strength for opening and closing (I need it to combine with another module)?

Look at the code of MovingAverage custom indicator signals module (Expert\Signal\SignalMA.mqh), in the constructor.