last works ...
This commit is contained in:
@@ -1071,7 +1071,8 @@ public:
|
||||
}
|
||||
|
||||
//
|
||||
string GenerateSummary(
|
||||
virtual string GenerateSummary(
|
||||
const bool onlySummary = false, // Only Generate Conditions Summary
|
||||
double cMarketMultiplier = 1, // Current Market Score Multiplier
|
||||
double sMarketMultiplier = 1.1, // Short Market Score Multiplier
|
||||
double mMarketMultiplier = 1.2, // Medium Market Score Multiplier
|
||||
@@ -1126,6 +1127,93 @@ public:
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// XZG ...
|
||||
string zigzagStr =
|
||||
//
|
||||
ToString("isZigZagInPeak", isZigZagInPeak, ignoreFalseConditions) +
|
||||
ToString("isZigZagInVale", isZigZagInVale, ignoreFalseConditions) +
|
||||
""
|
||||
//
|
||||
;
|
||||
zigzagStr = SetLabel("XZG: ", zigzagStr, separator);
|
||||
|
||||
//
|
||||
// XDON ...
|
||||
string donStr =
|
||||
//
|
||||
ToString("isDONAttachedMaxLower", isDONAttachedMaxLower, ignoreFalseConditions) +
|
||||
ToString("isDONAttachedMinLower", isDONAttachedMinLower, ignoreFalseConditions) +
|
||||
ToString("isDONCrossedOverMaxLower", isDONCrossedOverMaxLower, ignoreFalseConditions) +
|
||||
ToString("isDONCrossedUnderMaxLower", isDONCrossedUnderMaxLower, ignoreFalseConditions) +
|
||||
ToString("isDONAttachedMaxUpper", isDONAttachedMaxUpper, ignoreFalseConditions) +
|
||||
ToString("isDONAttachedMinUpper", isDONAttachedMinUpper, ignoreFalseConditions) +
|
||||
ToString("isDONCrossedOverMaxUpper", isDONCrossedOverMaxUpper, ignoreFalseConditions) +
|
||||
ToString("isDONCrossedUnderMaxUpper", isDONCrossedUnderMaxUpper, ignoreFalseConditions) +
|
||||
""
|
||||
//
|
||||
;
|
||||
donStr = SetLabel("XDON: ", donStr, separator);
|
||||
|
||||
//
|
||||
// XPV ...
|
||||
string pvStr =
|
||||
//
|
||||
ToString("isPVPeakSameAs", isPVPeakSameAs, ignoreFalseConditions) +
|
||||
ToString("isPVNewPeak", isPVNewPeak, ignoreFalseConditions) +
|
||||
ToString("isPVNewPeakOverLast", isPVNewPeakOverLast, ignoreFalseConditions) +
|
||||
ToString("isPVNewPeakUnderLast", isPVNewPeakUnderLast, ignoreFalseConditions) +
|
||||
ToString("isPVValeSameAs", isPVValeSameAs, ignoreFalseConditions) +
|
||||
ToString("isPVNewVale", isPVNewVale, ignoreFalseConditions) +
|
||||
ToString("isPVNewValeOverLast", isPVNewValeOverLast, ignoreFalseConditions) +
|
||||
ToString("isPVNewValeUnderLast", isPVNewValeUnderLast, ignoreFalseConditions) +
|
||||
ToString("isPVFiboIncreased", isPVFiboIncreased, ignoreFalseConditions) +
|
||||
ToString("isPVFiboDecreased", isPVFiboDecreased, ignoreFalseConditions) +
|
||||
ToString("isPVFiboSectionChanged", isPVFiboSectionChanged, ignoreFalseConditions) +
|
||||
ToString("isPVSCBullish", isPVSCBullish, ignoreFalseConditions) +
|
||||
ToString("isPVSCHHBullish", isPVSCHHBullish, ignoreFalseConditions) +
|
||||
ToString("isPVSCLLBullish", isPVSCLLBullish, ignoreFalseConditions) +
|
||||
ToString("isPVSCSwitchedToBullish", isPVSCSwitchedToBullish, ignoreFalseConditions) +
|
||||
ToString("isPVSCBearish", isPVSCBearish, ignoreFalseConditions) +
|
||||
ToString("isPVSCHHBearish", isPVSCHHBearish, ignoreFalseConditions) +
|
||||
ToString("isPVSCLLBearish", isPVSCLLBearish, ignoreFalseConditions) +
|
||||
ToString("isPVSCSwitchedToBearish", isPVSCSwitchedToBearish, ignoreFalseConditions) +
|
||||
ToString("isPVMCBullish", isPVMCBullish, ignoreFalseConditions) +
|
||||
ToString("isPVMCHHBullish", isPVMCHHBullish, ignoreFalseConditions) +
|
||||
ToString("isPVMCLLBullish", isPVMCLLBullish, ignoreFalseConditions) +
|
||||
ToString("isPVMCSwitchedToBullish", isPVMCSwitchedToBullish, ignoreFalseConditions) +
|
||||
ToString("isPVMCBearish", isPVMCBearish, ignoreFalseConditions) +
|
||||
ToString("isPVMCHHBearish", isPVMCHHBearish, ignoreFalseConditions) +
|
||||
ToString("isPVMCLLBearish", isPVMCLLBearish, ignoreFalseConditions) +
|
||||
ToString("isPVMCSwitchedToBearish", isPVMCSwitchedToBearish, ignoreFalseConditions) +
|
||||
ToString("isPVLCBullish", isPVLCBullish, ignoreFalseConditions) +
|
||||
ToString("isPVLCHHBullish", isPVLCHHBullish, ignoreFalseConditions) +
|
||||
ToString("isPVLCLLBullish", isPVLCLLBullish, ignoreFalseConditions) +
|
||||
ToString("isPVLCSwitchedToBullish", isPVLCSwitchedToBullish, ignoreFalseConditions) +
|
||||
ToString("isPVLCBearish", isPVLCBearish, ignoreFalseConditions) +
|
||||
ToString("isPVLCHHBearish", isPVLCHHBearish, ignoreFalseConditions) +
|
||||
ToString("isPVLCLLBearish", isPVLCLLBearish, ignoreFalseConditions) +
|
||||
ToString("isPVLCSwitchedToBearish", isPVLCSwitchedToBearish, ignoreFalseConditions) +
|
||||
ToString("isPVHCBullish", isPVHCBullish, ignoreFalseConditions) +
|
||||
ToString("isPVHCHHBullish", isPVHCHHBullish, ignoreFalseConditions) +
|
||||
ToString("isPVHCLLBullish", isPVHCLLBullish, ignoreFalseConditions) +
|
||||
ToString("isPVHCSwitchedToBullish", isPVHCSwitchedToBullish, ignoreFalseConditions) +
|
||||
ToString("isPVHCBearish", isPVHCBearish, ignoreFalseConditions) +
|
||||
ToString("isPVHCHHBearish", isPVHCHHBearish, ignoreFalseConditions) +
|
||||
ToString("isPVHCLLBearish", isPVHCLLBearish, ignoreFalseConditions) +
|
||||
ToString("isPVHCSwitchedToBearish", isPVHCSwitchedToBearish, ignoreFalseConditions) +
|
||||
""
|
||||
//
|
||||
;
|
||||
pvStr = SetLabel("XPV: ", pvStr, separator);
|
||||
|
||||
//
|
||||
string cMarketConditionsStr = cMarketConditions.GenerateSummary(onlySummary, cMarketMultiplier);
|
||||
string sMarketConditionsStr = sMarketConditions.GenerateSummary(onlySummary, sMarketMultiplier);
|
||||
string mMarketConditionsStr = mMarketConditions.GenerateSummary(onlySummary, mMarketMultiplier);
|
||||
string lMarketConditionsStr = lMarketConditions.GenerateSummary(onlySummary, lMarketMultiplier);
|
||||
string hMarketConditionsStr = hMarketConditions.GenerateSummary(onlySummary, hMarketMultiplier);
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
@@ -1133,6 +1221,18 @@ public:
|
||||
(IsSpecifiedValid(provided) ? provided + separator : "") +
|
||||
"-----------------------------" + separator +
|
||||
commonStr +
|
||||
(!onlySummary
|
||||
? zigzagStr +
|
||||
donStr +
|
||||
pvStr +
|
||||
"======" + separator +
|
||||
cMarketConditionsStr +
|
||||
sMarketConditionsStr +
|
||||
mMarketConditionsStr +
|
||||
lMarketConditionsStr +
|
||||
hMarketConditionsStr +
|
||||
""
|
||||
: "") +
|
||||
""
|
||||
//
|
||||
;
|
||||
@@ -1615,7 +1715,6 @@ public:
|
||||
// Here We Have to Prepare Signal ...
|
||||
|
||||
//
|
||||
// TODO: Make this Configurable ...
|
||||
string symbol = GetSymbol();
|
||||
ENUM_TIMEFRAMES period = GetPeriod();
|
||||
double tpPoint = 60;
|
||||
@@ -1637,14 +1736,80 @@ public:
|
||||
symbol,
|
||||
type //
|
||||
);
|
||||
double tp = hasLong
|
||||
? entry + tpPrice
|
||||
: entry - tpPrice;
|
||||
double sl = hasLong
|
||||
? entry - slPrice
|
||||
: entry + slPrice;
|
||||
|
||||
//
|
||||
double tp = 0;
|
||||
double sl = 0;
|
||||
|
||||
//
|
||||
ENUM_X_SIGNAL_MANAGING_ACTIONS action = X_SIGNAL_USE_NOTHING;
|
||||
|
||||
//
|
||||
// TODO: Make Configurable ...
|
||||
double r2r = 2;
|
||||
|
||||
//
|
||||
if (provider == ToString(X786))
|
||||
{
|
||||
//
|
||||
double maxDonUpper = donHelper.GetMaxUpper(0);
|
||||
double minDonUpper = donHelper.GetMinUpper(0);
|
||||
|
||||
//
|
||||
double maxDonLower = donHelper.GetMaxLower(0);
|
||||
double minDonLower = donHelper.GetMinLower(0);
|
||||
|
||||
//
|
||||
double peak = pvHelper.GetPeak(0);
|
||||
double vale = pvHelper.GetVale(0);
|
||||
|
||||
//
|
||||
double hCHELE2 = hMarket.che.GetLongExit2(0);
|
||||
double hCHESE2 = hMarket.che.GetShortExit2(0);
|
||||
|
||||
//
|
||||
double lCHELE2 = lMarket.che.GetLongExit2(0);
|
||||
double lCHESE2 = lMarket.che.GetShortExit2(0);
|
||||
|
||||
//
|
||||
sl = hasLong
|
||||
? lCHELE2
|
||||
: lCHESE2;
|
||||
|
||||
//
|
||||
double risk = MathAbs(entry - sl);
|
||||
|
||||
//
|
||||
double reward = risk * r2r;
|
||||
|
||||
//
|
||||
tp = hasLong
|
||||
? entry + reward
|
||||
: entry - reward;
|
||||
}
|
||||
else if (provider == ToString(X121))
|
||||
{
|
||||
//
|
||||
double peak = pvHelper.GetPeak(0);
|
||||
double vale = pvHelper.GetVale(0);
|
||||
|
||||
//
|
||||
sl = hasLong
|
||||
? vale
|
||||
: peak;
|
||||
|
||||
//
|
||||
double risk = MathAbs(entry - sl);
|
||||
|
||||
//
|
||||
double reward = risk * r2r;
|
||||
|
||||
//
|
||||
tp = hasLong
|
||||
? entry + reward
|
||||
: entry - reward;
|
||||
}
|
||||
|
||||
//
|
||||
result = mSignal.Prepare(
|
||||
symbol,
|
||||
@@ -1680,14 +1845,43 @@ public:
|
||||
}
|
||||
|
||||
//
|
||||
void Draw()
|
||||
// Check for any Guards ...
|
||||
bool HasGuard(XGuard &guards[])
|
||||
{
|
||||
//
|
||||
return;
|
||||
bool result = false;
|
||||
|
||||
// //
|
||||
// XOHCL bar;
|
||||
// bar.Init(
|
||||
// GetSymbol(),
|
||||
// GetPeriod(),
|
||||
// 0 //
|
||||
// );
|
||||
|
||||
// //
|
||||
// double maxDONUppers = donHelper.GetMaxUpper(0);
|
||||
// double minDONUppers = donHelper.GetMinUpper(0);
|
||||
// // double minDONUppers = donHelper.GetMinUpper(1);
|
||||
|
||||
// //
|
||||
// bool isDONUpAttached =
|
||||
// //
|
||||
// bar.high >= maxDONUppers
|
||||
// //
|
||||
// ;
|
||||
// if (isDONUpAttached)
|
||||
// {
|
||||
// Print("Force Close Short X786");
|
||||
// }
|
||||
|
||||
//
|
||||
// ulong chID = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
void Draw()
|
||||
{
|
||||
//
|
||||
string symbol = GetSymbol();
|
||||
ENUM_TIMEFRAMES period = GetPeriod();
|
||||
@@ -1865,7 +2059,7 @@ private:
|
||||
if (mIsX121SignalProviderEnable)
|
||||
{
|
||||
//
|
||||
hasX121Signal = XSIHasSpecifiedLongSignal(
|
||||
hasX121Signal = X121HasSpecifiedLongSignal(
|
||||
mConditions //
|
||||
);
|
||||
|
||||
@@ -1888,7 +2082,7 @@ private:
|
||||
if (mIsX110SignalProviderEnable)
|
||||
{
|
||||
//
|
||||
hasX110Signal = XTSFIHasSpecifiedLongSignal(
|
||||
hasX110Signal = X110HasSpecifiedLongSignal(
|
||||
mConditions //
|
||||
);
|
||||
|
||||
@@ -1911,7 +2105,7 @@ private:
|
||||
if (mIsX92SignalProviderEnable)
|
||||
{
|
||||
//
|
||||
hasX92Signal = XOBDLHHasSpecifiedLongSignal(
|
||||
hasX92Signal = X92HasSpecifiedLongSignal(
|
||||
mConditions //
|
||||
);
|
||||
|
||||
@@ -2055,7 +2249,7 @@ private:
|
||||
if (mIsX121SignalProviderEnable)
|
||||
{
|
||||
//
|
||||
hasX121Signal = XSIHasSpecifiedShortSignal(
|
||||
hasX121Signal = X121HasSpecifiedShortSignal(
|
||||
mConditions //
|
||||
);
|
||||
|
||||
@@ -2078,7 +2272,7 @@ private:
|
||||
if (mIsX110SignalProviderEnable)
|
||||
{
|
||||
//
|
||||
hasX110Signal = XTSFIHasSpecifiedShortSignal(
|
||||
hasX110Signal = X110HasSpecifiedShortSignal(
|
||||
mConditions //
|
||||
);
|
||||
|
||||
@@ -2925,12 +3119,146 @@ private:
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
// Check For Long ...
|
||||
bool isSTRLong =
|
||||
//
|
||||
(mConditions.hMarketConditions.isTrendSwitchedToBullish &&
|
||||
(mConditions.lMarketConditions.isTrendBullish &&
|
||||
mConditions.mMarketConditions.isTrendBullish &&
|
||||
mConditions.sMarketConditions.isTrendBullish &&
|
||||
mConditions.cMarketConditions.isTrendBullish))
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.lMarketConditions.isTrendSwitchedToBullish &&
|
||||
(mConditions.hMarketConditions.isTrendBullish &&
|
||||
mConditions.mMarketConditions.isTrendBullish &&
|
||||
mConditions.sMarketConditions.isTrendBullish &&
|
||||
mConditions.cMarketConditions.isTrendBullish))
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.mMarketConditions.isTrendSwitchedToBullish &&
|
||||
(mConditions.hMarketConditions.isTrendBullish &&
|
||||
mConditions.lMarketConditions.isTrendBullish &&
|
||||
mConditions.sMarketConditions.isTrendBullish &&
|
||||
mConditions.cMarketConditions.isTrendBullish))
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.sMarketConditions.isTrendSwitchedToBullish &&
|
||||
(mConditions.hMarketConditions.isTrendBullish &&
|
||||
mConditions.lMarketConditions.isTrendBullish &&
|
||||
mConditions.mMarketConditions.isTrendBullish &&
|
||||
mConditions.cMarketConditions.isTrendBullish))
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.cMarketConditions.isTrendSwitchedToBullish &&
|
||||
(mConditions.hMarketConditions.isTrendBullish &&
|
||||
mConditions.lMarketConditions.isTrendBullish &&
|
||||
mConditions.mMarketConditions.isTrendBullish &&
|
||||
mConditions.sMarketConditions.isTrendBullish))
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isCHELong =
|
||||
//
|
||||
(mConditions.hMarketConditions.isCHESwitchedInStrongLong &&
|
||||
(mConditions.cMarketConditions.isCHEInStrongLong &&
|
||||
mConditions.sMarketConditions.isCHEInStrongLong &&
|
||||
mConditions.mMarketConditions.isCHEInStrongLong &&
|
||||
mConditions.lMarketConditions.isCHEInStrongLong))
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.lMarketConditions.isCHESwitchedInStrongLong &&
|
||||
(mConditions.cMarketConditions.isCHEInStrongLong &&
|
||||
mConditions.sMarketConditions.isCHEInStrongLong &&
|
||||
mConditions.mMarketConditions.isCHEInStrongLong &&
|
||||
mConditions.hMarketConditions.isCHEInStrongLong))
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.mMarketConditions.isCHESwitchedInStrongLong &&
|
||||
(mConditions.cMarketConditions.isCHEInStrongLong &&
|
||||
mConditions.sMarketConditions.isCHEInStrongLong &&
|
||||
mConditions.lMarketConditions.isCHEInStrongLong &&
|
||||
mConditions.hMarketConditions.isCHEInStrongLong))
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.sMarketConditions.isCHESwitchedInStrongLong &&
|
||||
(mConditions.cMarketConditions.isCHEInStrongLong &&
|
||||
mConditions.mMarketConditions.isCHEInStrongLong &&
|
||||
mConditions.lMarketConditions.isCHEInStrongLong &&
|
||||
mConditions.hMarketConditions.isCHEInStrongLong))
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.cMarketConditions.isCHESwitchedInStrongLong &&
|
||||
(mConditions.sMarketConditions.isCHEInStrongLong &&
|
||||
mConditions.mMarketConditions.isCHEInStrongLong &&
|
||||
mConditions.lMarketConditions.isCHEInStrongLong &&
|
||||
mConditions.hMarketConditions.isCHEInStrongLong))
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
isSTRLong
|
||||
//
|
||||
&&
|
||||
//
|
||||
isCHELong
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool XSIHasSpecifiedLongSignal(
|
||||
bool X121HasSpecifiedLongSignal(
|
||||
X121MarketConditions &mConditions //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
bool isMCLong =
|
||||
//
|
||||
(
|
||||
//
|
||||
(mConditions.cMarketConditions.isSlowOverVerifier &&
|
||||
mConditions.cMarketConditions.isFastCrossedOverVerifier)
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.cMarketConditions.isFastOverVerifier &&
|
||||
mConditions.cMarketConditions.isSlowCrossedOverVerifier)
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
isMCLong
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool X110HasSpecifiedLongSignal(
|
||||
X121MarketConditions &mConditions //
|
||||
)
|
||||
{
|
||||
@@ -2942,19 +3270,7 @@ private:
|
||||
}
|
||||
|
||||
//
|
||||
bool XTSFIHasSpecifiedLongSignal(
|
||||
X121MarketConditions &mConditions //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool XOBDLHHasSpecifiedLongSignal(
|
||||
bool X92HasSpecifiedLongSignal(
|
||||
X121MarketConditions &mConditions //
|
||||
)
|
||||
{
|
||||
@@ -2997,24 +3313,146 @@ private:
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
// Check For Short ...
|
||||
bool isSTRShort =
|
||||
//
|
||||
(mConditions.hMarketConditions.isTrendSwitchedToBearish &&
|
||||
(mConditions.lMarketConditions.isTrendBearish &&
|
||||
mConditions.mMarketConditions.isTrendBearish &&
|
||||
mConditions.sMarketConditions.isTrendBearish &&
|
||||
mConditions.cMarketConditions.isTrendBearish))
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.lMarketConditions.isTrendSwitchedToBearish &&
|
||||
(mConditions.hMarketConditions.isTrendBearish &&
|
||||
mConditions.mMarketConditions.isTrendBearish &&
|
||||
mConditions.sMarketConditions.isTrendBearish &&
|
||||
mConditions.cMarketConditions.isTrendBearish))
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.mMarketConditions.isTrendSwitchedToBearish &&
|
||||
(mConditions.hMarketConditions.isTrendBearish &&
|
||||
mConditions.lMarketConditions.isTrendBearish &&
|
||||
mConditions.sMarketConditions.isTrendBearish &&
|
||||
mConditions.cMarketConditions.isTrendBearish))
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.sMarketConditions.isTrendSwitchedToBearish &&
|
||||
(mConditions.hMarketConditions.isTrendBearish &&
|
||||
mConditions.lMarketConditions.isTrendBearish &&
|
||||
mConditions.mMarketConditions.isTrendBearish &&
|
||||
mConditions.cMarketConditions.isTrendBearish))
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.cMarketConditions.isTrendSwitchedToBearish &&
|
||||
(mConditions.hMarketConditions.isTrendBearish &&
|
||||
mConditions.lMarketConditions.isTrendBearish &&
|
||||
mConditions.mMarketConditions.isTrendBearish &&
|
||||
mConditions.sMarketConditions.isTrendBearish))
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isCHEShort =
|
||||
//
|
||||
(mConditions.hMarketConditions.isCHESwitchedInStrongShort &&
|
||||
(mConditions.cMarketConditions.isCHEInStrongShort &&
|
||||
mConditions.sMarketConditions.isCHEInStrongShort &&
|
||||
mConditions.mMarketConditions.isCHEInStrongShort &&
|
||||
mConditions.lMarketConditions.isCHEInStrongShort))
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.lMarketConditions.isCHESwitchedInStrongShort &&
|
||||
(mConditions.cMarketConditions.isCHEInStrongShort &&
|
||||
mConditions.sMarketConditions.isCHEInStrongShort &&
|
||||
mConditions.mMarketConditions.isCHEInStrongShort &&
|
||||
mConditions.hMarketConditions.isCHEInStrongShort))
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.mMarketConditions.isCHESwitchedInStrongShort &&
|
||||
(mConditions.cMarketConditions.isCHEInStrongShort &&
|
||||
mConditions.sMarketConditions.isCHEInStrongShort &&
|
||||
mConditions.lMarketConditions.isCHEInStrongShort &&
|
||||
mConditions.hMarketConditions.isCHEInStrongShort))
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.sMarketConditions.isCHESwitchedInStrongShort &&
|
||||
(mConditions.cMarketConditions.isCHEInStrongShort &&
|
||||
mConditions.mMarketConditions.isCHEInStrongShort &&
|
||||
mConditions.lMarketConditions.isCHEInStrongShort &&
|
||||
mConditions.hMarketConditions.isCHEInStrongShort))
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.cMarketConditions.isCHESwitchedInStrongShort &&
|
||||
(mConditions.sMarketConditions.isCHEInStrongShort &&
|
||||
mConditions.mMarketConditions.isCHEInStrongShort &&
|
||||
mConditions.lMarketConditions.isCHEInStrongShort &&
|
||||
mConditions.hMarketConditions.isCHEInStrongShort))
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
isSTRShort
|
||||
//
|
||||
&&
|
||||
//
|
||||
isCHEShort
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool XSIHasSpecifiedShortSignal(
|
||||
bool X121HasSpecifiedShortSignal(
|
||||
X121MarketConditions &mConditions //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
bool isMCShort =
|
||||
//
|
||||
(
|
||||
//
|
||||
(mConditions.cMarketConditions.isSlowUnderVerifier &&
|
||||
mConditions.cMarketConditions.isFastCrossedUnderVerifier)
|
||||
//
|
||||
||
|
||||
//
|
||||
(mConditions.cMarketConditions.isFastUnderVerifier &&
|
||||
mConditions.cMarketConditions.isSlowCrossedUnderVerifier)
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
isMCShort
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool XTSFIHasSpecifiedShortSignal(
|
||||
bool X110HasSpecifiedShortSignal(
|
||||
X121MarketConditions &mConditions //
|
||||
)
|
||||
{
|
||||
|
||||
@@ -185,8 +185,44 @@ public:
|
||||
bool CheckForGuard(XGuard &guards[]) override
|
||||
{
|
||||
//
|
||||
// TODO: Implement this ...
|
||||
return false;
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
Clean(guards);
|
||||
|
||||
//
|
||||
int descriptorsCount = CountDescriptors();
|
||||
result = descriptorsCount > 0;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
for (int i = 0; i < descriptorsCount; i++)
|
||||
{
|
||||
//
|
||||
X121ProviderDescriptor iDescriptor = mDescriptors[i];
|
||||
|
||||
//
|
||||
XGuard iGuards[];
|
||||
bool iHasGuard = iDescriptor.provider.HasGuard(iGuards);
|
||||
if (iHasGuard)
|
||||
{
|
||||
//
|
||||
Copy(
|
||||
iGuards,
|
||||
guards,
|
||||
false //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(guards) > 0;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -250,8 +286,193 @@ public:
|
||||
bool HandleStateManagement() override
|
||||
{
|
||||
//
|
||||
// TODO: Implement this ...
|
||||
return false;
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
int requiredAgeForSLTrail = 10;
|
||||
int requiredDistanceForSLTrail = 10;
|
||||
|
||||
//
|
||||
XPosition positions[];
|
||||
int positionsCount = mTrader.GetPositions(positions);
|
||||
if (positionsCount <= 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Trail Positions Stop ...
|
||||
for (int i = 0; i < positionsCount; i++)
|
||||
{
|
||||
//
|
||||
XPosition iPosition = positions[i];
|
||||
|
||||
//
|
||||
// Position Management for X786 ...
|
||||
if (iPosition.provider == ToString(X786) ||
|
||||
iPosition.provider == ToString(X121))
|
||||
{
|
||||
//
|
||||
// Check Position in Profit or not ...
|
||||
if (iPosition.profit > 0)
|
||||
{
|
||||
//
|
||||
XTrail trail;
|
||||
bool isTrailedBefore = GetTrail(
|
||||
iPosition.ticket,
|
||||
trail //
|
||||
);
|
||||
|
||||
//
|
||||
if (!isTrailedBefore)
|
||||
{
|
||||
//
|
||||
// Add First Time ...
|
||||
|
||||
//
|
||||
// Check Position Age ...
|
||||
int iPositionAge = iPosition.GetAge(iPosition.period);
|
||||
if (iPositionAge < requiredAgeForSLTrail)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Check Position Profit Distance ...
|
||||
double priceDistanceInPoint = PriceToPoint(iPosition.profit / iPosition.volume, iPosition.symbol);
|
||||
double priceDistance = PointToPrice(priceDistanceInPoint, iPosition.symbol);
|
||||
if (priceDistance < requiredDistanceForSLTrail)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
double slDiff = PointToPrice(priceDistance, iPosition.symbol);
|
||||
|
||||
//
|
||||
double sl =
|
||||
IsLong(iPosition.type)
|
||||
? iPosition.sl + slDiff
|
||||
: iPosition.sl - slDiff;
|
||||
|
||||
//
|
||||
bool isInit = trail.Init(
|
||||
iPosition.ticket,
|
||||
iPosition.type,
|
||||
iPosition.profit,
|
||||
iPosition.sl,
|
||||
sl);
|
||||
if (!isInit)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// Update Exists ...
|
||||
|
||||
//
|
||||
// Check Profit ...
|
||||
bool isProfitPassed = iPosition.profit > trail.profit;
|
||||
if (!isProfitPassed)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Check Age Distance from Last ...
|
||||
int age = iBarShift(
|
||||
iPosition.symbol,
|
||||
iPosition.period,
|
||||
trail.time,
|
||||
false //
|
||||
);
|
||||
if (age < requiredAgeForSLTrail)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
double priceDistanceInPoint = PriceToPoint((iPosition.profit - trail.profit) / iPosition.volume, iPosition.symbol);
|
||||
double priceDistance = PointToPrice(priceDistanceInPoint, iPosition.symbol);
|
||||
if (priceDistance < requiredDistanceForSLTrail)
|
||||
{
|
||||
//
|
||||
// int positionAge = iPosition.GetAge(iPosition.period);
|
||||
if (trail.level >= 3)
|
||||
{
|
||||
//
|
||||
string comment = "EQM Close In Profit ...";
|
||||
bool isClosed = mTrader.Close(
|
||||
iPosition.ticket,
|
||||
comment //
|
||||
);
|
||||
if (isClosed)
|
||||
{
|
||||
//
|
||||
RemoveTrail(iPosition.ticket);
|
||||
|
||||
//
|
||||
string message = "EQM Close (" + ToString(iPosition.ticket) + ") In Profit ...";
|
||||
mAlert.Alert(message);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
double slDiff = PointToPrice(priceDistance, iPosition.symbol);
|
||||
|
||||
//
|
||||
double sl =
|
||||
IsLong(iPosition.type)
|
||||
? iPosition.sl + slDiff
|
||||
: iPosition.sl - slDiff;
|
||||
|
||||
//
|
||||
// Update Trail Values ...
|
||||
bool isUpdated = trail.Update(
|
||||
sl,
|
||||
iPosition.profit //
|
||||
);
|
||||
if (!isUpdated)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (trail.IsValid())
|
||||
{
|
||||
//
|
||||
string comment = trail.GenerateTag();
|
||||
bool isModified = mTrader.Modify(
|
||||
trail.ticket,
|
||||
trail.after,
|
||||
iPosition.tp,
|
||||
comment //
|
||||
);
|
||||
if (isModified)
|
||||
{
|
||||
//
|
||||
RemoveTrail(trail.ticket);
|
||||
|
||||
//
|
||||
AddTrail(trail);
|
||||
|
||||
//
|
||||
string message = "Position (" + ToString(trail.ticket) + ") Trailed SL on Level: " + ToString(trail.level);
|
||||
mAlert.Alert(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Must false ...
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -319,6 +540,117 @@ private:
|
||||
return ArraySize(mDescriptors);
|
||||
}
|
||||
|
||||
//
|
||||
// Trails Holding ...
|
||||
|
||||
//
|
||||
XTrail mTrails[];
|
||||
|
||||
//
|
||||
int CountTrails()
|
||||
{
|
||||
return ArraySize(mTrails);
|
||||
}
|
||||
|
||||
//
|
||||
bool RemoveTrail(ulong ticket)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
int idx = FindTrailIndex(ticket);
|
||||
result = idx >= 0;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = ArrayRemove(
|
||||
mTrails,
|
||||
idx,
|
||||
1 //
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int FindTrailIndex(ulong ticket)
|
||||
{
|
||||
//
|
||||
int result = -1;
|
||||
|
||||
//
|
||||
int trailsCount = CountTrails();
|
||||
if (ticket <= 0 || trailsCount <= 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
for (int i = 0; i < trailsCount; i++)
|
||||
{
|
||||
//
|
||||
XTrail iTrail = mTrails[i];
|
||||
|
||||
//
|
||||
if (iTrail.ticket == ticket)
|
||||
{
|
||||
//
|
||||
result = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool GetTrail(
|
||||
ulong ticket,
|
||||
XTrail &trail //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
int idx = FindTrailIndex(ticket);
|
||||
result = idx >= 0;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
trail = mTrails[idx];
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
void AddTrail(
|
||||
XTrail &trail //
|
||||
)
|
||||
{
|
||||
//
|
||||
if (!trail.IsValid())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
AddRef(
|
||||
trail,
|
||||
mTrails //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
};
|
||||
|
||||
@@ -479,6 +479,12 @@ public:
|
||||
bool isCloseUnderSlow;
|
||||
bool isCloseOverVerifier;
|
||||
bool isCloseUnderVerifier;
|
||||
bool isFastCrossedOverSlow;
|
||||
bool isFastCrossedUnderSlow;
|
||||
bool isFastCrossedOverVerifier;
|
||||
bool isFastCrossedUnderVerifier;
|
||||
bool isSlowCrossedOverVerifier;
|
||||
bool isSlowCrossedUnderVerifier;
|
||||
|
||||
//
|
||||
// XSTR ...
|
||||
@@ -491,8 +497,10 @@ public:
|
||||
// XCHE ...
|
||||
bool isCHEInLong;
|
||||
bool isCHEInStrongLong;
|
||||
bool isCHESwitchedInStrongLong;
|
||||
bool isCHEInShort;
|
||||
bool isCHEInStrongShort;
|
||||
bool isCHESwitchedInStrongShort;
|
||||
|
||||
//
|
||||
// XOSC ...
|
||||
@@ -1190,6 +1198,24 @@ public:
|
||||
{
|
||||
bullScore++;
|
||||
}
|
||||
if (isFastCrossedOverSlow)
|
||||
{
|
||||
//
|
||||
bullScore++;
|
||||
bearScore--;
|
||||
}
|
||||
if (isFastCrossedOverVerifier)
|
||||
{
|
||||
//
|
||||
bullScore++;
|
||||
bearScore--;
|
||||
}
|
||||
if (isSlowCrossedOverVerifier)
|
||||
{
|
||||
//
|
||||
bullScore++;
|
||||
bearScore--;
|
||||
}
|
||||
|
||||
//
|
||||
// BEARISH ...
|
||||
@@ -1217,6 +1243,60 @@ public:
|
||||
{
|
||||
bearScore++;
|
||||
}
|
||||
if (isFastCrossedUnderSlow)
|
||||
{
|
||||
//
|
||||
bullScore--;
|
||||
bearScore++;
|
||||
}
|
||||
if (isFastCrossedUnderVerifier)
|
||||
{
|
||||
//
|
||||
bullScore--;
|
||||
bearScore++;
|
||||
}
|
||||
if (isSlowCrossedUnderVerifier)
|
||||
{
|
||||
//
|
||||
bullScore--;
|
||||
bearScore++;
|
||||
}
|
||||
|
||||
//
|
||||
// XCHE ...
|
||||
if (isCHEInLong)
|
||||
{
|
||||
bullScore++;
|
||||
}
|
||||
if (isCHEInStrongLong)
|
||||
{
|
||||
//
|
||||
bullScore++;
|
||||
bearScore--;
|
||||
}
|
||||
if (isCHESwitchedInStrongLong)
|
||||
{
|
||||
//
|
||||
bullScore++;
|
||||
bearScore--;
|
||||
}
|
||||
if (isCHEInShort)
|
||||
{
|
||||
//
|
||||
bearScore++;
|
||||
}
|
||||
if (isCHEInStrongShort)
|
||||
{
|
||||
//
|
||||
bullScore--;
|
||||
bearScore++;
|
||||
}
|
||||
if (isCHESwitchedInStrongShort)
|
||||
{
|
||||
//
|
||||
bullScore--;
|
||||
bearScore++;
|
||||
}
|
||||
|
||||
//
|
||||
// XOSC ...
|
||||
@@ -1563,8 +1643,10 @@ public:
|
||||
//
|
||||
ToString("isCHEInLong", isCHEInLong, ignoreFalseConditions) +
|
||||
ToString("isCHEInStrongLong", isCHEInStrongLong, ignoreFalseConditions) +
|
||||
ToString("isCHESwitchedInStrongLong", isCHESwitchedInStrongLong, ignoreFalseConditions) +
|
||||
ToString("isCHEInShort", isCHEInShort, ignoreFalseConditions) +
|
||||
ToString("isCHEInStrongShort", isCHEInStrongShort, ignoreFalseConditions) +
|
||||
ToString("isCHESwitchedInStrongShort", isCHESwitchedInStrongShort, ignoreFalseConditions) +
|
||||
""
|
||||
//
|
||||
;
|
||||
@@ -1607,6 +1689,12 @@ public:
|
||||
ToString("isCloseUnderSlow", isCloseUnderSlow, ignoreFalseConditions) +
|
||||
ToString("isCloseOverVerifier", isCloseOverVerifier, ignoreFalseConditions) +
|
||||
ToString("isCloseUnderVerifier", isCloseUnderVerifier, ignoreFalseConditions) +
|
||||
ToString("isFastCrossedOverSlow", isFastCrossedOverSlow, ignoreFalseConditions) +
|
||||
ToString("isFastCrossedUnderSlow", isFastCrossedUnderSlow, ignoreFalseConditions) +
|
||||
ToString("isFastCrossedOverVerifier", isFastCrossedOverVerifier, ignoreFalseConditions) +
|
||||
ToString("isFastCrossedUnderVerifier", isFastCrossedUnderVerifier, ignoreFalseConditions) +
|
||||
ToString("isSlowCrossedOverVerifier", isSlowCrossedOverVerifier, ignoreFalseConditions) +
|
||||
ToString("isSlowCrossedUnderVerifier", isSlowCrossedUnderVerifier, ignoreFalseConditions) +
|
||||
""
|
||||
//
|
||||
;
|
||||
@@ -2135,29 +2223,63 @@ public:
|
||||
NotEmpty(che.GetLongExit1(curr))
|
||||
//
|
||||
;
|
||||
bool isCHEInLongPrev =
|
||||
//
|
||||
NotEmpty(che.GetLongExit1(prev))
|
||||
//
|
||||
;
|
||||
bool isCHEInStrongLong =
|
||||
//
|
||||
isCHEInLong &&
|
||||
NotEmpty(che.GetLongExit2(curr))
|
||||
//
|
||||
;
|
||||
bool isCHEInStrongLongPrev =
|
||||
//
|
||||
isCHEInLongPrev &&
|
||||
NotEmpty(che.GetLongExit2(prev))
|
||||
//
|
||||
;
|
||||
bool isCHEInShort =
|
||||
//
|
||||
NotEmpty(che.GetShortExit1(curr))
|
||||
//
|
||||
;
|
||||
bool isCHEInShortPrev =
|
||||
//
|
||||
NotEmpty(che.GetShortExit1(prev))
|
||||
//
|
||||
;
|
||||
bool isCHEInStrongShort =
|
||||
//
|
||||
isCHEInShort &&
|
||||
NotEmpty(che.GetShortExit2(curr))
|
||||
//
|
||||
;
|
||||
bool isCHEInStrongShortPrev =
|
||||
//
|
||||
isCHEInShortPrev &&
|
||||
NotEmpty(che.GetShortExit2(prev))
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
conditions.isCHEInLong = isCHEInLong;
|
||||
conditions.isCHEInShort = isCHEInShort;
|
||||
conditions.isCHEInStrongLong = isCHEInStrongLong;
|
||||
conditions.isCHESwitchedInStrongLong =
|
||||
//
|
||||
isCHEInStrongLong &&
|
||||
!isCHEInStrongLongPrev
|
||||
//
|
||||
;
|
||||
conditions.isCHEInShort = isCHEInShort;
|
||||
conditions.isCHEInStrongShort = isCHEInStrongShort;
|
||||
conditions.isCHESwitchedInStrongShort =
|
||||
//
|
||||
isCHEInStrongShort &&
|
||||
!isCHEInStrongShortPrev
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// XMC ...
|
||||
@@ -2247,6 +2369,54 @@ public:
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isFastCrossedOverSlow =
|
||||
//
|
||||
conditions.mcFasts[curr] > conditions.mcSlows[curr] &&
|
||||
conditions.mcFasts[prev] <= conditions.mcSlows[prev]
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isFastCrossedUnderSlow =
|
||||
//
|
||||
conditions.mcFasts[curr] < conditions.mcSlows[curr] &&
|
||||
conditions.mcFasts[prev] >= conditions.mcSlows[prev]
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isFastCrossedOverVerifier =
|
||||
//
|
||||
conditions.mcFasts[curr] > conditions.mcVerifiers[curr] &&
|
||||
conditions.mcFasts[prev] <= conditions.mcVerifiers[prev]
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isFastCrossedUnderVerifier =
|
||||
//
|
||||
conditions.mcFasts[curr] < conditions.mcVerifiers[curr] &&
|
||||
conditions.mcFasts[prev] >= conditions.mcVerifiers[prev]
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isSlowCrossedOverVerifier =
|
||||
//
|
||||
conditions.mcSlows[curr] > conditions.mcVerifiers[curr] &&
|
||||
conditions.mcSlows[prev] <= conditions.mcVerifiers[prev]
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isSlowCrossedUnderVerifier =
|
||||
//
|
||||
conditions.mcSlows[curr] < conditions.mcVerifiers[curr] &&
|
||||
conditions.mcSlows[prev] >= conditions.mcVerifiers[prev]
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
conditions.isFastOverSlow = isFastOverSlow;
|
||||
conditions.isFastUnderSlow = isFastUnderSlow;
|
||||
@@ -2260,6 +2430,12 @@ public:
|
||||
conditions.isCloseUnderSlow = isCloseUnderSlow;
|
||||
conditions.isCloseOverVerifier = isCloseOverVerifier;
|
||||
conditions.isCloseUnderVerifier = isCloseUnderVerifier;
|
||||
conditions.isFastCrossedOverSlow = isFastCrossedOverSlow;
|
||||
conditions.isFastCrossedUnderSlow = isFastCrossedUnderSlow;
|
||||
conditions.isFastCrossedOverVerifier = isFastCrossedOverVerifier;
|
||||
conditions.isFastCrossedUnderVerifier = isFastCrossedUnderVerifier;
|
||||
conditions.isSlowCrossedOverVerifier = isSlowCrossedOverVerifier;
|
||||
conditions.isSlowCrossedUnderVerifier = isSlowCrossedUnderVerifier;
|
||||
|
||||
//
|
||||
// XICH ...
|
||||
|
||||
@@ -676,6 +676,18 @@ protected:
|
||||
//
|
||||
// Props ...
|
||||
|
||||
//
|
||||
// Trade Class Instance ...
|
||||
XSCTrade *mTrader;
|
||||
XSCAlert *mAlert;
|
||||
|
||||
//
|
||||
// Check in Test Mode or not ...
|
||||
bool mIsInTestMode;
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
|
||||
//
|
||||
// Signal Event Listeners ...
|
||||
void NotifyOnSignalEventHandlers(XSignal &signals[])
|
||||
@@ -1244,15 +1256,6 @@ private:
|
||||
//
|
||||
// Props ...
|
||||
|
||||
//
|
||||
// Trade Class Instance ...
|
||||
XSCTrade *mTrader;
|
||||
XSCAlert *mAlert;
|
||||
|
||||
//
|
||||
// Check in Test Mode or not ...
|
||||
bool mIsInTestMode;
|
||||
|
||||
//
|
||||
// Signal Event Listeners ...
|
||||
TOnSignal mOnSignalEventHandlers[];
|
||||
|
||||
@@ -578,10 +578,6 @@ public:
|
||||
//
|
||||
// Init On Trade Context ...
|
||||
InitOnTradeContext();
|
||||
|
||||
//
|
||||
// Sync Position Infos ...
|
||||
SyncPositionInfos();
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1116,6 +1112,11 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Prepare Signal Comment ...
|
||||
string mSComment = mSignal.GenerateComment();
|
||||
mSignal.comment += mSComment;
|
||||
|
||||
//
|
||||
// Handle Market Execution ...
|
||||
if (mSignal.mode == X_ORDER_MODE_MARKET)
|
||||
@@ -1739,7 +1740,7 @@ public:
|
||||
|
||||
//
|
||||
// Check Position Open ...
|
||||
result = !IsOpen(ticket);
|
||||
result = IsOpen(ticket);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
@@ -3240,63 +3241,6 @@ private:
|
||||
//
|
||||
// Position Info Collector ...
|
||||
|
||||
//
|
||||
XSCPositionInfoCollector mPositionInfoCollector; // Position Info Data Collector ...
|
||||
|
||||
//
|
||||
void SyncPositionInfos()
|
||||
{
|
||||
//
|
||||
// TODO: Complete this ...
|
||||
|
||||
//
|
||||
// Read All Stored Positions ...
|
||||
// XPositionInfo infos[];
|
||||
// int infosCount = mPositionInfoCollector.Collect(infos);
|
||||
|
||||
// //
|
||||
// // Clear Store ...
|
||||
// mPositionInfoCollector.Clear();
|
||||
|
||||
// //
|
||||
// XPosition positions[];
|
||||
// int positionsCount = GetPositions(positions);
|
||||
// if (positionsCount <= 0)
|
||||
// {
|
||||
// Clean(infos);
|
||||
// }
|
||||
|
||||
// //
|
||||
// // Now we Have to Find each Position Info inside Positions and Update them ...
|
||||
// XPositionInfo datas[];
|
||||
// for (int i = 0; i < infosCount; i++)
|
||||
// {
|
||||
// //
|
||||
// XPositionInfo iInfo = infos[i];
|
||||
|
||||
// //
|
||||
// // Check Positions Contains Specific ticket or not ...
|
||||
// for (int j = 0; j < positionsCount; j++)
|
||||
// {
|
||||
// //
|
||||
// XPosition jPosition = positions[j];
|
||||
|
||||
// //
|
||||
// if (jPosition.ticket != iInfo.ticket)
|
||||
// {
|
||||
// //
|
||||
// // this is a Position which is not listed in Collector ...
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //
|
||||
// // Now we have a Position which Listed Before in Collector ...
|
||||
// // we Have to Update it ...
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user