Warrior_EA/Signals/SignalPAI.mqh
AnimateDread 8c0186c850 refactor(signals): AI signal files are identity + topology, nothing else
Every AI signal repeated the same five-line InitIndicators override that
did nothing but call InitNeuralNetwork. The cause was an access mismatch,
not a design: CExpertSignalCustom declares InitIndicators public, the AI
base redeclared it PROTECTED, and each subclass had to redeclare it
public to be reachable by CExpert. Worse, the base's own override does a
different job entirely - it creates the OHLC/ZigZag feature indicators -
and InitNeuralNetwork called it back scope-qualified to stop the virtual
dispatch landing in the subclass. Two jobs, one virtual name, and a
recursion trap held off by a scope qualifier.

The feature-indicator step is now InitFeatureIndicators() (protected,
non-virtual, named for what it does) and the AI base carries the single
public InitIndicators override. CONV/HYBRID/LSTM/PAI/META drop their
copies and are now purely identity plus topology, which is the classic
signal file's shape.

Comment pass on ExpertSignalAIBase.mqh, -100 lines with every constant
and every measured number kept. Three claims in the tier block were
stale and inverted - it named CalibratedConfidenceMagnitude() as the
tiering input where the code deliberately uses the RAW magnitude, and it
described the signal DB as re-ranking each tier when ApplyPatternWeight
declines the DB from the end of era 1. Also dropped a paragraph whose
subject was a previous version of the comment, and moved two notes down
onto the constants they document (CONV_COMPRESSION_DIVISOR was 16 lines
and three unrelated defines away from its own text).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 08:57:54 -04:00

40 lines
2.2 KiB
MQL5

//+------------------------------------------------------------------+
//| Warrior_EA |
//| AnimateDread |
//| |
//+------------------------------------------------------------------+
#include "..\Expert\ExpertSignalAIBase.mqh"
// wizard description start
//+------------------------------------------------------------------+
//| Description of the class |
//| Title=Signals of indicator 'Perceptron AI' |
//| Type=SignalAdvanced |
//| Name=Perceptron AI |
//| ShortName=PAI |
//| Class=CSignalPAI |
//| Page=signal_pai |
//+------------------------------------------------------------------+
// wizard description end
//+------------------------------------------------------------------+
//| Class CSignalPAI. |
//| Purpose: Class of generator of trade signals based on |
//| a plain multi-layer feed-forward perceptron network. |
//| Is derived from the CExpertSignalAIBase class. |
//| Only the network topology differs from the other AI signals: an |
//| input layer feeds straight into the common tapering hidden-layer |
//| stack, with no Conv/Pool/LSTM stage (AddCustomLayers is a no-op, |
//| inherited as-is from the base class). |
//+------------------------------------------------------------------+
class CSignalPAI : public CExpertSignalAIBase
{
public:
CSignalPAI(void);
};
//+------------------------------------------------------------------+
//| Constructor |
//+------------------------------------------------------------------+
CSignalPAI::CSignalPAI(void)
{
SetIdentity("Perceptron", "PAI");
}
//+------------------------------------------------------------------+