forked from animatedread/Warrior_EA
- Added bulk read/write methods for feature caches in IFeaturesView and its implementations to optimize performance. - Introduced LabelCacheInvalidateAll method to manage label cache invalidation alongside feature cache. - Implemented PooledIndependentBars method in topology interfaces to account for additional independent observations. - Enhanced risk budget management with throttling for peak-equity updates to reduce unnecessary file operations. - Improved error handling and logging for ATR trailing stops to ensure better visibility of issues. - Updated alt-data handling to prevent unnecessary operations during testing and optimization phases.
93 lines
4.7 KiB
MQL5
93 lines
4.7 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| Warrior_EA |
|
|
//| AnimateDread |
|
|
//| |
|
|
//| CAIBaseFeaturesView - declarations only, bodies in |
|
|
//| AIBaseFeaturesViewImpl.mqh (needs the full signal declared). |
|
|
//| Same shape as Topology\AIBaseTopologyView.mqh. |
|
|
//+------------------------------------------------------------------+
|
|
#ifndef WARRIOR_FEATURES_AIBASEFEATURESVIEW_MQH
|
|
#define WARRIOR_FEATURES_AIBASEFEATURESVIEW_MQH
|
|
#include "IFeaturesView.mqh"
|
|
class CExpertSignalAIBase;
|
|
class CAIBaseFeaturesView : public CFeaturesView
|
|
{
|
|
private:
|
|
CExpertSignalAIBase *m_owner;
|
|
public:
|
|
CAIBaseFeaturesView(void) : m_owner(NULL) { }
|
|
void Bind(CExpertSignalAIBase *owner) { m_owner = owner; }
|
|
|
|
virtual string Id(void) override;
|
|
virtual string SymbolName(void) override;
|
|
virtual ENUM_TIMEFRAMES Timeframe(void) override;
|
|
virtual int HistoryBars(void) override;
|
|
virtual int NeuronsCount(void) override;
|
|
virtual int LabelResolutionBars(void) override;
|
|
virtual double EffectiveSampleSize(const double rawN) override;
|
|
virtual double MeanLabelLifespan(void) override;
|
|
virtual int FirstLayerFanIn(void) override;
|
|
virtual double SwingLifespanEstimate(void) override;
|
|
virtual double EstimatedInSampleBarsRaw(void) override;
|
|
virtual double ChanceRatePct(void) override;
|
|
virtual bool UseAltData(void) override;
|
|
virtual int SwingConfirmationBars(void) override;
|
|
virtual int NewsFeatureWindowMinutes(void) override;
|
|
virtual int InitialNeuronsCount(void) override;
|
|
virtual string ActiveFileName(void) override;
|
|
|
|
virtual bool UseVolumes(void) override;
|
|
virtual bool UseMA(void) override;
|
|
virtual bool UseATR(void) override;
|
|
virtual bool UseTime(void) override;
|
|
virtual bool UseSwingContext(void) override;
|
|
virtual bool UseNews(void) override;
|
|
virtual bool UseSpreadFeature(void) override;
|
|
virtual bool UseCrossAsset(void) override;
|
|
|
|
virtual double OpenAt(const int idx) override;
|
|
virtual double HighAt(const int idx) override;
|
|
virtual double LowAt(const int idx) override;
|
|
virtual double CloseAt(const int idx) override;
|
|
virtual datetime TimeAt(const int idx) override;
|
|
virtual double AtrMain(const int idx) override;
|
|
virtual int AtrBarsCalculated(void) override;
|
|
virtual int AtrHandle(void) override;
|
|
virtual int ZigZagBarsCalculated(void) override;
|
|
virtual int ZigZagHandle(void) override;
|
|
virtual bool FindConfirmedZigZagPivot(const int fromIdx, int &pivotIdx, double &pivotPrice, bool &pivotIsLow) override;
|
|
virtual double SymbolPoint(void) override;
|
|
|
|
virtual CIndicators *IndicatorsPtr(void) override;
|
|
virtual CADIndicatorTuner *IndicatorTuner(void) override;
|
|
virtual CCrossAssetPanel *CrossAsset(void) override;
|
|
|
|
virtual int AltDataFeatureCount(void) override;
|
|
virtual void AltDataEnsureFresh(const datetime asOf) override;
|
|
virtual void AltDataFeatures(const datetime t, double &out[]) override;
|
|
|
|
virtual string CrossAssetPairsPinned(void) override;
|
|
virtual void SetCrossAssetPairsPinned(const string v) override;
|
|
virtual bool CrossAssetCfgSaved(void) override;
|
|
virtual void SetCrossAssetCfgSaved(const bool v) override;
|
|
virtual bool CommitCrossAssetPin(void) override;
|
|
|
|
virtual int FeatureCacheSize(void) override;
|
|
virtual bool FeatureCacheHasValue(const int idx) override;
|
|
virtual bool FeatureCacheIsValid(const int idx) override;
|
|
virtual double FeatureCacheAt(const int flatIdx) override;
|
|
virtual void FeatureCacheBlock(const int base, const int count, double &out[]) override;
|
|
virtual void FeatureCacheSetBlock(const int base, const int count, const double &values[]) override;
|
|
virtual void FeatureCacheSetAt(const int flatIdx, const double v) override;
|
|
virtual void FeatureCacheMarkStored(const int idx) override;
|
|
virtual void FeatureCacheInvalidateAll(void) override;
|
|
virtual void LabelCacheInvalidateAll(void) override;
|
|
|
|
virtual void SetFailBlock(const string block) override;
|
|
virtual void SetFailIdx(const int idx) override;
|
|
virtual void SetWindowFail(const int slot, const int total) override;
|
|
|
|
virtual CArrayDouble *TempData(void) override;
|
|
};
|
|
#endif // WARRIOR_FEATURES_AIBASEFEATURESVIEW_MQH
|
|
//+------------------------------------------------------------------+
|