Discussion of article "MQL5 Wizard: New Version" - page 4

 

1. Can you tell me how to invert a signal?

example: to confirm a GBP/USD buy signal, we need a MACD EUR/GBP sell signal.

Or is it easier to dig in the library code and change "plus" to "minus" and save it as a library under a different name.

P.S. It would be nice to choose when creating an Expert Advisor which signal to take: forward or reverse signal

2. How can I take out the weights of patterns that are sewn into the library, to optimise these weights?

 
52_rus:

1. Can you tell me how to invert the signal?

example: to confirm a GBP/USD buy signal, we need a MACD EUR/GBP sell signal.

Or is it easier to dig into the library code and change "plus" to "minus" and save it as a library under a different name.

P.S. It would be nice to choose when creating an Expert Advisor which signal to take: forward or reverse signal

2. How can we take out the weights of patterns, which are sewn into the library, to optimise these weights?

1. Mechanisms for inverting (and ignoring) signals are built into the CExpertSignal base class, but unfortunately are not yet available from the Wizard.

2 The same can be said about pattern weights.

Please attach the source of the Expert Advisor, obtained after the "Wizard" and briefly. I will try to explain how to do it "by hand".

PS. The "Wizard" will be developed and these settings will be available later.

 

1. How can I add my library (for example: change the current MACD and save it without deleting the main library) to the master signal list?

2. Question about working with libraries:

Let's consider an Expert Advisor based on MAKD, made with the help of the wizard: we created and compiled it, tested it and got some result

The MAKD signal from the library were as follows:

//--- setting default "weights" of the market models
   m_pattern_0    =10;       // model 0 "the oscillator has required direction"
   m_pattern_1    =30;       // model 1 "reverse of the oscillator to required direction"
   m_pattern_2    =80;       // model 2 "crossing of main and signal line"
   m_pattern_3    =50;       // model 3 "crossing of main line at the zero level"
   m_pattern_4    =60;       // model 4 "divergence of the oscillator and price"
   m_pattern_5    =100;      // model 5 "double divergence of the oscillator and price" 

Далее, если я занулю не нужные мне паттерны (например 0,1,2,4,5) в библиотеке:

//--- setting default "weights" of the market models
   m_pattern_0    =0;       // model 0 "the oscillator has required direction"
   m_pattern_1    =0;       // model 1 "reverse of the oscillator to required direction"
   m_pattern_2    =80;       // model 2 "crossing of main and signal line"
   m_pattern_3    =0;       // model 3 "crossing of main line at the zero level"
   m_pattern_4    =0;       // model 4 "divergence of the oscillator and price"
   m_pattern_5    =0;      // model 5 "double divergence of the oscillator and price" 

I will compile only the library (I will not compile the EA code itself). I will test it and get exactly the same result as in the first test.

If I compile the EA code too, I will get a different result, in this example only for pattern 2.

I have a question: Why do I have to recompile the EA code after changing some parameters in the library? (It has not changed).

 
52_rus:

1. How can I add my library (for example: change the current MACD and save it without deleting the main one) to the master signals list?


You mean the include file that contains the code of the signals module? Change the current module as you need and save it in the same directory, but with a different name. More details about it are given in the article:

Creating a trading robot in the new MQL5 Wizard

The EA code is constructed using the MQL5 Wizard of the MetaEditor.

The basic classes of trading strategies are located in the terminal_data_folder\MQL5\Include\Expert\. Ready algorithms of trading signals classes , open positions maintenance classes and capital and risk management classes are located in the Signal, Trailing and Money subdirectories. The MQL5 Wizard analyses the files in these directories and uses them to generate the EA code.

This means that the signal modules are (and must be, to be seen by the MQL5 Wizard) in the terminal_data_folder\MQL5\Include\Expert\Signal directory.
 
everything worked, thanks, I just corrected the code, but didn't change the class name....
 

For some reason, new versions of the terminal no longer contain custom versions of signal generator modules. There are 30 modules in the /MQL5/Include/Expert/Signal/ folder , but the Wizard sees only 20 modules supplied as standard according to the Help.

Is it just me or does the MT5 editor no longer scan the folder with signal modules for new modules? Even the former modules of signals based on candlestick patterns developed by Metaquotes are not connected.

 
Livingston:

For some reason, new versions of the terminal no longer contain custom versions of signal generator modules. There are 30 modules in the /MQL5/Include/Expert/Signal/ folder , but the Wizard sees only 20 modules supplied as standard according to the Help.

Is it just me or does the MT5 editor no longer scan the folder with signal modules for new modules? Even the old candlestick pattern-based signal modules developed by Metaquotes are not connected.

A new signal module must have a different module description and its type must be SignalAdvanced


 
Rosh:

The new signal module should have a different module description and its type should be SignalAdvanced


Thank you very much.
 
Rosh:

A new signal module must have a different module description and its type must be SignalAdvanced


If you replace Signal with SignalAdvanced in previously written signal modules, they still don't work. Now the functions CheckOpenShort/CheckOpenLong are not used and replaced by ShortCondition/LongCondition?

There are no parameters in these functions, so it is unclear how to set takeouts and stops.

int CSignalMA::LongCondition()
  {
   int result=0;
   int idx   =StartIndex();
//--- analyse positional relationship of the close price and the indicator at the first analysed bar
   if(DiffCloseMA(idx)<0.0)
     {
      //--- the close price is below the indicator
      if(IS_PATTERN_USAGE(1) && DiffOpenMA(idx)>0.0 && DiffMA(idx)>0.0)
        {
         //--- the open price is above the indicator (i.e. there was an intersection), but the indicator is directed upwards
         result=m_pattern_1;
         //--- consider that this is an unformed "piercing" and suggest to enter the market at the current price
         m_base_price=0.0;
        }
     }
   else
     {
      //--- the close price is above the indicator (the indicator has no objections to buying)
      if(IS_PATTERN_USAGE(0))
         result=m_pattern_0;
      //--- if the model 2 is used
      if(IS_PATTERN_USAGE(2) && DiffMA(idx)>0.0)
        {
         //--- the indicator is directed upwards
         if(DiffOpenMA(idx)<0.0)
           {
            //--- the open price is below the indicator (i.e. there was an intersection)
            result=m_pattern_2;
            //--- suggest to enter the market at the "roll back"
            m_base_price=m_symbol.NormalizePrice(MA(idx));
           }
         else
           {
            //--- the open price is above the indicator
            if(DiffLowMA(idx)<0.0)
              {
               //--- the low price is below the indicator
               result=m_pattern_2;
               //--- consider that this is a formed "piercing" and suggest to enter the market at the current price
               m_base_price=0.0;
              }
           }
        }
     }
//--- return the result
   return(result);
  }

now IS_PATTERN_USAGE() is used everywhere in the signals module, it is unclear why.

In general, we are waiting for information on how to make the signals module yourself.

and will the old wizard mode Type=Signal be available? or will all modules now be written in a new way?

 

Each market model is assigned a significance, measured from 1 to 100. The higher the value, the stronger the model.

MA with a weight of 0.4 and Stochastic with a weight of 0.8 - this is set in external variables, and where MA comes from - its significance is 100. Stochastic significance of this model is equal to 80. Where is the significance of each model set or how is it determined?