last works ...
This commit is contained in:
+18
-18
@@ -238,9 +238,9 @@ bool InitialEA()
|
||||
|
||||
//
|
||||
// XMC ...
|
||||
iDescriptor.inputs.mcInputs.showFastMa = false;
|
||||
iDescriptor.inputs.mcInputs.showSlowMa = false;
|
||||
iDescriptor.inputs.mcInputs.showVerifierMa = false;
|
||||
iDescriptor.inputs.mcInputs.showFastMa = true;
|
||||
iDescriptor.inputs.mcInputs.showSlowMa = true;
|
||||
iDescriptor.inputs.mcInputs.showVerifierMa = true;
|
||||
|
||||
//
|
||||
// XICH ...
|
||||
@@ -254,11 +254,11 @@ bool InitialEA()
|
||||
iDescriptor.inputs.ichInputs.showKijunSenNegative = false;
|
||||
|
||||
//
|
||||
// XSTR ...
|
||||
iDescriptor.inputs.cheInputs.showLongExit1Line = false;
|
||||
iDescriptor.inputs.cheInputs.showShortExit1Line = false;
|
||||
iDescriptor.inputs.cheInputs.showLongExit2Line = false;
|
||||
iDescriptor.inputs.cheInputs.showShortExit2Line = false;
|
||||
// XCHE ...
|
||||
iDescriptor.inputs.cheInputs.showLongExit1Line = true;
|
||||
iDescriptor.inputs.cheInputs.showShortExit1Line = true;
|
||||
iDescriptor.inputs.cheInputs.showLongExit2Line = true;
|
||||
iDescriptor.inputs.cheInputs.showShortExit2Line = true;
|
||||
|
||||
//
|
||||
// XPV ...
|
||||
@@ -274,14 +274,14 @@ bool InitialEA()
|
||||
//
|
||||
// XZG ...
|
||||
iDescriptor.inputs.zgInputs.showZigZag = false;
|
||||
iDescriptor.inputs.zgInputs.showPeaksAndVales = false;
|
||||
iDescriptor.inputs.zgInputs.showPeaksAndVales = true;
|
||||
|
||||
//
|
||||
// XDON ...
|
||||
iDescriptor.inputs.donInputs.showOpen = true;
|
||||
iDescriptor.inputs.donInputs.showHigh = true;
|
||||
iDescriptor.inputs.donInputs.showClose = true;
|
||||
iDescriptor.inputs.donInputs.showLow = true;
|
||||
iDescriptor.inputs.donInputs.showOpen = false;
|
||||
iDescriptor.inputs.donInputs.showHigh = false;
|
||||
iDescriptor.inputs.donInputs.showClose = false;
|
||||
iDescriptor.inputs.donInputs.showLow = false;
|
||||
|
||||
//
|
||||
// XSTR ...
|
||||
@@ -313,15 +313,15 @@ bool InitialEA()
|
||||
string fontName = "Arial";
|
||||
ENUM_ANCHOR_POINT fontAnchor = ANCHOR_LEFT_UPPER;
|
||||
|
||||
//
|
||||
//false
|
||||
// Hind Market ...
|
||||
iDescriptor.inputs.hMarketPeriod = NULL;
|
||||
iDescriptor.inputs.hMarketMethod = X_PERIOD_AUTO;
|
||||
iDescriptor.inputs.hMarketInputs.drawLabels = false;
|
||||
iDescriptor.inputs.hMarketInputs.drawCBar = true;
|
||||
iDescriptor.inputs.hMarketInputs.drawPBar = true;
|
||||
iDescriptor.inputs.hMarketInputs.drawCBarMid = true;
|
||||
iDescriptor.inputs.hMarketInputs.drawPBarMid = true;
|
||||
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();
|
||||
|
||||
|
||||
+225
-9
@@ -202,7 +202,7 @@ struct X5121ProviderDescriptor
|
||||
result = x5Provider.Init(
|
||||
this.x5Inputs //
|
||||
);
|
||||
if (result)
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
@@ -297,6 +297,125 @@ struct X5121ProviderDescriptor
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
void GenerateScore(
|
||||
double &bullishScore,
|
||||
double &bearishScore //
|
||||
)
|
||||
{
|
||||
//
|
||||
double x5BullishScore = 5;
|
||||
double x5BearishScore = 5;
|
||||
|
||||
//
|
||||
GenerateX5Score(
|
||||
x5BullishScore,
|
||||
x5BearishScore //
|
||||
);
|
||||
|
||||
//
|
||||
double x121BullishScore = 5;
|
||||
double x121BearishScore = 5;
|
||||
|
||||
//
|
||||
GenerateX121Score(
|
||||
x121BullishScore,
|
||||
x121BearishScore //
|
||||
);
|
||||
|
||||
//
|
||||
bullishScore = x5BullishScore + x121BullishScore;
|
||||
bearishScore = x5BearishScore + x121BearishScore;
|
||||
}
|
||||
|
||||
//
|
||||
void GenerateX5Score(
|
||||
double &bullishScore,
|
||||
double &bearishScore //
|
||||
)
|
||||
{
|
||||
//
|
||||
x5Conditions.GenerateScore(
|
||||
bullishScore,
|
||||
bearishScore //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
void GenerateX121Score(
|
||||
double &bullishScore,
|
||||
double &bearishScore //
|
||||
)
|
||||
{
|
||||
//
|
||||
x121Conditions.GenerateScore(
|
||||
bullishScore,
|
||||
bearishScore //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
string GenerateSummary(
|
||||
const bool onlySummary = false,
|
||||
bool ignoreFalseConditions = true //
|
||||
)
|
||||
{
|
||||
//
|
||||
string x5Str = GenerateX5Summary(
|
||||
onlySummary,
|
||||
ignoreFalseConditions //
|
||||
);
|
||||
|
||||
//
|
||||
string x121Str = GenerateX121Summary(
|
||||
onlySummary,
|
||||
ignoreFalseConditions //
|
||||
);
|
||||
|
||||
//
|
||||
string result =
|
||||
//
|
||||
x5Str + "\n" + x121Str
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
string GenerateX5Summary(
|
||||
const bool onlySummary = false,
|
||||
bool ignoreFalseConditions = true //
|
||||
)
|
||||
{
|
||||
return x5Conditions.GenerateSummary(
|
||||
onlySummary,
|
||||
1,
|
||||
"\n",
|
||||
ignoreFalseConditions //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
string GenerateX121Summary(
|
||||
const bool onlySummary = false,
|
||||
bool ignoreFalseConditions = true //
|
||||
)
|
||||
{
|
||||
return x121Conditions.GenerateSummary(
|
||||
onlySummary,
|
||||
1,
|
||||
1.1,
|
||||
1.2,
|
||||
1.6,
|
||||
1.8,
|
||||
"\n",
|
||||
NULL,
|
||||
ignoreFalseConditions //
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
@@ -376,7 +495,7 @@ int OnInit()
|
||||
}
|
||||
|
||||
//
|
||||
TesterHideIndicators(true);
|
||||
// TesterHideIndicators(true);
|
||||
|
||||
//
|
||||
// Init Succeed ...
|
||||
@@ -830,15 +949,112 @@ int RequestForSignal(
|
||||
X5121ProviderDescriptor iDescriptor = x5121EAProviders[i];
|
||||
|
||||
//
|
||||
bool iHasSignal = iDescriptor.HasSignal(0);
|
||||
if (iHasSignal)
|
||||
{
|
||||
iDescriptor.x5Provider.GetMarketConditions(
|
||||
iDescriptor.x5Conditions //
|
||||
);
|
||||
|
||||
//
|
||||
iDescriptor.x121Provider.GetMarketConditions(
|
||||
iDescriptor.x121Conditions //
|
||||
);
|
||||
|
||||
//
|
||||
X5MarketConditions x5Conditions = iDescriptor.x5Conditions;
|
||||
X121MarketConditions x121Conditions = iDescriptor.x121Conditions;
|
||||
|
||||
//
|
||||
// Check For Long ...
|
||||
bool hasLong =
|
||||
//
|
||||
AddRef(
|
||||
iDescriptor.signal,
|
||||
signals //
|
||||
);
|
||||
(x121Conditions.hMarketConditions.isTrendSwitchedToBullish &&
|
||||
(x121Conditions.lMarketConditions.isTrendBullish &&
|
||||
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 &&
|
||||
x121Conditions.mMarketConditions.isTrendBullish &&
|
||||
x121Conditions.sMarketConditions.isTrendBullish))
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// Check For Short ...
|
||||
bool hasShort =
|
||||
//
|
||||
false
|
||||
//
|
||||
;
|
||||
|
||||
if (hasLong)
|
||||
{
|
||||
Print("");
|
||||
}
|
||||
|
||||
//
|
||||
// bool iHasSignal = iDescriptor.HasSignal(0);
|
||||
// if (iHasSignal)
|
||||
// {
|
||||
// //
|
||||
// AddRef(
|
||||
// iDescriptor.signal,
|
||||
// signals //
|
||||
// );
|
||||
|
||||
// // //
|
||||
// // string conditionsStr = iDescriptor.GenerateSummary();
|
||||
// // Print(conditionsStr);
|
||||
|
||||
// //
|
||||
// double bullScore = 0;
|
||||
// double bearScore = 0;
|
||||
// iDescriptor.GenerateScore(
|
||||
// bullScore,
|
||||
// bearScore //
|
||||
// );
|
||||
|
||||
// //
|
||||
// Print(" ");
|
||||
// Print((IsLong(iDescriptor.signal.type) ? "Long" : "Short"));
|
||||
// Print(iDescriptor.signal.symbol, ",", ToString(iDescriptor.signal.period), ",", iDescriptor.signal.provider);
|
||||
// Print("========================");
|
||||
// Print("bullScore: ", bullScore);
|
||||
// Print("bearScore: ", bearScore);
|
||||
|
||||
// //
|
||||
// Print("");
|
||||
|
||||
// //
|
||||
// Print(iDescriptor.GenerateX121Summary());
|
||||
// }
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user