I tried to perform the exercise with this signal class, and something did not work at all.
First, using the debugger, I overcame the error that the initialisation of the m_applied field of the signal class is not provided, because of which the RSI indicator is not created.
Then I found that in the CCandlePattern::CheckPatternHangingMan() method there seems to be a missing closing bracket for calling the MathMin() function:
//+------------------------------------------------------------------+ //| Checks formation of Hanging Man candlestick pattern | //+------------------------------------------------------------------+ bool CCandlePattern::CheckPatternHangingMan() { //--- Hanging man if((MidPoint(1)>CloseAvg(2)) && // up trend (MathMin(Open(1),Close(1)>(High(1)-(High(1)-Low(1))/3.0)) && // body in upper 1/3 (Close(1)>Close(2)) && (Open(1)>Open(2)))) // body gap return(true); //--- return(false); }
Further in the debugger I see that short positions are opened by the condition for closing a long position. What can this be related to?
And another question: why is the code with comments in Russian in the description, but in the attached files it is not the same, but in English?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
MQL5 Wizard - Trade Signals Based on Hammer/Hanging Man + RSI:
The MQL5 Wizard allows creating ready-made Expert Advisors based on the Standard library classes delivered together with the client terminal (see Creating Ready-Made Expert Advisors in MQL5 Wizard for the details). It allows to check your trade ideas quickly, all you need is to create your own trading signals class. The structure of this class and example can be found in the article MQL5 Wizard: How to Create a Module of Trading Signals.
The generic idea is the following: the class of trading signals is derived from CExpertSignal, the next, it's necessary to override the LongCondition() and ShortCondition() virtual methods with your own methods.
There is a book "Strategies of best traders" (in Russian), there are many trading strategies are considered there, we will focus on reversal candlestick patterns, confirmed by Stochastic, CCI, MFI and RSI oscillators.
The best way is to create the separate class, derived from CExpertSignal for checking of formation of candlestick patterns. For confirmation of trade signals, generated by candlestick patterns, it's sufficient to write the class, derived from CCandlePattern and add the necessary features (for example, confirmation by oscillators) there.
Here we will consider the signals, based on "Hammer/Hanging Man" reversal candlestick pattern, confirmed by CCI indicator. The module of trade signals is based on the CCandlePattern class, it's simple example of its use for creation of trade signals with candlestick patterns.
Author: MetaQuotes Software Corp.