last ...
This commit is contained in:
+675
-171
@@ -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 //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
Reference in New Issue
Block a user