//+------------------------------------------------------------------+ //| Warrior_EA | //| AnimateDread | //| | //+------------------------------------------------------------------+ #include "..\Expert\ExpertSignalAIBase.mqh" // wizard description start //+------------------------------------------------------------------+ //| Description of the class | //| Title=Signals of indicator 'CNN-LSTM AI' | //| Type=SignalAdvanced | //| Name=CNN-LSTM AI | //| ShortName=HYB | //| Class=CSignalHYBRID | //| Page=signal_hybrid | //+------------------------------------------------------------------+ // wizard description end //+------------------------------------------------------------------+ //| Class CSignalHYBRID. | //| Purpose: a single fused CNN-LSTM signal that stacks Conv+Pool | //| layers before the LSTM layer, then the shared dense taper. | //| The base AI voting path still applies, so this module trades as | //| one coherent signal instead of three loosely synchronized ones. | //+------------------------------------------------------------------+ class CSignalHYBRID : public CExpertSignalAIBase { protected: virtual bool AddCustomLayers(CArrayObj *topology) override; virtual ENUM_ACTIVATION HiddenLayerActivation(void) override { return TANH; } public: CSignalHYBRID(void); virtual bool InitIndicators(CIndicators *indicators) override; }; //+------------------------------------------------------------------+ //| Constructor | //+------------------------------------------------------------------+ CSignalHYBRID::CSignalHYBRID(void) { SetIdentity("Hybrid", "HYB"); } //+------------------------------------------------------------------+ //| Create indicators and bootstrap/load the network. | //+------------------------------------------------------------------+ bool CSignalHYBRID::InitIndicators(CIndicators *indicators) { return InitNeuralNetwork(indicators); } //+------------------------------------------------------------------+ //| Conv + Pool front-end followed by an LSTM sequence layer. This | //| matches the standalone CONV front-end exactly, then adds LSTM. | //+------------------------------------------------------------------+ bool CSignalHYBRID::AddCustomLayers(CArrayObj *topology) { //--- "the standalone CONV front-end exactly, then adds LSTM" is now enforced by construction: //--- both stages are the same code CSignalCONV and CSignalLSTM run. return AddConvStage(topology) && AddLstmStage(topology); } //+------------------------------------------------------------------+