prepare x5121 ...
This commit is contained in:
@@ -46,8 +46,8 @@
|
||||
enum ENUM_X121_SIGNAL_PROVIDERS
|
||||
{
|
||||
//
|
||||
NONE,
|
||||
XSP,
|
||||
X121NONE,
|
||||
X121XSP,
|
||||
XTEST,
|
||||
X786,
|
||||
X121,
|
||||
@@ -518,11 +518,6 @@ class X121MarketConditions : public XSCBaseProviderMarketConditions
|
||||
//
|
||||
// Public ...
|
||||
public:
|
||||
//
|
||||
string symbol; // Symbol
|
||||
ENUM_TIMEFRAMES period; // Period
|
||||
datetime time; // Time
|
||||
|
||||
//
|
||||
// XZG ...
|
||||
double zigzags[];
|
||||
@@ -1430,7 +1425,7 @@ public:
|
||||
)
|
||||
{
|
||||
//
|
||||
if (provider == NONE)
|
||||
if (provider == X121NONE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1439,8 +1434,8 @@ public:
|
||||
switch (provider)
|
||||
{
|
||||
//
|
||||
case XSP:
|
||||
mIsXSPSignalProviderEnable = state;
|
||||
case X121XSP:
|
||||
mIsX121XSPSignalProviderEnable = state;
|
||||
break;
|
||||
|
||||
//
|
||||
@@ -1743,7 +1738,7 @@ private:
|
||||
bool mIsShortEnable;
|
||||
|
||||
//
|
||||
bool mIsXSPSignalProviderEnable;
|
||||
bool mIsX121XSPSignalProviderEnable;
|
||||
bool mIsX92SignalProviderEnable;
|
||||
bool mIsX786SignalProviderEnable;
|
||||
bool mIsX121SignalProviderEnable;
|
||||
@@ -1789,7 +1784,7 @@ private:
|
||||
signalPusher = 0;
|
||||
|
||||
//
|
||||
bool hasXSPSignal = false;
|
||||
bool hasX121XSPSignal = false;
|
||||
bool hasXTESTSignal = false;
|
||||
bool hasX786Signal = false;
|
||||
bool hasX121Signal = false;
|
||||
@@ -1798,20 +1793,20 @@ private:
|
||||
|
||||
//
|
||||
// XPS ...
|
||||
if (mIsXSPSignalProviderEnable)
|
||||
if (mIsX121XSPSignalProviderEnable)
|
||||
{
|
||||
//
|
||||
hasXSPSignal = XSPHasSpecifiedLongSignal(
|
||||
hasX121XSPSignal = X121XSPHasSpecifiedLongSignal(
|
||||
mConditions //
|
||||
);
|
||||
|
||||
//
|
||||
if (hasXSPSignal)
|
||||
if (hasX121XSPSignal)
|
||||
{
|
||||
//
|
||||
if (!IsValid(provider))
|
||||
{
|
||||
provider = ToString(XSP);
|
||||
provider = ToString(X121XSP);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1937,7 +1932,7 @@ private:
|
||||
//
|
||||
result =
|
||||
//
|
||||
hasXSPSignal
|
||||
hasX121XSPSignal
|
||||
//
|
||||
||
|
||||
//
|
||||
@@ -1979,7 +1974,7 @@ private:
|
||||
signalPusher = 0;
|
||||
|
||||
//
|
||||
bool hasXSPSignal = false;
|
||||
bool hasX121XSPSignal = false;
|
||||
bool hasXTESTSignal = false;
|
||||
bool hasX786Signal = false;
|
||||
bool hasX121Signal = false;
|
||||
@@ -1987,21 +1982,21 @@ private:
|
||||
bool hasX92Signal = false;
|
||||
|
||||
//
|
||||
// XSP ...
|
||||
if (mIsXSPSignalProviderEnable)
|
||||
// X121XSP ...
|
||||
if (mIsX121XSPSignalProviderEnable)
|
||||
{
|
||||
//
|
||||
hasXSPSignal = XSPHasSpecifiedShortSignal(
|
||||
hasX121XSPSignal = X121XSPHasSpecifiedShortSignal(
|
||||
mConditions //
|
||||
);
|
||||
|
||||
//
|
||||
if (hasXSPSignal)
|
||||
if (hasX121XSPSignal)
|
||||
{
|
||||
//
|
||||
if (!IsValid(provider))
|
||||
{
|
||||
provider = ToString(XSP);
|
||||
provider = ToString(X121XSP);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -2127,7 +2122,7 @@ private:
|
||||
//
|
||||
result =
|
||||
//
|
||||
hasXSPSignal
|
||||
hasX121XSPSignal
|
||||
//
|
||||
||
|
||||
//
|
||||
@@ -2896,10 +2891,10 @@ private:
|
||||
// Signalling based On Signallers ...
|
||||
|
||||
//
|
||||
// XSP ...
|
||||
// X121XSP ...
|
||||
|
||||
//
|
||||
bool XSPHasSpecifiedLongSignal(
|
||||
bool X121XSPHasSpecifiedLongSignal(
|
||||
X121MarketConditions &mConditions //
|
||||
)
|
||||
{
|
||||
@@ -2930,38 +2925,6 @@ private:
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
double bullishScore = 0;
|
||||
double bearishScore = 0;
|
||||
|
||||
//
|
||||
mConditions.GenerateScore(
|
||||
bullishScore,
|
||||
bearishScore //
|
||||
);
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
mConditions.bars[1].low == mConditions.bars[2].low &&
|
||||
mConditions.bars[1].low == mConditions.pvVales[1] &&
|
||||
mConditions.bars[2].low == mConditions.pvVales[2]
|
||||
//
|
||||
;
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
Print("bullishScore: " + ToString(bullishScore));
|
||||
Print("bearishScore: " + ToString(bearishScore));
|
||||
|
||||
//
|
||||
Print(mConditions.GenerateSummary());
|
||||
|
||||
//
|
||||
Print(mConditions.pvVales[0]);
|
||||
ArrayPrint(mConditions.pvVales);
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
@@ -3003,7 +2966,7 @@ private:
|
||||
}
|
||||
|
||||
//
|
||||
bool XSPHasSpecifiedShortSignal(
|
||||
bool X121XSPHasSpecifiedShortSignal(
|
||||
X121MarketConditions &mConditions //
|
||||
)
|
||||
{
|
||||
@@ -3034,56 +2997,6 @@ private:
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
// //
|
||||
// double bullishScore = 0;
|
||||
// double bearishScore = 0;
|
||||
|
||||
// //
|
||||
// mConditions.GenerateScore(
|
||||
// bullishScore,
|
||||
// bearishScore //
|
||||
// );
|
||||
|
||||
//
|
||||
// result =
|
||||
// //
|
||||
// bullishScore < bearishScore &&
|
||||
// mConditions.zigzags[prev] == mConditions.pvPeaks[prev]
|
||||
// //
|
||||
// ;
|
||||
|
||||
// //
|
||||
// for (int i = 1; i < 6; i++)
|
||||
// {
|
||||
// //
|
||||
// X121MarketConditions iConditions;
|
||||
// GetMarketConditions(iConditions, i);
|
||||
|
||||
// //
|
||||
// double iBullishScore = 0;
|
||||
// double iBearishScore = 0;
|
||||
|
||||
// //
|
||||
// iConditions.GenerateScore(
|
||||
// iBullishScore,
|
||||
// iBearishScore,
|
||||
// 1);
|
||||
|
||||
// //
|
||||
// bullishScore += iBullishScore;
|
||||
// bearishScore += iBearishScore;
|
||||
// }
|
||||
|
||||
// //
|
||||
// result =
|
||||
// //
|
||||
// bearishScore > bullishScore &&
|
||||
// (bullishScore < 0
|
||||
// ? bearishScore > MathAbs(bullishScore)
|
||||
// : bearishScore > bullishScore * 2)
|
||||
// //
|
||||
// ;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
@@ -3350,8 +3263,8 @@ void GetAllX121SignalProviders(ENUM_X121_SIGNAL_PROVIDERS &result[])
|
||||
Clean(result);
|
||||
|
||||
//
|
||||
Add(NONE, result);
|
||||
Add(XSP, result);
|
||||
Add(X121NONE, result);
|
||||
Add(X121XSP, result);
|
||||
Add(XTEST, result);
|
||||
Add(X786, result);
|
||||
Add(X121, result);
|
||||
@@ -3369,7 +3282,7 @@ string ToString(ENUM_X121_SIGNAL_PROVIDERS value)
|
||||
ENUM_X121_SIGNAL_PROVIDERS ToX121SignalProvider(string content)
|
||||
{
|
||||
//
|
||||
ENUM_X121_SIGNAL_PROVIDERS result = NONE;
|
||||
ENUM_X121_SIGNAL_PROVIDERS result = X121NONE;
|
||||
|
||||
//
|
||||
if (!IsValid(content))
|
||||
@@ -3378,13 +3291,13 @@ ENUM_X121_SIGNAL_PROVIDERS ToX121SignalProvider(string content)
|
||||
}
|
||||
|
||||
//
|
||||
if (content == ToString(NONE))
|
||||
if (content == ToString(X121NONE))
|
||||
{
|
||||
result = NONE;
|
||||
result = X121NONE;
|
||||
}
|
||||
else if (content == ToString(XSP))
|
||||
else if (content == ToString(X121XSP))
|
||||
{
|
||||
result = XSP;
|
||||
result = X121XSP;
|
||||
}
|
||||
else if (content == ToString(XTEST))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user