variable profit and stop loss in CExpertSignal



I would like to create a descendant class of CExpertSignal. I plan to use make it callable by the EA wizard, as demonstrated here:

An instance of this class will be added as a filter in the CExpertSignal generated. In addition to giving a buy or sell signal, this instance should also set the take profit and the stop loss of the trade.

The bit of the code where the main CExpertSignal instance (signal) and the instance of the descendant class (filter0) are created and where the latter instance is added as a filter is shown here:

//--- Creating signal
   CExpertSignal *signal=new CExpertSignal;
      //--- failed
      printf(__FUNCTION__+": error creating signal");
//--- Creating filter MA_Cross
   MA_Cross *filter0=new MA_Cross;
      //--- failed
      printf(__FUNCTION__+": error creating filter0");

 How can I modify the stop level (m_stop_level) and the take level (m_take_level) of signal from within filter0 ? 

Create Your Own Trading Robot in 6 Steps!
Create Your Own Trading Robot in 6 Steps!
If you don't know how trade classes are constructed, and are scared of the words "Object Oriented Programming", then this article is for you. In fact, you do not need to know the details to write your own module of trading signals. Just follow some simple rules. All the rest will be done by the MQL5 Wizard, and you will get a ready-to-use trading robot!

If anyone is intested, I found the solution. 

Just set filter0 as the main signal:


The EA will then use the m_stop_level and m_take_level of filter0 when placing orders.