last ...
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1851,6 +1851,222 @@ class XCX121Helper : public XCBaseHelper
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetHigherPeak(
|
||||||
|
double peak, // Peak Source
|
||||||
|
int barIndex = 0, // Bar Index
|
||||||
|
int loopback = 576 // Max Allowed Loopback
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
double result = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (loopback < 576)
|
||||||
|
{
|
||||||
|
loopback = 576;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (peak <= 0)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double iValue = 0;
|
||||||
|
int index = barIndex;
|
||||||
|
bool canContinue = true;
|
||||||
|
while (canContinue)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
iValue = GetPeak(index);
|
||||||
|
if (iValue > peak)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
result = iValue;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
canContinue = index < barIndex + loopback;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetLowerPeak(
|
||||||
|
double peak, // Peak Source
|
||||||
|
int barIndex = 0, // Bar Index
|
||||||
|
int loopback = 576 // Max Allowed Loopback
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
double result = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (loopback < 576)
|
||||||
|
{
|
||||||
|
loopback = 576;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (peak <= 0)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double iValue = 0;
|
||||||
|
int index = barIndex;
|
||||||
|
bool canContinue = true;
|
||||||
|
while (canContinue)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
iValue = GetPeak(index);
|
||||||
|
if (iValue < peak)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
result = iValue;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
canContinue = index < barIndex + loopback;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetHigherVale(
|
||||||
|
double vale, // Vale Source
|
||||||
|
int barIndex = 0, // Bar Index
|
||||||
|
int loopback = 576 // Max Allowed Loopback
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
double result = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (loopback < 576)
|
||||||
|
{
|
||||||
|
loopback = 576;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (vale <= 0)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double iValue = 0;
|
||||||
|
int index = barIndex;
|
||||||
|
bool canContinue = true;
|
||||||
|
while (canContinue)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
iValue = GetVale(index);
|
||||||
|
if (iValue > vale)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
result = iValue;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
canContinue = index > barIndex + loopback;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double GetLowerVale(
|
||||||
|
double vale, // Vale Source
|
||||||
|
int barIndex = 0, // Bar Index
|
||||||
|
int loopback = 576 // Max Allowed Loopback
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
double result = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (barIndex < 0)
|
||||||
|
{
|
||||||
|
barIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (loopback < 576)
|
||||||
|
{
|
||||||
|
loopback = 576;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (vale <= 0)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
double iValue = 0;
|
||||||
|
int index = barIndex;
|
||||||
|
bool canContinue = true;
|
||||||
|
while (canContinue)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
iValue = GetVale(index);
|
||||||
|
if (iValue < vale)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
result = iValue;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
canContinue = index > barIndex + loopback;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
//
|
//
|
||||||
double GetLowestPeak(
|
double GetLowestPeak(
|
||||||
int barIndex,
|
int barIndex,
|
||||||
@@ -1872,6 +2088,12 @@ class XCX121Helper : public XCBaseHelper
|
|||||||
barIndex = 0;
|
barIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (loopback < 576)
|
||||||
|
{
|
||||||
|
loopback = 576;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
Calculate();
|
Calculate();
|
||||||
|
|
||||||
@@ -1921,6 +2143,12 @@ class XCX121Helper : public XCBaseHelper
|
|||||||
barIndex = 0;
|
barIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (loopback < 576)
|
||||||
|
{
|
||||||
|
loopback = 576;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
Calculate();
|
Calculate();
|
||||||
|
|
||||||
@@ -1970,6 +2198,12 @@ class XCX121Helper : public XCBaseHelper
|
|||||||
barIndex = 0;
|
barIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (loopback < 576)
|
||||||
|
{
|
||||||
|
loopback = 576;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
Calculate();
|
Calculate();
|
||||||
|
|
||||||
@@ -2019,6 +2253,12 @@ class XCX121Helper : public XCBaseHelper
|
|||||||
barIndex = 0;
|
barIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (loopback < 576)
|
||||||
|
{
|
||||||
|
loopback = 576;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
Calculate();
|
Calculate();
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -27,6 +27,7 @@
|
|||||||
#include "../../Classes/x-saherelm.x-bar.analyser.class.mq5"
|
#include "../../Classes/x-saherelm.x-bar.analyser.class.mq5"
|
||||||
#include "../../Classes/x-saherelm.x-poi.drawer.class.mq5"
|
#include "../../Classes/x-saherelm.x-poi.drawer.class.mq5"
|
||||||
#include "../../Classes/x-saherelm.x-trade.class.mq5"
|
#include "../../Classes/x-saherelm.x-trade.class.mq5"
|
||||||
|
#include "../Libraries/x-121.smc.lib.mq5"
|
||||||
|
|
||||||
//
|
//
|
||||||
// Definitions ...
|
// Definitions ...
|
||||||
@@ -3196,6 +3197,120 @@ class XC121SMCTradeHandler : public XCBaseAlert
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute Specific Signal using Trade Handler ...
|
||||||
|
*
|
||||||
|
* @param signal: XSignal instance Reference ...
|
||||||
|
* @param state: ENUM_X_SIGNAL_EXECUTION_RESULT Reference for olding Signal Execution Result Reason ...
|
||||||
|
* @param ignorePolicies: Boolean ...
|
||||||
|
*
|
||||||
|
* @return ( bool )
|
||||||
|
*/
|
||||||
|
bool ExecuteSignal(
|
||||||
|
XSignal &signal, // Signal for Execution
|
||||||
|
X121SMCStrategyConditions &conditions, // Signal Conditions
|
||||||
|
ENUM_X_SIGNAL_EXECUTION_RESULT &state, // Execution State
|
||||||
|
bool ignorePolicies = false // Ignore Execution Policies
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check Signal Validation ...
|
||||||
|
result = signal.IsValid() &&
|
||||||
|
conditions.IsValid();
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check Policies ...
|
||||||
|
if (!ignorePolicies)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Filter Signals if Necessary ...
|
||||||
|
result = CanExecute(
|
||||||
|
signal,
|
||||||
|
state //
|
||||||
|
);
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
AlertSignalExecutionFailed(
|
||||||
|
signal,
|
||||||
|
state //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Apply Additional Volume to Signal if Provided ...
|
||||||
|
double additionalVolume = AdditionalVolume();
|
||||||
|
if (additionalVolume > 0)
|
||||||
|
{
|
||||||
|
signal.volume += mAdditionalVolume;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Execute Signal ...
|
||||||
|
result = mTrader.ExecuteSignal(
|
||||||
|
signal,
|
||||||
|
state //
|
||||||
|
);
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Add XTradeHandler Data ...
|
||||||
|
Add(signal);
|
||||||
|
if (CanDraw())
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCSignalObject *iObj;
|
||||||
|
mDrawer.DrawSignal(signal, iObj);
|
||||||
|
|
||||||
|
//
|
||||||
|
XCBaseObject *conditionsObjects[];
|
||||||
|
DrawX121SMCStrategyConditions(
|
||||||
|
conditions,
|
||||||
|
conditionsObjects,
|
||||||
|
mDrawer //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Handle Last Executed Signal ...
|
||||||
|
HandleSignalExecuted(signal);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Alert Executed Signal ...
|
||||||
|
string msg = (signal.type == POSITION_TYPE_BUY ? "Long" : "Short") +
|
||||||
|
" Signal Provided by: " + signal.provider +
|
||||||
|
(signal.pushers > 1 ? " Pushers: " + ToString(signal.pushers) : "") +
|
||||||
|
" on: " + signal.symbol +
|
||||||
|
" in: " + ToString(signal.period) +
|
||||||
|
" Executed Successfully ...";
|
||||||
|
Alert(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
AlertSignalExecutionFailed(
|
||||||
|
signal,
|
||||||
|
state //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Timing Actions ...
|
// Timing Actions ...
|
||||||
|
|
||||||
|
|||||||
@@ -810,6 +810,7 @@ class XC121SMCExpert : public XCBaseExpert
|
|||||||
ENUM_X_SIGNAL_EXECUTION_RESULT state;
|
ENUM_X_SIGNAL_EXECUTION_RESULT state;
|
||||||
bool isExecuted = mTradeHandler.ExecuteSignal(
|
bool isExecuted = mTradeHandler.ExecuteSignal(
|
||||||
signal,
|
signal,
|
||||||
|
conditions,
|
||||||
state,
|
state,
|
||||||
false // ignore Policies ...
|
false // ignore Policies ...
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
//
|
//
|
||||||
// Imports ...
|
// Imports ...
|
||||||
#include "../../Classes/x-saherelm.base.class.mq5"
|
#include "../../Classes/x-saherelm.base.class.mq5"
|
||||||
|
#include "../../Classes/x-saherelm.x-poi.drawer.class.mq5"
|
||||||
#include "../../Helpers/x-saherelm.x121.helper.mq5"
|
#include "../../Helpers/x-saherelm.x121.helper.mq5"
|
||||||
#include "../../Libraries/x-saherelm.common.lib.mq5"
|
#include "../../Libraries/x-saherelm.common.lib.mq5"
|
||||||
#include "../../Libraries/x-saherelm.x-poi.lib.mq5"
|
#include "../../Libraries/x-saherelm.x-poi.lib.mq5"
|
||||||
@@ -35,12 +36,7 @@ const string X121SMCStrategyToken = "X121SMC";
|
|||||||
|
|
||||||
//
|
//
|
||||||
const string X121SMCXTestToken = "X121XTest";
|
const string X121SMCXTestToken = "X121XTest";
|
||||||
const string X121SMCXPVOBToken = "X121XPVOB";
|
|
||||||
const string X121SMCXPVDPToken = "X121XPVDP";
|
|
||||||
const string X121SMCXVWPBToken = "X121XVWPB";
|
|
||||||
const string X121SMCXTWPVToken = "X121XTWPV";
|
const string X121SMCXTWPVToken = "X121XTWPV";
|
||||||
const string X121SMCXOEPVToken = "X121XOEPV";
|
|
||||||
const string X121SMCXPVSupDemToken = "X121XPVSUPDEM";
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// X121 SMC Providers ...
|
// X121 SMC Providers ...
|
||||||
@@ -49,12 +45,7 @@ enum ENUM_X_121_SMC_PROVIDERS
|
|||||||
//
|
//
|
||||||
X_121_SMC_PROVIDER_NONE,
|
X_121_SMC_PROVIDER_NONE,
|
||||||
X_121_SMC_PROVIDER_XTEST,
|
X_121_SMC_PROVIDER_XTEST,
|
||||||
X_121_SMC_PROVIDER_XPVOB,
|
|
||||||
X_121_SMC_PROVIDER_XPVDP,
|
|
||||||
X_121_SMC_PROVIDER_XVWPB,
|
|
||||||
X_121_SMC_PROVIDER_XTWPV,
|
X_121_SMC_PROVIDER_XTWPV,
|
||||||
X_121_SMC_PROVIDER_XOEPV,
|
|
||||||
X_121_SMC_PROVIDER_XPVSUPDEM,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -264,9 +255,11 @@ struct X121SMCStrategyConditions
|
|||||||
double target;
|
double target;
|
||||||
string provider;
|
string provider;
|
||||||
ENUM_X_DIRECTION signalDir;
|
ENUM_X_DIRECTION signalDir;
|
||||||
ENUM_X_DIRECTION marketStructureDir;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
XPriceZones priceZones;
|
||||||
|
XPriceZones decisionZones;
|
||||||
|
XMarketStructure marketStructure;
|
||||||
|
|
||||||
//
|
//
|
||||||
void X121SMCStrategyConditions()
|
void X121SMCStrategyConditions()
|
||||||
@@ -292,7 +285,11 @@ struct X121SMCStrategyConditions
|
|||||||
tp = 0;
|
tp = 0;
|
||||||
provider = NULL;
|
provider = NULL;
|
||||||
signalDir = X_DIRECTION_NONE;
|
signalDir = X_DIRECTION_NONE;
|
||||||
marketStructureDir = X_DIRECTION_NONE;
|
|
||||||
|
//
|
||||||
|
priceZones.Clean();
|
||||||
|
decisionZones.Clean();
|
||||||
|
marketStructure.Clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -503,6 +500,115 @@ struct X121SMCStrategyConditions
|
|||||||
//
|
//
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw X121 SMC Conditions ...
|
||||||
|
*
|
||||||
|
* @param conditions: X121SMCStrategyConditions instance Reference ...
|
||||||
|
* @param drawMarketStructure: Boolean ...
|
||||||
|
* @param drawPriceZones: Boolean ...
|
||||||
|
* @param drawDecisionZones: Boolean ...
|
||||||
|
*
|
||||||
|
* @return ( int )
|
||||||
|
*/
|
||||||
|
int DrawX121SMCStrategyConditions(
|
||||||
|
X121SMCStrategyConditions &conditions,
|
||||||
|
XCBaseObject *&drawnObjects[],
|
||||||
|
XCPOIDrawer *drawer,
|
||||||
|
bool drawMarketStructure = true,
|
||||||
|
bool drawPriceZones = true,
|
||||||
|
bool drawDecisionZones = true //
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
int result = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
Clean(drawnObjects);
|
||||||
|
|
||||||
|
//
|
||||||
|
if (drawer == NULL ||
|
||||||
|
!conditions.IsValid() ||
|
||||||
|
!HasDirection(conditions.signalDir))
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isBullish = IsBullish(conditions.signalDir);
|
||||||
|
|
||||||
|
//
|
||||||
|
bool hasPriceZones = conditions.priceZones.IsValid();
|
||||||
|
if (hasPriceZones &&
|
||||||
|
drawPriceZones)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCBaseObject *objects[];
|
||||||
|
int objectsCount = drawer.DrawPriceZone(
|
||||||
|
conditions.priceZones,
|
||||||
|
objects //
|
||||||
|
);
|
||||||
|
if (IsValidSize(objectsCount))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Copy(
|
||||||
|
objects,
|
||||||
|
drawnObjects,
|
||||||
|
false //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool hasDecisionZones = conditions.decisionZones.IsValid();
|
||||||
|
if (hasDecisionZones &&
|
||||||
|
drawDecisionZones)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCBaseObject *objects[];
|
||||||
|
int objectsCount = drawer.DrawPriceZone(
|
||||||
|
conditions.decisionZones,
|
||||||
|
objects //
|
||||||
|
);
|
||||||
|
if (IsValidSize(objectsCount))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Copy(
|
||||||
|
objects,
|
||||||
|
drawnObjects,
|
||||||
|
false //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool hasMarketStructure = conditions.marketStructure.IsValid();
|
||||||
|
if (hasMarketStructure &&
|
||||||
|
drawMarketStructure)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCBaseObject *objects[];
|
||||||
|
int objectsCount = drawer.DrawMarketStructure(
|
||||||
|
conditions.marketStructure,
|
||||||
|
objects //
|
||||||
|
);
|
||||||
|
if (IsValidSize(objectsCount))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Copy(
|
||||||
|
objects,
|
||||||
|
drawnObjects,
|
||||||
|
false //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
result = ArraySize(drawnObjects);
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
@@ -560,35 +666,10 @@ string ToString(ENUM_X_121_SMC_PROVIDERS value)
|
|||||||
result = X121SMCXTestToken;
|
result = X121SMCXTestToken;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//
|
|
||||||
case X_121_SMC_PROVIDER_XPVOB:
|
|
||||||
result = X121SMCXPVOBToken;
|
|
||||||
break;
|
|
||||||
|
|
||||||
//
|
|
||||||
case X_121_SMC_PROVIDER_XPVDP:
|
|
||||||
result = X121SMCXPVDPToken;
|
|
||||||
break;
|
|
||||||
|
|
||||||
//
|
|
||||||
case X_121_SMC_PROVIDER_XVWPB:
|
|
||||||
result = X121SMCXVWPBToken;
|
|
||||||
break;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
case X_121_SMC_PROVIDER_XTWPV:
|
case X_121_SMC_PROVIDER_XTWPV:
|
||||||
result = X121SMCXTWPVToken;
|
result = X121SMCXTWPVToken;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//
|
|
||||||
case X_121_SMC_PROVIDER_XOEPV:
|
|
||||||
result = X121SMCXOEPVToken;
|
|
||||||
break;
|
|
||||||
|
|
||||||
//
|
|
||||||
case X_121_SMC_PROVIDER_XPVSUPDEM:
|
|
||||||
result = X121SMCXPVSupDemToken;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -618,30 +699,10 @@ ENUM_X_121_SMC_PROVIDERS ParseProvider(string value)
|
|||||||
{
|
{
|
||||||
result = X_121_SMC_PROVIDER_XTEST;
|
result = X_121_SMC_PROVIDER_XTEST;
|
||||||
}
|
}
|
||||||
else if (Contains(X121SMCXPVOBToken, value))
|
|
||||||
{
|
|
||||||
result = X_121_SMC_PROVIDER_XPVOB;
|
|
||||||
}
|
|
||||||
else if (Contains(X121SMCXPVDPToken, value))
|
|
||||||
{
|
|
||||||
result = X_121_SMC_PROVIDER_XPVDP;
|
|
||||||
}
|
|
||||||
else if (Contains(X121SMCXVWPBToken, value))
|
|
||||||
{
|
|
||||||
result = X_121_SMC_PROVIDER_XVWPB;
|
|
||||||
}
|
|
||||||
else if (Contains(X121SMCXTWPVToken, value))
|
else if (Contains(X121SMCXTWPVToken, value))
|
||||||
{
|
{
|
||||||
result = X_121_SMC_PROVIDER_XTWPV;
|
result = X_121_SMC_PROVIDER_XTWPV;
|
||||||
}
|
}
|
||||||
else if (Contains(X121SMCXOEPVToken, value))
|
|
||||||
{
|
|
||||||
result = X_121_SMC_PROVIDER_XOEPV;
|
|
||||||
}
|
|
||||||
else if (Contains(X121SMCXPVSupDemToken, value))
|
|
||||||
{
|
|
||||||
result = X_121_SMC_PROVIDER_XPVSUPDEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -285,9 +285,9 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
// TODO: Remove this ...
|
// TODO: Remove this ...
|
||||||
XCSignalObject *iObj;
|
// XCSignalObject *iObj;
|
||||||
mPOIDrawer.DrawSignal(signal, iObj);
|
// mPOIDrawer.DrawSignal(signal, iObj);
|
||||||
Print("");
|
// Print("");
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -495,82 +495,6 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
|||||||
setupDir = mXTWPVConditions.dir;
|
setupDir = mXTWPVConditions.dir;
|
||||||
setupTime = mXTWPVConditions.setupTime;
|
setupTime = mXTWPVConditions.setupTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Handle Required Drawings ...
|
|
||||||
bool hasPivot = mXTWPVConditions.HasPivot();
|
|
||||||
bool hasPriceInsideZone = mXTWPVConditions.HasPriceInsideZones();
|
|
||||||
bool hasConsolidationZone = mXTWPVConditions.HasConsolidationZone();
|
|
||||||
bool canDraw = hasPivot ||
|
|
||||||
hasPriceInsideZone ||
|
|
||||||
hasConsolidationZone;
|
|
||||||
if (canDraw)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
ClearDraws();
|
|
||||||
|
|
||||||
//
|
|
||||||
// Draw Consolidation Zone ...
|
|
||||||
if (hasConsolidationZone)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
XCConsolidationZoneObject *iObj;
|
|
||||||
bool isCreated = mPOIDrawer.CreateConsolidationZone(
|
|
||||||
mXTWPVConditions.consolidationZone,
|
|
||||||
iObj //
|
|
||||||
);
|
|
||||||
if (isCreated)
|
|
||||||
{
|
|
||||||
AddObjectIfNotExists(iObj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Draw Pivot Zone ...
|
|
||||||
if (hasPivot)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
XCBaseObject *drawnObjects[];
|
|
||||||
int drawnObjectsCount = DrawXTWPVPivotZone(
|
|
||||||
mXTWPVConditions,
|
|
||||||
mPOIDrawer,
|
|
||||||
drawnObjects,
|
|
||||||
false, // Draw State ...
|
|
||||||
false, // Draw Ticks Zone ...
|
|
||||||
true, // Ignore SwingHighs ...
|
|
||||||
true, // Ignore SwingLows ...
|
|
||||||
true, // Ignore SupportZones ...
|
|
||||||
true, // Ignore ResistanceZones ...
|
|
||||||
true, // Ignore SupplyZones ...
|
|
||||||
true, // Ignore DemandZones ...
|
|
||||||
true, // Ignore BullishOrderBlocks ...
|
|
||||||
true, // Ignore BearishOrderBlocks ...
|
|
||||||
true, // Ignore BullishFairValueGaps ...
|
|
||||||
true, // Ignore BearishFairValueGaps ...
|
|
||||||
true, // Ignore BullishRejectionBars ...
|
|
||||||
true, // Ignore BearishRejectionBars ...
|
|
||||||
true, // Ignore BullishMomentumBars ...
|
|
||||||
true // Ignore BearishMomentumBars ...
|
|
||||||
);
|
|
||||||
AddObjectsIfNotExists(drawnObjects);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Draw Price Inside Zones ...
|
|
||||||
if (hasPriceInsideZone)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
XCBaseObject *drawnObjects[];
|
|
||||||
int drawnObjectsCount = DrawTWPVPriceInsideZones(
|
|
||||||
mXTWPVConditions,
|
|
||||||
mPOIDrawer,
|
|
||||||
drawnObjects //
|
|
||||||
);
|
|
||||||
AddObjectsIfNotExists(drawnObjects);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
result = isSetuped;
|
result = isSetuped;
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
@@ -628,6 +552,18 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
|||||||
conditions.sl = mXTWPVConditions.sl;
|
conditions.sl = mXTWPVConditions.sl;
|
||||||
conditions.target = mXTWPVConditions.target;
|
conditions.target = mXTWPVConditions.target;
|
||||||
|
|
||||||
|
//
|
||||||
|
conditions.decisionZones = mXTWPVConditions.decisionZone;
|
||||||
|
conditions.marketStructure = mXTWPVConditions.analyseMarketStructure;
|
||||||
|
if (isBullish)
|
||||||
|
{
|
||||||
|
conditions.priceZones = mXTWPVConditions.valePriceZone;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
conditions.priceZones = mXTWPVConditions.peakPriceZone;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
mXTWPVConditions.Clean();
|
mXTWPVConditions.Clean();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user