This commit is contained in:
2024-05-27 09:06:04 +03:30
parent c1aa4fe888
commit 30dd2f1aaf
13 changed files with 2337 additions and 368 deletions
+675 -171
View File
@@ -40,7 +40,7 @@ bool x121EAAllowShort = true; // Allow Short Trades
int x121EAManageInterval = 0; // Manager Check Intervals Seconds
int x121EAMaxAllowedPositions = 10; // Max Allowed Positions
double x121EAMaxAllowedSpread = 0; // Max Allowed Spred for Opening Trades
double x121EAMinProfitPerTrade = 5; // Min Profit Per Trade based On Volume Factor (Hedge)
double x121EAMinProfitPerTrade = 3; // Min Profit Per Trade based On Volume Factor (Hedge)
double x121EAMinProfitPerVolumeFactor = 0.01; // Min Volume Factor for Calculating Profit (Hedge)
double x121EAMaxAllowedDrawdownFactor = 0.002; // Max Allowed Drawdown Factor
//
@@ -207,6 +207,7 @@ bool InitialEA()
x121EAMaxAllowedSpread, // Max Allowed Spred for Opening Trades
x121EAMaxAllowedPositions, // Max Allowed Positions
x121EAMaxAllowedDrawdownFactor, // Max Allowed Drawdown Factor
x121EAVolume, // Static Volume for Positions
x121EAAllowLong, // Allow Long Trades
x121EAAllowShort, // Allow Short Trades
x121EAMinProfitPerTrade, // Min Profit Per Trade based On Volume Factor (Hedge)
@@ -229,6 +230,7 @@ bool InitialEA()
//
iDescriptor.symbol = iSymbol;
iDescriptor.period = iPeriod;
iDescriptor.staticVolume = x121EAVolume;
iDescriptor.allowLong = x121EAAllowLong;
iDescriptor.allowShort = x121EAAllowShort;
Copy(
@@ -242,181 +244,12 @@ bool InitialEA()
//
// Prepare Input Requirements ...
//
// XMC ...
iDescriptor.inputs.mcInputs.showFastMa = false;
iDescriptor.inputs.mcInputs.showSlowMa = false;
iDescriptor.inputs.mcInputs.showVerifierMa = false;
//
// XICH ...
iDescriptor.inputs.ichInputs.showKumo = false;
iDescriptor.inputs.ichInputs.showKijunSen = false;
iDescriptor.inputs.ichInputs.showTenkanSen = false;
iDescriptor.inputs.ichInputs.showChikouSpan = false;
iDescriptor.inputs.ichInputs.showSenkouSpanA = false;
iDescriptor.inputs.ichInputs.showSenkouSpanB = false;
iDescriptor.inputs.ichInputs.showKijunSenPlus = false;
iDescriptor.inputs.ichInputs.showKijunSenNegative = false;
//
// XCHE ...
iDescriptor.inputs.cheInputs.showLongExit1Line = false;
iDescriptor.inputs.cheInputs.showShortExit1Line = false;
iDescriptor.inputs.cheInputs.showLongExit2Line = false;
iDescriptor.inputs.cheInputs.showShortExit2Line = false;
//
// XPV ...
iDescriptor.inputs.pvInputs.showPeaksAndVales = true;
iDescriptor.inputs.pvInputs.showLevels = false;
iDescriptor.inputs.pvInputs.showConsolidations = false;
iDescriptor.inputs.pvInputs.showFibo1Levels = false;
iDescriptor.inputs.pvInputs.showFibo2Levels = false;
iDescriptor.inputs.pvInputs.showFibo3Levels = false;
iDescriptor.inputs.pvInputs.showFibo4Levels = false;
iDescriptor.inputs.pvInputs.showFibo5Levels = false;
//
// XZG ...
iDescriptor.inputs.zgInputs.showZigZag = false;
iDescriptor.inputs.zgInputs.showPeaksAndVales = false;
//
// XDON ...
iDescriptor.inputs.donInputs.showOpen = false;
iDescriptor.inputs.donInputs.showHigh = false;
iDescriptor.inputs.donInputs.showClose = false;
iDescriptor.inputs.donInputs.showLow = false;
//
// XSTR ...
iDescriptor.inputs.strInputs.showTrends = false;
iDescriptor.inputs.strInputs.fillTrends = false;
//
iDescriptor.inputs.symbol = iSymbol;
iDescriptor.inputs.period = iPeriod;
//
// Short MArket ...
iDescriptor.inputs.sMarketPeriod = NULL;
iDescriptor.inputs.sMarketMethod = X_PERIOD_AUTO;
//
// Medium Market ...
iDescriptor.inputs.mMarketPeriod = NULL;
iDescriptor.inputs.mMarketMethod = X_PERIOD_AUTO;
//
// Long Market ...
iDescriptor.inputs.lMarketPeriod = NULL;
iDescriptor.inputs.lMarketMethod = X_PERIOD_AUTO;
//
int fontSize = 12;
double fontAngel = 90;
string fontName = "Arial";
ENUM_ANCHOR_POINT fontAnchor = ANCHOR_LEFT_UPPER;
//
// Hind Market ...
iDescriptor.inputs.hMarketPeriod = NULL;
iDescriptor.inputs.hMarketMethod = X_PERIOD_AUTO;
iDescriptor.inputs.hMarketInputs.drawLabels = false;
iDescriptor.inputs.hMarketInputs.drawCBar = false;
iDescriptor.inputs.hMarketInputs.drawPBar = false;
iDescriptor.inputs.hMarketInputs.drawCBarMid = false;
iDescriptor.inputs.hMarketInputs.drawPBarMid = false;
iDescriptor.inputs.hMarketInputs.cBarDrawSpecs.Default();
iDescriptor.inputs.hMarketInputs.pBarDrawSpecs.Default();
//
iDescriptor.inputs.hMarketInputs.cBarDrawSpecs.openStyle.Label(
"C Hind Open",
iDescriptor.inputs.hMarketInputs.cBarDrawSpecs.openStyle.clr,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
iDescriptor.inputs.hMarketInputs.cBarDrawSpecs.highStyle.Label(
"C Hind High",
iDescriptor.inputs.hMarketInputs.cBarDrawSpecs.highStyle.clr,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
iDescriptor.inputs.hMarketInputs.cBarDrawSpecs.closeStyle.Label(
"C Hind Close",
iDescriptor.inputs.hMarketInputs.cBarDrawSpecs.closeStyle.clr,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
iDescriptor.inputs.hMarketInputs.cBarDrawSpecs.lowStyle.Label(
"C Hind Low",
iDescriptor.inputs.hMarketInputs.cBarDrawSpecs.lowStyle.clr,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
//
iDescriptor.inputs.hMarketInputs.pBarDrawSpecs.openStyle.Label(
"P Hind Open",
iDescriptor.inputs.hMarketInputs.pBarDrawSpecs.openStyle.clr,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
iDescriptor.inputs.hMarketInputs.pBarDrawSpecs.highStyle.Label(
"P Hind High",
iDescriptor.inputs.hMarketInputs.pBarDrawSpecs.highStyle.clr,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
iDescriptor.inputs.hMarketInputs.pBarDrawSpecs.closeStyle.Label(
"P Hind Close",
iDescriptor.inputs.hMarketInputs.pBarDrawSpecs.closeStyle.clr,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
iDescriptor.inputs.hMarketInputs.pBarDrawSpecs.lowStyle.Label(
"P Hind Low",
iDescriptor.inputs.hMarketInputs.pBarDrawSpecs.lowStyle.clr,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
iDescriptor.inputs.hMarketInputs.cBarMidDrawSpecs.clr = clrYellow;
iDescriptor.inputs.hMarketInputs.cBarMidDrawSpecs.Label(
"C Hind Mid",
clrYellow,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
iDescriptor.inputs.hMarketInputs.pBarMidDrawSpecs.clr = clrYellow;
iDescriptor.inputs.hMarketInputs.pBarMidDrawSpecs.Label(
"P Hind Mid",
clrYellow,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
ConfigureDescriptor(iDescriptor);
//
// Init Inputs ...
@@ -446,4 +279,675 @@ bool InitialEA()
return result;
}
//
// Configurators ...
//
// Configuring Descriptors ...
void ConfigureDescriptor(
X121ProviderDescriptor &iDescriptor //
)
{
//
// XHK ...
iDescriptor.inputs.hkInputs.drawHikenAshi = false;
iDescriptor.inputs.hkInputs.drawSmoothedHikenAshi = true;
//
// XMC ...
iDescriptor.inputs.mcInputs.showFastMa = false;
iDescriptor.inputs.mcInputs.showSlowMa = false;
iDescriptor.inputs.mcInputs.showVerifierMa = false;
//
// XICH ...
iDescriptor.inputs.ichInputs.showKumo = false;
iDescriptor.inputs.ichInputs.showKijunSen = false;
iDescriptor.inputs.ichInputs.showTenkanSen = false;
iDescriptor.inputs.ichInputs.showChikouSpan = false;
iDescriptor.inputs.ichInputs.showSenkouSpanA = false;
iDescriptor.inputs.ichInputs.showSenkouSpanB = false;
iDescriptor.inputs.ichInputs.showKijunSenPlus = false;
iDescriptor.inputs.ichInputs.showKijunSenNegative = false;
//
// XCHE ...
iDescriptor.inputs.cheInputs.showLongExit1Line = false;
iDescriptor.inputs.cheInputs.showShortExit1Line = false;
iDescriptor.inputs.cheInputs.showLongExit2Line = false;
iDescriptor.inputs.cheInputs.showShortExit2Line = false;
//
// XPV ...
iDescriptor.inputs.pvInputs.showPeaksAndVales = true;
iDescriptor.inputs.pvInputs.showLevels = false;
iDescriptor.inputs.pvInputs.showConsolidations = false;
iDescriptor.inputs.pvInputs.showFibo1Levels = false;
iDescriptor.inputs.pvInputs.showFibo2Levels = false;
iDescriptor.inputs.pvInputs.showFibo3Levels = false;
iDescriptor.inputs.pvInputs.showFibo4Levels = false;
iDescriptor.inputs.pvInputs.showFibo5Levels = false;
//
// XZG ...
iDescriptor.inputs.zgInputs.showZigZag = false;
iDescriptor.inputs.zgInputs.showPeaksAndVales = false;
//
// XDON ...
iDescriptor.inputs.donInputs.showOpen = false;
iDescriptor.inputs.donInputs.showHigh = false;
iDescriptor.inputs.donInputs.showClose = false;
iDescriptor.inputs.donInputs.showLow = false;
//
// XSTR ...
iDescriptor.inputs.strInputs.showTrends = false;
iDescriptor.inputs.strInputs.fillTrends = false;
//
// Short MArket ...
iDescriptor.inputs.sMarketPeriod = NULL;
iDescriptor.inputs.sMarketMethod = X_PERIOD_AUTO;
//
// Medium Market ...
iDescriptor.inputs.mMarketPeriod = NULL;
iDescriptor.inputs.mMarketMethod = X_PERIOD_AUTO;
//
// Long Market ...
iDescriptor.inputs.lMarketPeriod = NULL;
iDescriptor.inputs.lMarketMethod = X_PERIOD_AUTO;
//
int fontSize = 12;
double fontAngel = 90;
string fontName = "Arial";
ENUM_ANCHOR_POINT fontAnchor = ANCHOR_LEFT_UPPER;
//
// Current Market ...
ConfigureCurrentMarketDrawSpecs(
//
iDescriptor,
//
"Current",
//
false, // Draw Labels ...
false, // Draw C Bar ...
false, // Draw P Bar ...
false, // Draw C Bar Mid Line ...
false, // Draw P Bar Mid Line ...
//
fontSize,
fontAngel,
fontName,
fontAnchor // ,
//
// cBarPrefix
// pBarPrefix
// openLabel
// closeLabel
// highLabel
// lowLabel
// midLineLabel
);
//
// Short Market ...
ConfigureShortMarketDrawSpecs(
//
iDescriptor,
//
iDescriptor.inputs.sMarketPeriod,
iDescriptor.inputs.sMarketMethod,
//
"Short",
//
false, // Draw Labels ...
false, // Draw C Bar ...
false, // Draw P Bar ...
false, // Draw C Bar Mid Line ...
false, // Draw P Bar Mid Line ...
//
fontSize,
fontAngel,
fontName,
fontAnchor // ,
//
// cBarPrefix
// pBarPrefix
// openLabel
// closeLabel
// highLabel
// lowLabel
// midLineLabel
);
//
// Medium Market ...
ConfigureMediumMarketDrawSpecs(
//
iDescriptor,
//
iDescriptor.inputs.mMarketPeriod,
iDescriptor.inputs.mMarketMethod,
//
"Medium",
//
false, // Draw Labels ...
false, // Draw C Bar ...
false, // Draw P Bar ...
false, // Draw C Bar Mid Line ...
false, // Draw P Bar Mid Line ...
//
fontSize,
fontAngel,
fontName,
fontAnchor // ,
//
// cBarPrefix
// pBarPrefix
// openLabel
// closeLabel
// highLabel
// lowLabel
// midLineLabel
);
//
// Long Market ...
ConfigureLongMarketDrawSpecs(
//
iDescriptor,
//
iDescriptor.inputs.lMarketPeriod,
iDescriptor.inputs.lMarketMethod,
//
"Long",
//
false, // Draw Labels ...
false, // Draw C Bar ...
false, // Draw P Bar ...
false, // Draw C Bar Mid Line ...
false, // Draw P Bar Mid Line ...
//
fontSize,
fontAngel,
fontName,
fontAnchor // ,
//
// cBarPrefix
// pBarPrefix
// openLabel
// closeLabel
// highLabel
// lowLabel
// midLineLabel
);
//
// Hind Market ...
ConfigureHindMarketDrawSpecs(
//
iDescriptor,
//
iDescriptor.inputs.hMarketPeriod,
iDescriptor.inputs.hMarketMethod,
//
"Hind",
//
false, // Draw Labels ...
false, // Draw C Bar ...
false, // Draw P Bar ...
false, // Draw C Bar Mid Line ...
false, // Draw P Bar Mid Line ...
//
fontSize,
fontAngel,
fontName,
fontAnchor // ,
//
// cBarPrefix
// pBarPrefix
// openLabel
// closeLabel
// highLabel
// lowLabel
// midLineLabel
);
}
//
// Current ...
void ConfigureCurrentMarketDrawSpecs(
X121ProviderDescriptor &iDescriptor,
string prefix = "Current",
bool drawLabels = false,
bool drawCBar = false,
bool drawPBar = false,
bool drawCBarMid = false,
bool drawPBarMid = false,
int fontSize = 12,
double fontAngel = 90,
string fontName = "Arial",
ENUM_ANCHOR_POINT fontAnchor = ANCHOR_LEFT_UPPER,
string cBarPrefix = "C",
string pBarPrefix = "P",
string openLabel = "O",
string closeLabel = "C",
string highLabel = "H",
string lowLabel = "L",
string midLineLabel = "Mid" //
)
{
//
ConfigureMarketDrawSpecs(
iDescriptor.inputs.cMarketInputs,
//
drawLabels,
drawCBar,
drawPBar,
drawCBarMid,
drawPBarMid,
fontSize,
fontAngel,
fontName,
fontAnchor,
prefix,
cBarPrefix,
pBarPrefix,
openLabel,
closeLabel,
highLabel,
lowLabel,
midLineLabel //
);
}
//
// Short ...
void ConfigureShortMarketDrawSpecs(
X121ProviderDescriptor &iDescriptor,
ENUM_TIMEFRAMES period = NULL,
ENUM_X_PERIOD_METHOD method = X_PERIOD_AUTO,
string prefix = "Short",
bool drawLabels = false,
bool drawCBar = false,
bool drawPBar = false,
bool drawCBarMid = false,
bool drawPBarMid = false,
int fontSize = 12,
double fontAngel = 90,
string fontName = "Arial",
ENUM_ANCHOR_POINT fontAnchor = ANCHOR_LEFT_UPPER,
string cBarPrefix = "C",
string pBarPrefix = "P",
string openLabel = "O",
string closeLabel = "C",
string highLabel = "H",
string lowLabel = "L",
string midLineLabel = "Mid" //
)
{
//
// Short Market ...
iDescriptor.inputs.sMarketPeriod = period;
iDescriptor.inputs.sMarketMethod = method;
//
ConfigureMarketDrawSpecs(
iDescriptor.inputs.sMarketInputs,
//
drawLabels,
drawCBar,
drawPBar,
drawCBarMid,
drawPBarMid,
fontSize,
fontAngel,
fontName,
fontAnchor,
prefix,
cBarPrefix,
pBarPrefix,
openLabel,
closeLabel,
highLabel,
lowLabel,
midLineLabel //
);
}
//
// Medium ...
void ConfigureMediumMarketDrawSpecs(
X121ProviderDescriptor &iDescriptor,
ENUM_TIMEFRAMES period = NULL,
ENUM_X_PERIOD_METHOD method = X_PERIOD_AUTO,
string prefix = "Medium",
bool drawLabels = false,
bool drawCBar = false,
bool drawPBar = false,
bool drawCBarMid = false,
bool drawPBarMid = false,
int fontSize = 12,
double fontAngel = 90,
string fontName = "Arial",
ENUM_ANCHOR_POINT fontAnchor = ANCHOR_LEFT_UPPER,
string cBarPrefix = "C",
string pBarPrefix = "P",
string openLabel = "O",
string closeLabel = "C",
string highLabel = "H",
string lowLabel = "L",
string midLineLabel = "Mid" //
)
{
//
// Medium Market ...
iDescriptor.inputs.mMarketPeriod = period;
iDescriptor.inputs.mMarketMethod = method;
//
ConfigureMarketDrawSpecs(
iDescriptor.inputs.mMarketInputs,
//
drawLabels,
drawCBar,
drawPBar,
drawCBarMid,
drawPBarMid,
fontSize,
fontAngel,
fontName,
fontAnchor,
prefix,
cBarPrefix,
pBarPrefix,
openLabel,
closeLabel,
highLabel,
lowLabel,
midLineLabel //
);
}
//
// Long ...
void ConfigureLongMarketDrawSpecs(
X121ProviderDescriptor &iDescriptor,
ENUM_TIMEFRAMES period = NULL,
ENUM_X_PERIOD_METHOD method = X_PERIOD_AUTO,
string prefix = "Long",
bool drawLabels = false,
bool drawCBar = false,
bool drawPBar = false,
bool drawCBarMid = false,
bool drawPBarMid = false,
int fontSize = 12,
double fontAngel = 90,
string fontName = "Arial",
ENUM_ANCHOR_POINT fontAnchor = ANCHOR_LEFT_UPPER,
string cBarPrefix = "C",
string pBarPrefix = "P",
string openLabel = "O",
string closeLabel = "C",
string highLabel = "H",
string lowLabel = "L",
string midLineLabel = "Mid" //
)
{
//
// Long Market ...
iDescriptor.inputs.lMarketPeriod = period;
iDescriptor.inputs.lMarketMethod = method;
//
ConfigureMarketDrawSpecs(
iDescriptor.inputs.lMarketInputs,
//
drawLabels,
drawCBar,
drawPBar,
drawCBarMid,
drawPBarMid,
fontSize,
fontAngel,
fontName,
fontAnchor,
prefix,
cBarPrefix,
pBarPrefix,
openLabel,
closeLabel,
highLabel,
lowLabel,
midLineLabel //
);
}
//
// Hind ...
void ConfigureHindMarketDrawSpecs(
X121ProviderDescriptor &iDescriptor,
ENUM_TIMEFRAMES period = NULL,
ENUM_X_PERIOD_METHOD method = X_PERIOD_AUTO,
string prefix = "Hind",
bool drawLabels = false,
bool drawCBar = false,
bool drawPBar = false,
bool drawCBarMid = false,
bool drawPBarMid = false,
int fontSize = 12,
double fontAngel = 90,
string fontName = "Arial",
ENUM_ANCHOR_POINT fontAnchor = ANCHOR_LEFT_UPPER,
string cBarPrefix = "C",
string pBarPrefix = "P",
string openLabel = "O",
string closeLabel = "C",
string highLabel = "H",
string lowLabel = "L",
string midLineLabel = "Mid" //
)
{
//
// Hind Market ...
iDescriptor.inputs.hMarketPeriod = period;
iDescriptor.inputs.hMarketMethod = method;
//
ConfigureMarketDrawSpecs(
iDescriptor.inputs.hMarketInputs,
//
drawLabels,
drawCBar,
drawPBar,
drawCBarMid,
drawPBarMid,
fontSize,
fontAngel,
fontName,
fontAnchor,
prefix,
cBarPrefix,
pBarPrefix,
openLabel,
closeLabel,
highLabel,
lowLabel,
midLineLabel //
);
}
//
// Configure Market ...
void ConfigureMarketDrawSpecs(
X121MCycleInputs &inputs,
bool drawLabels = false,
bool drawCBar = false,
bool drawPBar = false,
bool drawCBarMid = false,
bool drawPBarMid = false,
int fontSize = 12,
double fontAngel = 90,
string fontName = "Arial",
ENUM_ANCHOR_POINT fontAnchor = ANCHOR_LEFT_UPPER,
string prefix = "",
string cBarPrefix = "C",
string pBarPrefix = "P",
string openLabel = "O",
string closeLabel = "C",
string highLabel = "H",
string lowLabel = "L",
string midLineLabel = "Mid" //
)
{
inputs.drawLabels = drawLabels;
inputs.drawCBar = drawCBar;
inputs.drawPBar = drawPBar;
inputs.drawCBarMid = drawCBarMid;
inputs.drawPBarMid = drawPBarMid;
inputs.cBarDrawSpecs.Default();
inputs.pBarDrawSpecs.Default();
//
if (drawCBarMid)
{
inputs.cBarMidDrawSpecs.clr = clrYellow;
}
//
if (drawPBarMid)
{
inputs.pBarMidDrawSpecs.clr = clrYellow;
}
//
if (drawLabels)
{
//
string cBarStr = prefix + " " + cBarPrefix + " ";
string pBarStr = prefix + " " + pBarPrefix + " ";
//
if (drawCBar)
{
//
inputs.cBarDrawSpecs.openStyle.Label(
cBarStr + openLabel,
inputs.cBarDrawSpecs.openStyle.clr,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
//
inputs.cBarDrawSpecs.highStyle.Label(
cBarStr + highLabel,
inputs.cBarDrawSpecs.highStyle.clr,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
//
inputs.cBarDrawSpecs.closeStyle.Label(
cBarStr + closeLabel,
inputs.cBarDrawSpecs.closeStyle.clr,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
//
inputs.cBarDrawSpecs.lowStyle.Label(
cBarStr + lowLabel,
inputs.cBarDrawSpecs.lowStyle.clr,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
}
//
if (drawPBar)
{
//
inputs.pBarDrawSpecs.openStyle.Label(
pBarStr + openLabel,
inputs.pBarDrawSpecs.openStyle.clr,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
//
inputs.pBarDrawSpecs.highStyle.Label(
pBarStr + highLabel,
inputs.pBarDrawSpecs.highStyle.clr,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
//
inputs.pBarDrawSpecs.closeStyle.Label(
pBarStr + closeLabel,
inputs.pBarDrawSpecs.closeStyle.clr,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
//
inputs.pBarDrawSpecs.lowStyle.Label(
pBarStr + lowLabel,
inputs.pBarDrawSpecs.lowStyle.clr,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
}
//
if (drawCBarMid)
{
//
inputs.cBarMidDrawSpecs.Label(
cBarStr + midLineLabel,
clrYellow,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
}
//
if (drawPBarMid)
{
//
inputs.pBarMidDrawSpecs.Label(
pBarStr + midLineLabel,
clrYellow,
fontName,
fontSize,
fontAnchor,
fontAngel //
);
}
}
}
//
+29 -18
View File
@@ -38,6 +38,7 @@ struct X5121ProviderDescriptor
ENUM_TIMEFRAMES period; // Trading Timeframe
bool allowLong; // Allow Long Signals
bool allowShort; // Allow Short Signals
double staticVolume; // Static Volume for Positions
ENUM_X5_SIGNAL_PROVIDERS signallers[]; // Allowed Signal Providers
//
@@ -70,7 +71,8 @@ struct X5121ProviderDescriptor
this.period,
this.signallers,
this.allowLong,
this.allowShort //
this.allowShort,
this.staticVolume //
);
//
@@ -81,7 +83,8 @@ struct X5121ProviderDescriptor
bool Init(
ENUM_X5_SIGNAL_PROVIDERS &mSignallers[], // Allowed Signal Providers
bool mAllowLong = true, // Allow Long Signals
bool mAllowShort = true // Allow Short Signals
bool mAllowShort = true, // Allow Short Signals
double mStaticVolume = 0.01 // Static Volume for Positions
)
{
//
@@ -93,7 +96,8 @@ struct X5121ProviderDescriptor
this.period,
mSignallers,
mAllowLong,
mAllowShort //
mAllowShort,
mStaticVolume //
);
//
@@ -106,7 +110,8 @@ struct X5121ProviderDescriptor
ENUM_TIMEFRAMES mPeriod, // Trading Timeframe
ENUM_X5_SIGNAL_PROVIDERS &mSignallers[], // Allowed Signal Providers
bool mAllowLong = true, // Allow Long Signals
bool mAllowShort = true // Allow Short Signals
bool mAllowShort = true, // Allow Short Signals
double mStaticVolume = 0.01 // Static Volume for Positions
)
{
//
@@ -118,6 +123,7 @@ struct X5121ProviderDescriptor
x5Inputs.IsValid() &&
IsValid(mSymbol) &&
IsValid(mPeriod) &&
NotEmpty(mStaticVolume) &&
(allowLong || allowShort) &&
ArraySize(mSignallers) > 0
//
@@ -132,6 +138,7 @@ struct X5121ProviderDescriptor
this.period = mPeriod;
this.allowLong = mAllowLong;
this.allowShort = mAllowShort;
this.staticVolume = mStaticVolume;
//
ENUM_X5_SIGNAL_PROVIDERS tmp[];
@@ -148,14 +155,16 @@ struct X5121ProviderDescriptor
// Instantiate Provider ...
x5Provider = new XSCX5Provider(
this.symbol,
this.period //
this.period,
this.staticVolume //
);
//
// Instantiate Provider ...
x121Provider = new XSCX121Provider(
this.symbol,
this.period //
this.period,
this.staticVolume //
);
//
@@ -238,6 +247,7 @@ struct X5121ProviderDescriptor
//
IsValid(symbol) &&
IsValid(period) &&
NotEmpty(staticVolume) &&
(validateInputs
? x5Inputs.IsValid() && x121Inputs.IsValid()
: true) &&
@@ -675,6 +685,7 @@ bool InitialEA()
//
iDescriptor.symbol = symbols[i];
iDescriptor.period = PERIOD_M5;
iDescriptor.staticVolume = x5121EAVolume;
iDescriptor.allowLong = x5121EAAllowLong;
iDescriptor.allowShort = x5121EAAllowShort;
Copy(
@@ -971,33 +982,33 @@ int RequestForSignal(
x121Conditions.mMarketConditions.isTrendBullish &&
x121Conditions.sMarketConditions.isTrendBullish &&
x121Conditions.cMarketConditions.isTrendBullish))
//
||
//
//
||
//
(x121Conditions.lMarketConditions.isTrendSwitchedToBullish &&
(x121Conditions.hMarketConditions.isTrendBullish &&
x121Conditions.mMarketConditions.isTrendBullish &&
x121Conditions.sMarketConditions.isTrendBullish &&
x121Conditions.cMarketConditions.isTrendBullish))
//
||
//
//
||
//
(x121Conditions.mMarketConditions.isTrendSwitchedToBullish &&
(x121Conditions.hMarketConditions.isTrendBullish &&
x121Conditions.lMarketConditions.isTrendBullish &&
x121Conditions.sMarketConditions.isTrendBullish &&
x121Conditions.cMarketConditions.isTrendBullish))
//
||
//
//
||
//
(x121Conditions.sMarketConditions.isTrendSwitchedToBullish &&
(x121Conditions.hMarketConditions.isTrendBullish &&
x121Conditions.lMarketConditions.isTrendBullish &&
x121Conditions.mMarketConditions.isTrendBullish &&
x121Conditions.cMarketConditions.isTrendBullish))
//
||
//
//
||
//
(x121Conditions.cMarketConditions.isTrendSwitchedToBullish &&
(x121Conditions.hMarketConditions.isTrendBullish &&
x121Conditions.lMarketConditions.isTrendBullish &&
+1
View File
@@ -218,6 +218,7 @@ bool InitialEA()
//
iDescriptor.symbol = symbols[i];
iDescriptor.period = PERIOD_M5;
iDescriptor.staticVolume = x5EAVolume;
iDescriptor.allowLong = x5EAAllowLong;
iDescriptor.allowShort = x5EAAllowShort;
Copy(