//+------------------------------------------------------------------+ //| Warrior_EA | //| AnimateDread | //| | //| The read/write surface COnlineLearning needs from the signal. | //| Same shape as Persistence\IPersistenceView.mqh - abstract, pure | //| `= 0`, no signal include. READ+WRITE like Persistence: the | //| backfill walk borrows and restores dPrevSignal, and the sample | //| weighting reads priors the signal itself measures. | //+------------------------------------------------------------------+ #ifndef WARRIOR_ONLINELEARNING_IONLINELEARNINGVIEW_MQH #define WARRIOR_ONLINELEARNING_IONLINELEARNINGVIEW_MQH class COnlineLearningView { public: virtual ~COnlineLearningView(void) { } //--- IDENTITY/FILE (reused via the signal's existing Data*()/Chart*() getters where one already //--- exists; a handful are new - see the adapter's declaration comment for which). virtual string Id(void) = 0; virtual string ActiveFileName(void) = 0; virtual bool ActiveFileCommon(void) = 0; virtual long EraCount(void) = 0; virtual bool TrainingComplete(void) = 0; virtual bool IsEnsembleMember(void) = 0; //--- Net.Save()/Net.Load() run-metadata, exactly as StartOosContinualSimulation()/ //--- OnlineLearnStep()'s periodic persist need it. virtual double ErrorPct(void) = 0; virtual double UndefinePct(void) = 0; virtual double Forecast(void) = 0; virtual datetime StudiedTime(void) = 0; //--- THE MAIN NET, borrowed. Never owned or deleted here - the signal owns it, same as the //--- excursion head borrows nothing net-shaped because it has its own. This collaborator needs //--- the real Net for feedForward/backProp/recentAverageSmoothingFactor/SetBatchNormFrozen and to //--- pick a deploy net (shadow-preferred). virtual CNet *NetPtr(void) = 0; virtual CArrayDouble *TempData(void) = 0; virtual int OutputNeurons(void) = 0; //--- FEATURES/PREDICTION - AdvanceOosSimulationChunk()/AdvancePatternDatabaseBackfill()/ //--- OnlineLearnStep() all build one bar's window then read the classifier's call the same way. virtual bool BuildFeatureWindow(const int bar) = 0; virtual double ApplyClassificationSoftmax(void) = 0; virtual double AdjustedSignalFromSoftmax(void) = 0; virtual ENUM_SIGNAL SignalFromValue(const double v) = 0; //--- The swing label, resolved on demand through the finality-gated cache path; Undefine = the //--- bar's pivot pair has not committed yet, so there is nothing to learn from it. virtual ENUM_SIGNAL BarLabel(const int bar) = 0; //--- LABELS - bounds-checked, reused from the signal's existing Data*() block. virtual bool HasLabel(const int bar) = 0; virtual bool IsBuyLabel(const int bar) = 0; virtual bool IsSellLabel(const int bar) = 0; virtual int LabelResolveAge(const int bar) = 0; //--- SHAPE/CALIBRATION BAND virtual int HistoryBars(void) = 0; virtual int CalibPurgeBars(void) = 0; virtual int CalibLoIndex(const int oosCutoff) = 0; virtual int CalibHiIndex(const int totalIter, const int oosCutoff) = 0; virtual int CalibBandBars(const int totalIter, const int oosCutoff) = 0; //--- PRIORS - OnlineSampleWeight()'s alpha-balanced focal weight. virtual double PriorBuy(void) = 0; virtual double PriorSell(void) = 0; virtual double PriorNeutral(void) = 0; //--- GATES/FLAGS OnlineLearnStep() checks before ever touching a weight. virtual bool InferenceOnly(void) = 0; virtual bool TrainRunActive(void) = 0; virtual bool TrainingStopRequested(void) = 0; virtual bool TrainingPaused(void) = 0; //--- BARS/BUFFERS - the depth OnlineLearnStep() needs to reach the confirmation frontier. virtual int AvailableBars(void) = 0; virtual int ServableBars(const int want, const string context) = 0; virtual bool ResizeBuffers(const int barIndex) = 0; virtual bool RefreshData(void) = 0; virtual bool EnsureBarCachesCapacity(const int bars) = 0; virtual datetime BarTime(const int idx) = 0; virtual double CloseAt(const int idx) = 0; virtual double AtrAt(const int idx) = 0; //--- DB - AdvancePatternDatabaseBackfill()'s RegisterSignal() row. virtual double SpreadPrice(void) = 0; virtual string FilterId(void) = 0; virtual int ConfidenceTierNow(void) = 0; virtual double PatternWeightForTier(const int tier) = 0; virtual string PatternTableName(const string filterId, const string pattern, const string direction) = 0; virtual void 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) = 0; virtual double PrevSignal(void) = 0; virtual void SetPrevSignal(const double v) = 0; //--- PERSISTENCE - the periodic checkpoint OnlineLearnStep() writes. virtual bool SaveModelStatsNow(void) = 0; virtual void FlattenIndicatorParams(double &ip[]) = 0; //--- The model's own learning-rate setting, scaled down for a continual-learning step. virtual double ModelEta(void) = 0; }; #endif // WARRIOR_ONLINELEARNING_IONLINELEARNINGVIEW_MQH //+------------------------------------------------------------------+