forked from animatedread/Warrior_EA
- Replace the hand-rolled fractal/deviation-%/ATR-trend-context ZigZag approximation with the actual MQL5 ZigZag indicator (rebranded as CustomIndicators/ADZigZag.mq5, logic untouched) as the training label source; bump the settle/confirmation window from 20 to 100 bars so a proper leg can form before being trusted, and drop the now-dead ZigZagDeviationPct/MinTrendATRMultiple/TrendContextBars inputs. - Rebrand the stock Volumes indicator the same way (ADVolume.mq5). - Fix HYBRID mode (AIType=HYBRID) oversubscribing the CPU fallback tier: every concurrent CNet instance was independently sizing its worker pool off the same global TargetCPULoad input. g_netPeerCount/ PeerNetworkCount() now split it across however many CNet instances (live+shadow x active signals) are actually sharing the CPU. - Fix NEURONS_REDUCTION_FACTOR's confusing retention-vs-reduction semantics so RF_70 means an actual 70% reduction; default to 4 hidden layers / RF_70. - Migrate remaining free-form training/indicator inputs to enums for UI consistency; default news filter lookback to 1h, disable every-tick. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
90 lines
3.4 KiB
MQL5
90 lines
3.4 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| ADVolume.mq5 |
|
|
//| AD Institutional Indicators |
|
|
//+------------------------------------------------------------------+
|
|
// Renamed/rebranded copy of MetaQuotes' stock Volumes.mq5 (Copyright 2000-2026, MetaQuotes Ltd.,
|
|
// https://www.mql5.com) - file, property, and identifier names only; the calculation itself
|
|
// (tick/real volume histogram, up/down coloring) is untouched.
|
|
#property copyright "AD Institutional Indicators"
|
|
#property link ""
|
|
//--- indicator settings
|
|
#property indicator_separate_window
|
|
#property indicator_buffers 2
|
|
#property indicator_plots 1
|
|
#property indicator_type1 DRAW_COLOR_HISTOGRAM
|
|
#property indicator_color1 clrGreen,clrRed
|
|
#property indicator_style1 0
|
|
#property indicator_width1 1
|
|
#property indicator_minimum 0.0
|
|
//--- input data
|
|
input ENUM_APPLIED_VOLUME InpVolumeType=VOLUME_TICK; // Volumes
|
|
//--- indicator buffers
|
|
double ADVolumeBuffer[];
|
|
double ADVolumeColorBuffer[];
|
|
//+------------------------------------------------------------------+
|
|
//| Custom indicator initialization function |
|
|
//+------------------------------------------------------------------+
|
|
void OnInit()
|
|
{
|
|
//--- buffers
|
|
SetIndexBuffer(0,ADVolumeBuffer,INDICATOR_DATA);
|
|
SetIndexBuffer(1,ADVolumeColorBuffer,INDICATOR_COLOR_INDEX);
|
|
//--- name for DataWindow and indicator subwindow label
|
|
IndicatorSetString(INDICATOR_SHORTNAME,"ADVolume");
|
|
//--- indicator digits
|
|
IndicatorSetInteger(INDICATOR_DIGITS,0);
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| ADVolume |
|
|
//+------------------------------------------------------------------+
|
|
int OnCalculate(const int rates_total,
|
|
const int prev_calculated,
|
|
const datetime &time[],
|
|
const double &open[],
|
|
const double &high[],
|
|
const double &low[],
|
|
const double &close[],
|
|
const long &tick_volume[],
|
|
const long &volume[],
|
|
const int &spread[])
|
|
{
|
|
if(rates_total<2)
|
|
return(0);
|
|
//--- starting work
|
|
int pos=prev_calculated-1;
|
|
//--- correct position
|
|
if(pos<1)
|
|
{
|
|
ADVolumeBuffer[0]=0;
|
|
pos=1;
|
|
}
|
|
//--- main cycle
|
|
if(InpVolumeType==VOLUME_TICK)
|
|
CalculateADVolume(pos,rates_total,tick_volume);
|
|
else
|
|
CalculateADVolume(pos,rates_total,volume);
|
|
//--- OnCalculate done. Return new prev_calculated.
|
|
return(rates_total);
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
void CalculateADVolume(const int pos,const int rates_total,const long& volume[])
|
|
{
|
|
ADVolumeBuffer[0]=(double)volume[0];
|
|
ADVolumeColorBuffer[0]=0.0;
|
|
//---
|
|
for(int i=pos; i<rates_total && !IsStopped(); i++)
|
|
{
|
|
double curr_volume=(double)volume[i];
|
|
double prev_volume=(double)volume[i-1];
|
|
//--- calculate indicator
|
|
ADVolumeBuffer[i]=curr_volume;
|
|
if(curr_volume>prev_volume)
|
|
ADVolumeColorBuffer[i]=0.0;
|
|
else
|
|
ADVolumeColorBuffer[i]=1.0;
|
|
}
|
|
//---
|
|
}
|
|
//+------------------------------------------------------------------+
|