last works ...

This commit is contained in:
2024-05-31 22:16:15 +03:30
parent 1b1ee01528
commit 4e4be34f1a
3 changed files with 251 additions and 99 deletions
+171 -96
View File
@@ -3696,91 +3696,11 @@ private:
bool hHasX786 = hMarket.HasX786LongConditions(); bool hHasX786 = hMarket.HasX786LongConditions();
// //
if (cHasX786) double cMarketSL = cMarket.don.GetLowerH(cIndex);
{ double sMarketSL = sMarket.don.GetLowerH(cIndex);
sl = cMarket.don.GetLowerH(cIndex); double mMarketSL = mMarket.don.GetLowerH(cIndex);
} double lMarketSL = lMarket.don.GetLowerH(cIndex);
else if (sHasX786) double hMarketSL = hMarket.don.GetLowerH(cIndex);
{
sl = sMarket.don.GetLowerH(cIndex);
}
else if (mHasX786)
{
sl = mMarket.don.GetLowerH(cIndex);
}
else if (lHasX786)
{
sl = lMarket.don.GetLowerH(cIndex);
}
else if (hHasX786)
{
sl = hMarket.don.GetLowerH(cIndex);
}
//
result =
//
cHasX786
//
&&
//
sHasX786
//
&&
//
mHasX786
//
&&
//
lHasX786
//
// &&
// //
// hHasX786
//
;
//
if (result)
{
//
r2r = 1;
sl = cMarket.don.GetLowerH(cIndex);
}
//
return result;
}
//
bool X786HasSpecifiedShortSignal(
X121MarketConditions &mConditions, //
double &sl, // Provided SL ...
double &tp, // Provided TP ...
double &r2r // Risk Reward Ratio ...
)
{
//
bool result = false;
//
int zIndex = 0;
int cIndex = zIndex + 1;
int pIndex = cIndex + 1;
//
bool cHasX786 = cMarket.HasX786ShortConditions();
bool sHasX786 = sMarket.HasX786ShortConditions();
bool mHasX786 = mMarket.HasX786ShortConditions();
bool lHasX786 = lMarket.HasX786ShortConditions();
bool hHasX786 = hMarket.HasX786ShortConditions();
//
double cMarketSLe = cMarket.don.GetUpperL(cIndex);
double sMarketSLe = sMarket.don.GetUpperL(cIndex);
double mMarketSLe = mMarket.don.GetUpperL(cIndex);
double lMarketSLe = lMarket.don.GetUpperL(cIndex);
double hMarketSLe = hMarket.don.GetUpperL(cIndex);
// //
bool condition1 = bool condition1 =
@@ -3834,9 +3754,9 @@ private:
{ {
// //
double sls[] = { double sls[] = {
cMarketSLe, cMarketSL,
sMarketSLe, sMarketSL,
mMarketSLe // mMarketSL //
}; };
// //
@@ -3846,9 +3766,9 @@ private:
{ {
// //
double sls[] = { double sls[] = {
sMarketSLe, sMarketSL,
mMarketSLe, mMarketSL,
lMarketSLe // lMarketSL //
}; };
// //
@@ -3858,9 +3778,9 @@ private:
{ {
// //
double sls[] = { double sls[] = {
mMarketSLe, mMarketSL,
lMarketSLe, lMarketSL,
hMarketSLe // hMarketSL //
}; };
// //
@@ -3870,8 +3790,163 @@ private:
{ {
// //
double sls[] = { double sls[] = {
lMarketSLe, lMarketSL,
hMarketSLe // hMarketSL //
};
//
sl = GetAverage(sls);
}
//
result =
//
condition1
//
||
//
condition2
//
||
//
condition3
//
||
//
condition4
//
;
//
if (result)
{
r2r = 1;
}
//
return result;
}
//
bool X786HasSpecifiedShortSignal(
X121MarketConditions &mConditions, //
double &sl, // Provided SL ...
double &tp, // Provided TP ...
double &r2r // Risk Reward Ratio ...
)
{
//
bool result = false;
//
int zIndex = 0;
int cIndex = zIndex + 1;
int pIndex = cIndex + 1;
//
bool cHasX786 = cMarket.HasX786ShortConditions();
bool sHasX786 = sMarket.HasX786ShortConditions();
bool mHasX786 = mMarket.HasX786ShortConditions();
bool lHasX786 = lMarket.HasX786ShortConditions();
bool hHasX786 = hMarket.HasX786ShortConditions();
//
double cMarketSL = cMarket.don.GetUpperL(cIndex);
double sMarketSL = sMarket.don.GetUpperL(cIndex);
double mMarketSL = mMarket.don.GetUpperL(cIndex);
double lMarketSL = lMarket.don.GetUpperL(cIndex);
double hMarketSL = hMarket.don.GetUpperL(cIndex);
//
bool condition1 =
//
((cHasX786 &&
sHasX786)
//
||
//
(cHasX786 &&
mHasX786))
//
;
//
bool condition2 =
//
((sHasX786 &&
mHasX786)
//
||
//
(sHasX786 &&
lHasX786))
//
;
//
bool condition3 =
//
((mHasX786 &&
lHasX786)
//
||
//
(mHasX786 &&
hHasX786))
//
;
//
bool condition4 =
//
(lHasX786 &&
hHasX786)
//
;
//
if (condition1)
{
//
double sls[] = {
cMarketSL,
sMarketSL,
mMarketSL //
};
//
sl = GetAverage(sls);
}
else if (condition2)
{
//
double sls[] = {
sMarketSL,
mMarketSL,
lMarketSL //
};
//
sl = GetAverage(sls);
}
else if (condition3)
{
//
double sls[] = {
mMarketSL,
lMarketSL,
hMarketSL //
};
//
sl = GetAverage(sls);
}
else if (condition4)
{
//
double sls[] = {
lMarketSL,
hMarketSL //
}; };
// //
+78 -1
View File
@@ -828,6 +828,8 @@ public:
Clean(ichChikouSpans); Clean(ichChikouSpans);
Clean(ichSenkouSpanAs); Clean(ichSenkouSpanAs);
Clean(ichSenkouSpanBs); Clean(ichSenkouSpanBs);
Clean(ichFutureSenkouSpanAs);
Clean(ichFutureSenkouSpanBs);
Clean(mcFasts); Clean(mcFasts);
Clean(mcSlows); Clean(mcSlows);
Clean(mcVerifiers); Clean(mcVerifiers);
@@ -907,6 +909,8 @@ public:
ArraySetAsSeries(ichChikouSpans, true); ArraySetAsSeries(ichChikouSpans, true);
ArraySetAsSeries(ichSenkouSpanAs, true); ArraySetAsSeries(ichSenkouSpanAs, true);
ArraySetAsSeries(ichSenkouSpanBs, true); ArraySetAsSeries(ichSenkouSpanBs, true);
ArraySetAsSeries(ichFutureSenkouSpanAs, true);
ArraySetAsSeries(ichFutureSenkouSpanBs, true);
ArraySetAsSeries(mcFasts, true); ArraySetAsSeries(mcFasts, true);
ArraySetAsSeries(mcSlows, true); ArraySetAsSeries(mcSlows, true);
ArraySetAsSeries(mcVerifiers, true); ArraySetAsSeries(mcVerifiers, true);
@@ -972,6 +976,9 @@ public:
ArraySetAsSeries(pvLCLLs, true); ArraySetAsSeries(pvLCLLs, true);
ArraySetAsSeries(pvHCHHs, true); ArraySetAsSeries(pvHCHHs, true);
ArraySetAsSeries(pvHCLLs, true); ArraySetAsSeries(pvHCLLs, true);
ArraySetAsSeries(tdBullishs, true);
ArraySetAsSeries(tdBearishs, true);
ArraySetAsSeries(tdSignals, true);
// //
// XZG ... // XZG ...
@@ -3567,7 +3574,42 @@ public:
bool HasX786LongConditions() bool HasX786LongConditions()
{ {
// //
bool result; bool result = false;
//
X121MCycleConditions conditions;
GetMarketConditions(conditions);
//
result =
//
(conditions.isSMHKSwitchedToBullish &&
(conditions.isTDBullish &&
conditions.isCHEBullish &&
conditions.isTrendBullish))
//
||
//
(conditions.isTDSwitchedToBullish &&
(conditions.isSMHKBullish &&
conditions.isCHEBullish &&
conditions.isTrendBullish))
//
||
//
(conditions.isCHESwitchedToBullish &&
(conditions.isTDBullish &&
conditions.isSMHKBullish &&
conditions.isTrendBullish))
//
||
//
(conditions.isTrendSwitchedToBullish &&
(conditions.isTDBullish &&
conditions.isCHEBullish &&
conditions.isSMHKBullish))
//
;
// //
return result; return result;
@@ -3580,6 +3622,41 @@ public:
// //
bool result = false; bool result = false;
//
X121MCycleConditions conditions;
GetMarketConditions(conditions);
//
result =
//
(conditions.isSMHKSwitchedToBearish &&
(conditions.isTDBearish &&
conditions.isCHEBearish &&
conditions.isTrendBearish))
//
||
//
(conditions.isTDSwitchedToBearish &&
(conditions.isSMHKBearish &&
conditions.isCHEBearish &&
conditions.isTrendBearish))
//
||
//
(conditions.isCHESwitchedToBearish &&
(conditions.isTDBearish &&
conditions.isSMHKBearish &&
conditions.isTrendBearish))
//
||
//
(conditions.isTrendSwitchedToBearish &&
(conditions.isTDBearish &&
conditions.isCHEBearish &&
conditions.isSMHKBearish))
//
;
// //
return result; return result;
} }
+2 -2
View File
@@ -238,8 +238,8 @@ bool InitialEA()
iDescriptor.symbol = iSymbol; iDescriptor.symbol = iSymbol;
iDescriptor.period = iPeriod; iDescriptor.period = iPeriod;
iDescriptor.staticVolume = x121EAVolume; iDescriptor.staticVolume = x121EAVolume;
iDescriptor.allowLong = false; // x121EAAllowLong; iDescriptor.allowLong = x121EAAllowLong;
iDescriptor.allowShort = x121EAAllowShort; iDescriptor.allowShort = false; // x121EAAllowShort;
Copy( Copy(
signallers, signallers,
iDescriptor.signallers); iDescriptor.signallers);