last works ...
This commit is contained in:
@@ -1341,6 +1341,22 @@ struct X121ProviderDescriptor
|
|||||||
barIndex //
|
barIndex //
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Retrieve All Scores ...
|
||||||
|
double bullishScore = 0;
|
||||||
|
double bearishScore = 0;
|
||||||
|
this.conditions.GenerateScore(
|
||||||
|
bullishScore,
|
||||||
|
bearishScore //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Generate Conditions Summary and Comment it on Chart ...
|
||||||
|
string conditionsStr = this.conditions.GenerateSummary(
|
||||||
|
true // OnlySummary
|
||||||
|
);
|
||||||
|
Comment("\n", conditionsStr);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Verifiers ...
|
// Verifiers ...
|
||||||
int longVerifiers = 0;
|
int longVerifiers = 0;
|
||||||
@@ -1701,11 +1717,20 @@ struct X121ProviderDescriptor
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isScorePassed = hasLong
|
||||||
|
? bullishScore > bearishScore * 2
|
||||||
|
: bearishScore > bullishScore * 2;
|
||||||
|
|
||||||
//
|
//
|
||||||
result =
|
result =
|
||||||
hasLong
|
//
|
||||||
? longVerifiers > 1
|
isScorePassed &&
|
||||||
: shortVerifiers > 1;
|
(hasLong
|
||||||
|
? longVerifiers > 1
|
||||||
|
: shortVerifiers > 1)
|
||||||
|
//
|
||||||
|
;
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
@@ -1739,7 +1764,8 @@ struct X121ProviderDescriptor
|
|||||||
slPrice,
|
slPrice,
|
||||||
tpPrice //
|
tpPrice //
|
||||||
);
|
);
|
||||||
if (mSL == 0 && mTP == 0) {
|
if (mSL == 0 && mTP == 0)
|
||||||
|
{
|
||||||
Print("Zero TP/SL ...");
|
Print("Zero TP/SL ...");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1770,13 +1796,44 @@ struct X121ProviderDescriptor
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Check for Guards ...
|
// Check for Guards ...
|
||||||
bool HasGuard(XGuard &guards[])
|
int HasGuard(XGuard &guards[])
|
||||||
{
|
{
|
||||||
|
//
|
||||||
|
int result = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
Clean(guards);
|
Clean(guards);
|
||||||
|
|
||||||
//
|
//
|
||||||
bool result = IsValidSize(guards);
|
int signallersCount = CountSignallers();
|
||||||
|
if (!IsValidSize(signallersCount))
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Loop through Signallers ...
|
||||||
|
for (int i = 0; i < signallersCount; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XGuard iGuards[];
|
||||||
|
int iGuardsCount = this.signallers[i]
|
||||||
|
.HasGuard(iGuards);
|
||||||
|
if (!IsValidSize(iGuardsCount))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Copy(
|
||||||
|
iGuards,
|
||||||
|
guards,
|
||||||
|
false //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
result = ArraySize(guards);
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
// Loop Through Descriptors for Collecting Guards ...
|
||||||
for (int i = 0; i < descriptorsCount; i++)
|
for (int i = 0; i < descriptorsCount; i++)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -180,16 +181,18 @@ public:
|
|||||||
|
|
||||||
//
|
//
|
||||||
XGuard iGuards[];
|
XGuard iGuards[];
|
||||||
bool iHasGuard = iDescriptor.HasGuard(iGuards);
|
int iGuardsCount = iDescriptor.HasGuard(iGuards);
|
||||||
if (iHasGuard)
|
if (!IsValidSize(iGuardsCount))
|
||||||
{
|
{
|
||||||
//
|
continue;
|
||||||
Copy(
|
|
||||||
iGuards,
|
|
||||||
guards,
|
|
||||||
false //
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Copy(
|
||||||
|
iGuards,
|
||||||
|
guards,
|
||||||
|
false //
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -558,7 +561,7 @@ public:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Check Signaller Enable Hedge or not and Handle it if enabled ...
|
// Check Signaller Enable Hedge or not and Handle it if enabled ...
|
||||||
if (mDescriptors[i].signallers[j].AllowHedge())
|
if (positionsCount > 1 && mDescriptors[i].signallers[j].AllowHedge())
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Check Profits Enough for Hedge or not ...
|
// Check Profits Enough for Hedge or not ...
|
||||||
|
|||||||
@@ -2864,6 +2864,13 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check For Guards ...
|
||||||
|
virtual int HasGuard(XGuard &guards[])
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Protected ...
|
// Protected ...
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -248,6 +248,9 @@ bool InitialEA()
|
|||||||
x110Signaller.Default();
|
x110Signaller.Default();
|
||||||
x110Signaller.allowLong = x121EAAllowLong;
|
x110Signaller.allowLong = x121EAAllowLong;
|
||||||
x110Signaller.allowShort = x121EAAllowShort;
|
x110Signaller.allowShort = x121EAAllowShort;
|
||||||
|
x110Signaller.minRequiredProfitPerTrade = 1.5;
|
||||||
|
x110Signaller.openNextPositionOnProfit = false;
|
||||||
|
x110Signaller.delayBetweenTwoSameTypeSignals = 6;
|
||||||
|
|
||||||
//
|
//
|
||||||
iDescriptor.signallers[0] = x786Signaller;
|
iDescriptor.signallers[0] = x786Signaller;
|
||||||
@@ -1014,9 +1017,9 @@ void ApplyPreDefineConfigurations(X121ProviderDescriptor &iDescriptor)
|
|||||||
iDescriptor.inputs.mcInputs.showVerifierMa = isX110;
|
iDescriptor.inputs.mcInputs.showVerifierMa = isX110;
|
||||||
|
|
||||||
//
|
//
|
||||||
iDescriptor.inputs.ichInputs.showKumo = isX110;
|
iDescriptor.inputs.ichInputs.showKumo = true; // isX110;
|
||||||
iDescriptor.inputs.ichInputs.showKijunSen = isX110;
|
iDescriptor.inputs.ichInputs.showKijunSen = true; // isX110;
|
||||||
iDescriptor.inputs.ichInputs.showTenkanSen = isX110;
|
iDescriptor.inputs.ichInputs.showTenkanSen = true; // isX110;
|
||||||
iDescriptor.inputs.ichInputs.showSenkouSpanA = isX110;
|
iDescriptor.inputs.ichInputs.showSenkouSpanA = isX110;
|
||||||
iDescriptor.inputs.ichInputs.showSenkouSpanB = isX110;
|
iDescriptor.inputs.ichInputs.showSenkouSpanB = isX110;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user