forked from animatedread/Warrior_EA
~2,300 lines. META had real, repeatedly measured ranking skill and ZERO
operating points that ever cleared break-even (0/350 H1 eras, 1/999 H4
pre-2-sigma, 0/8 pooled fitted points). The clinching arithmetic was edge x
width = 0.095 ATR/trade against spread 0.099 ATR/trade, and the
dose-response showed the high-conviction tail is temporally unstable -
the precision-vs-threshold slope flips sign between calib and test on 3 of
4 symbols, so no ex-ante threshold rule exists. It shipped default-off and
never gated a live entry. The self-measured tier weights are what actually
rank the vote, and all six H4 instruments converged on them alone.
RETRAIN-NEUTRAL, and that is the property that made this safe:
- The weights fingerprint emitted "|TGT:META2" or "|TGT:SWG1" from an
if/else. Every direction model already took the SWG1 arm, so
collapsing it to an unconditional append is byte-identical. No .nnw or
.cfg is orphaned or re-keyed.
- NetInputWidth() lost its "+ MetaDescWidth()" term. MetaDescWidth()
returned 0 for every direction model, so the input layer is unchanged.
- DbLegacyAiSlot()'s slot 5 was reachable only with all four Use_* NNs
off AND meta on - a config that never shipped. Every existing .db keeps
its filename.
Deleted outright: Signals/SignalMETA.mqh, Expert/Trading/MetaGate.mqh (the
directory is now empty), Expert/Training/{MetaCorpus,MetaCandidateStore,
MetaFamilies}.mqh, Tests/Test_MetaFamilies.mq5, Meta_Labeling_Design.md.
Unwound in place, the delicate part: Training.mqh carried four
IsMetaTarget() branches whose else-arm WRAPPED the direction body (pass 1
queueing, pass 2 backprop, pass 2.5 calibration, pass 3 OOS scoring). Each
wrapper is removed and the direction body promoted back to its original
nesting - the bodies were never re-indented when the wrappers were added,
so the promoted code is byte-identical to what ran before META existed.
Also gone: the ensemble verdict's meta-veto replay and its
approved/vetoed/unscored counters, the per-family/per-side OOS
decomposition arrays, the m_isTrainQueueCand parallel queue and its
lockstep shuffle, and the S2 era report.
Also removed: the CMetaGate abstraction and the live CheckOpenPosition
veto; m_gates plus AddFilter's non-voter routing and IsVotingSignal()
(META was the only non-voting child, so m_gates was always empty);
m_parentSignal/SetParentSignal (existed only to reach the root's gate);
SweepPrepare/SweepPrepareIndicator (only caller was the corpus sweep);
IsMetaTarget() from all four view interfaces and their adapters;
Use_MetaLabeling, EnableMETA, Meta_ExportDataset, m_trainTarget.
EvalShift is KEPT - HistoricalNetVote() uses it for the filtered overlay,
not just the corpus sweep; only its comment changed. The 2-output softmax
arm in NetForward.mqh is kept too: it costs nothing and is the reusable
binary-head path, now commented as unclaimed rather than as META's.
Compile-verified in _claude_stage: 0 errors, 0 warnings, matching the
pre-edit baseline.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
127 lines
9.5 KiB
MQL5
127 lines
9.5 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| Warrior_EA |
|
|
//| AnimateDread |
|
|
//| |
|
|
//| CAIBaseOnlineLearningView bodies - needs the full signal |
|
|
//| declaration. Same doctrine as Persistence\AIBasePersistenceViewImpl.mqh - |
|
|
//| every method is a forward, borrowed pointer checked on every call.|
|
|
//| Reuses the signal's existing Data*()/Chart*()/Persist*() getters |
|
|
//| wherever one already answers the question; the rest are new |
|
|
//| Online*() wrappers published next to them. |
|
|
//+------------------------------------------------------------------+
|
|
#ifndef WARRIOR_ONLINELEARNING_AIBASEONLINELEARNINGVIEWIMPL_MQH
|
|
#define WARRIOR_ONLINELEARNING_AIBASEONLINELEARNINGVIEWIMPL_MQH
|
|
string CAIBaseOnlineLearningView::Id(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.DataId() : ""; }
|
|
string CAIBaseOnlineLearningView::ActiveFileName(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineActiveFileName() : ""; }
|
|
bool CAIBaseOnlineLearningView::ActiveFileCommon(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineActiveFileCommon() : false; }
|
|
long CAIBaseOnlineLearningView::EraCount(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.ChartEraCount() : 0; }
|
|
bool CAIBaseOnlineLearningView::TrainingComplete(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.ChartTrainingComplete() : false; }
|
|
bool CAIBaseOnlineLearningView::IsEnsembleMember(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.DataIsEnsembleMember() : false; }
|
|
double CAIBaseOnlineLearningView::ErrorPct(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.ChartErrorPct() : 0.0; }
|
|
double CAIBaseOnlineLearningView::UndefinePct(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineDUndefine() : 0.0; }
|
|
double CAIBaseOnlineLearningView::Forecast(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.ChartForecast() : 0.0; }
|
|
datetime CAIBaseOnlineLearningView::StudiedTime(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineDtStudied() : 0; }
|
|
CNet *CAIBaseOnlineLearningView::NetPtr(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineNet() : NULL; }
|
|
CArrayDouble *CAIBaseOnlineLearningView::TempData(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.DataTempData() : NULL; }
|
|
int CAIBaseOnlineLearningView::OutputNeurons(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.ChartOutputNeuronsCount() : 0; }
|
|
bool CAIBaseOnlineLearningView::BuildFeatureWindow(const int bar)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineBuildFeatureWindow(bar) : false; }
|
|
double CAIBaseOnlineLearningView::ApplyClassificationSoftmax(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineApplyClassificationSoftmax() : 0.0; }
|
|
double CAIBaseOnlineLearningView::AdjustedSignalFromSoftmax(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineAdjustedSignalFromSoftmax() : 0.0; }
|
|
ENUM_SIGNAL CAIBaseOnlineLearningView::SignalFromValue(const double v)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.ChartDoubleToSignal(v) : Neutral; }
|
|
ENUM_SIGNAL CAIBaseOnlineLearningView::BarLabel(const int bar)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineBarLabel(bar) : Undefine; }
|
|
int CAIBaseOnlineLearningView::LabelResolveAge(const int bar)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.DataLabelResolveAge(bar) : 0; }
|
|
bool CAIBaseOnlineLearningView::HasLabel(const int bar)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.DataHasLabel(bar) : false; }
|
|
bool CAIBaseOnlineLearningView::IsBuyLabel(const int bar)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.DataIsBuyLabel(bar) : false; }
|
|
bool CAIBaseOnlineLearningView::IsSellLabel(const int bar)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.DataIsSellLabel(bar) : false; }
|
|
int CAIBaseOnlineLearningView::HistoryBars(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.DataHistoryBars() : 0; }
|
|
int CAIBaseOnlineLearningView::CalibPurgeBars(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.DataPurgeBars() : 0; }
|
|
int CAIBaseOnlineLearningView::CalibLoIndex(const int oosCutoff)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineCalibLoIndex(oosCutoff) : 0; }
|
|
int CAIBaseOnlineLearningView::CalibHiIndex(const int totalIter, const int oosCutoff)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.DataCalibrationHiIndex(totalIter, oosCutoff) : 0; }
|
|
int CAIBaseOnlineLearningView::CalibBandBars(const int totalIter, const int oosCutoff)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineCalibBandBars(totalIter, oosCutoff) : 0; }
|
|
double CAIBaseOnlineLearningView::PriorBuy(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.PersistPriorBuy() : 0.0; }
|
|
double CAIBaseOnlineLearningView::PriorSell(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.PersistPriorSell() : 0.0; }
|
|
double CAIBaseOnlineLearningView::PriorNeutral(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.PersistPriorNeutral() : 0.0; }
|
|
bool CAIBaseOnlineLearningView::InferenceOnly(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineInferenceOnlyFlag() : true; }
|
|
bool CAIBaseOnlineLearningView::TrainRunActive(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineTrainRunActiveFlag() : false; }
|
|
bool CAIBaseOnlineLearningView::TrainingStopRequested(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.IsTrainingStopped() : true; }
|
|
bool CAIBaseOnlineLearningView::TrainingPaused(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.IsTrainingPaused() : true; }
|
|
int CAIBaseOnlineLearningView::AvailableBars(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.ChartAvailableBars() : 0; }
|
|
int CAIBaseOnlineLearningView::ServableBars(const int want, const string context)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.ChartServableBars(want, context) : 0; }
|
|
bool CAIBaseOnlineLearningView::ResizeBuffers(const int barIndex)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.ChartResizeBuffers(barIndex) : false; }
|
|
bool CAIBaseOnlineLearningView::RefreshData(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.ChartRefreshData() : false; }
|
|
bool CAIBaseOnlineLearningView::EnsureBarCachesCapacity(const int bars)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineEnsureBarCachesCapacity(bars) : false; }
|
|
datetime CAIBaseOnlineLearningView::BarTime(const int idx)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.ChartBarTime(idx) : 0; }
|
|
double CAIBaseOnlineLearningView::CloseAt(const int idx)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.ChartBarClose(idx) : 0.0; }
|
|
double CAIBaseOnlineLearningView::AtrAt(const int idx)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineAtrMain(idx) : 0.0; }
|
|
double CAIBaseOnlineLearningView::SpreadPrice(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineSpreadPrice() : 0.0; }
|
|
string CAIBaseOnlineLearningView::FilterId(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.GetFilterID() : "NULL"; }
|
|
int CAIBaseOnlineLearningView::ConfidenceTierNow(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineConfidenceTier() : 0; }
|
|
double CAIBaseOnlineLearningView::PatternWeightForTier(const int tier)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlinePatternWeightForTier(tier) : 0.0; }
|
|
string CAIBaseOnlineLearningView::PatternTableName(const string filterId, const string pattern, const string direction)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlinePatternTableName(filterId, pattern, direction) : ""; }
|
|
void CAIBaseOnlineLearningView::RegisterSignalRow(int year, int month, int day, int DOW, int hour, int minutes,
|
|
string tableName, string pattern, string direction,
|
|
double entryPrice, double exitPrice, string result, double netVote)
|
|
{
|
|
if(CheckPointer(m_owner) != POINTER_INVALID)
|
|
m_owner.OnlineRegisterSignal(year, month, day, DOW, hour, minutes, tableName, pattern, direction,
|
|
entryPrice, exitPrice, result, netVote);
|
|
}
|
|
double CAIBaseOnlineLearningView::PrevSignal(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlinePrevSignal() : 0.0; }
|
|
void CAIBaseOnlineLearningView::SetPrevSignal(const double v)
|
|
{ if(CheckPointer(m_owner) != POINTER_INVALID) m_owner.OnlineSetPrevSignal(v); }
|
|
bool CAIBaseOnlineLearningView::SaveModelStatsNow(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineSaveModelStats() : false; }
|
|
void CAIBaseOnlineLearningView::FlattenIndicatorParams(double &ip[])
|
|
{ if(CheckPointer(m_owner) != POINTER_INVALID) m_owner.OnlineFlattenIndicatorParams(ip); }
|
|
double CAIBaseOnlineLearningView::ModelEta(void)
|
|
{ return (CheckPointer(m_owner) != POINTER_INVALID) ? m_owner.OnlineModelEta() : 0.0; }
|
|
#endif // WARRIOR_ONLINELEARNING_AIBASEONLINELEARNINGVIEWIMPL_MQH
|
|
//+------------------------------------------------------------------+
|