last ...
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -289,7 +289,11 @@ public:
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
int requiredAgeForSLTrail = 10;
|
||||
// TODO:
|
||||
// Make them Configurable ...
|
||||
int numberOfPositionsForHege = 4;
|
||||
int levelsOnClose = 6;
|
||||
int requiredAgeForSLTrail = 3;
|
||||
int requiredDistanceForSLTrail = 10;
|
||||
|
||||
//
|
||||
@@ -307,10 +311,18 @@ public:
|
||||
//
|
||||
XPosition iPosition = positions[i];
|
||||
|
||||
//
|
||||
bool canManageState =
|
||||
//
|
||||
iPosition.provider == ToString(X786) ||
|
||||
iPosition.provider == ToString(X121) ||
|
||||
iPosition.provider == ToString(X92)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// Position Management for X786 ...
|
||||
if (iPosition.provider == ToString(X786) ||
|
||||
iPosition.provider == ToString(X121))
|
||||
if (canManageState)
|
||||
{
|
||||
//
|
||||
// Check Position in Profit or not ...
|
||||
@@ -318,7 +330,7 @@ public:
|
||||
{
|
||||
//
|
||||
XTrail trail;
|
||||
bool isTrailedBefore = GetTrail(
|
||||
bool isTrailedBefore = GetSLTrail(
|
||||
iPosition.ticket,
|
||||
trail //
|
||||
);
|
||||
@@ -355,6 +367,12 @@ public:
|
||||
? iPosition.sl + slDiff
|
||||
: iPosition.sl - slDiff;
|
||||
|
||||
// //
|
||||
// double sl =
|
||||
// IsLong(iPosition.type)
|
||||
// ? iPosition.entry + (slDiff / 2)
|
||||
// : iPosition.entry - (slDiff / 2);
|
||||
|
||||
//
|
||||
bool isInit = trail.Init(
|
||||
iPosition.ticket,
|
||||
@@ -400,7 +418,7 @@ public:
|
||||
{
|
||||
//
|
||||
// int positionAge = iPosition.GetAge(iPosition.period);
|
||||
if (trail.level >= 3)
|
||||
if (trail.level >= levelsOnClose)
|
||||
{
|
||||
//
|
||||
string comment = "EQM Close In Profit ...";
|
||||
@@ -411,7 +429,7 @@ public:
|
||||
if (isClosed)
|
||||
{
|
||||
//
|
||||
RemoveTrail(iPosition.ticket);
|
||||
RemoveSLTrail(iPosition.ticket);
|
||||
|
||||
//
|
||||
string message = "EQM Close (" + ToString(iPosition.ticket) + ") In Profit ...";
|
||||
@@ -424,11 +442,20 @@ public:
|
||||
//
|
||||
double slDiff = PointToPrice(priceDistance, iPosition.symbol);
|
||||
|
||||
//
|
||||
double selectedValue =
|
||||
//
|
||||
trail.level == 2
|
||||
? iPosition.entry
|
||||
: iPosition.sl
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
double sl =
|
||||
IsLong(iPosition.type)
|
||||
? iPosition.sl + slDiff
|
||||
: iPosition.sl - slDiff;
|
||||
? selectedValue + slDiff
|
||||
: selectedValue - slDiff;
|
||||
|
||||
//
|
||||
// Update Trail Values ...
|
||||
@@ -456,10 +483,10 @@ public:
|
||||
if (isModified)
|
||||
{
|
||||
//
|
||||
RemoveTrail(trail.ticket);
|
||||
RemoveSLTrail(trail.ticket);
|
||||
|
||||
//
|
||||
AddTrail(trail);
|
||||
AddSLTrail(trail);
|
||||
|
||||
//
|
||||
string message = "Position (" + ToString(trail.ticket) + ") Trailed SL on Level: " + ToString(trail.level);
|
||||
@@ -470,11 +497,193 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Hedge ...
|
||||
if (positionsCount >= numberOfPositionsForHege)
|
||||
{
|
||||
//
|
||||
double profit = CalculatePositionsProfit(positions);
|
||||
double requiredProfit = CalculateRequiredProfitForHedge(positions);
|
||||
|
||||
//
|
||||
bool isReadyForHedge = profit >= requiredProfit;
|
||||
if (!isReadyForHedge)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
string comment = "EQM Hedge ...";
|
||||
int closed = mTrader.Close(
|
||||
positions,
|
||||
comment
|
||||
//
|
||||
);
|
||||
if (closed > 0)
|
||||
{
|
||||
//
|
||||
string message = "EQM Hedge Positions on Profit: " + ToString(profit);
|
||||
|
||||
//
|
||||
mAlert.Alert(message);
|
||||
|
||||
//
|
||||
for (int i = 0; i < positionsCount; i++)
|
||||
{
|
||||
RemoveSLTrail(positions[i].ticket);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Must false ...
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Here we Can Filter Signals before Sending them to Execution ...
|
||||
// based on Providers and etc ...
|
||||
// for Volumes and Benefits ...
|
||||
int HandleSignalManagement(XSignal &signals[]) override
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
if (ArraySize(signals) <= 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Create temp Array for Filtering ...
|
||||
XSignal tmps[];
|
||||
Copy(
|
||||
signals,
|
||||
tmps //
|
||||
);
|
||||
int tmpsCount = ArraySize(tmps);
|
||||
|
||||
//
|
||||
// Cleaning Source ...
|
||||
Clean(signals);
|
||||
|
||||
//
|
||||
// Loop through Signals for Management ...
|
||||
for (int i = 0; i < tmpsCount; i++)
|
||||
{
|
||||
//
|
||||
XSignal iSignal = tmps[i];
|
||||
|
||||
//
|
||||
string provider = iSignal.provider;
|
||||
if (!IsValid(provider))
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
iSignal,
|
||||
signals //
|
||||
);
|
||||
|
||||
//
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
XPosition positions[];
|
||||
int positionsCount = mTrader.GetPositions(
|
||||
positions,
|
||||
iSignal.symbol,
|
||||
iSignal.provider,
|
||||
NULL, // All Periods ...
|
||||
iSignal.type //
|
||||
);
|
||||
if (positionsCount <= 5)
|
||||
{
|
||||
//
|
||||
// First Signal in a While of Specific Provider ...
|
||||
AddRef(
|
||||
iSignal,
|
||||
signals //
|
||||
);
|
||||
|
||||
//
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// not First Signal ...
|
||||
|
||||
//
|
||||
// Calculate Provider Specified Open Positions Profit ...
|
||||
double profits = CalculatePositionsProfit(positions);
|
||||
if (profits > 0)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
iSignal,
|
||||
signals //
|
||||
);
|
||||
|
||||
//
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// Find Max In Profit of Same Position ...
|
||||
Clean(positions);
|
||||
positionsCount = mTrader.GetInProfitPositions(
|
||||
positions,
|
||||
iSignal.symbol,
|
||||
iSignal.provider,
|
||||
NULL, // All Periods ...
|
||||
iSignal.type,
|
||||
X_POSITION_SELECT_MAX // Max In Profit ...
|
||||
);
|
||||
if (positionsCount <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
string comment = "EQM Close Max Profit ...";
|
||||
bool isClosed = mTrader.Close(
|
||||
positions[0].ticket,
|
||||
comment //
|
||||
);
|
||||
if (isClosed)
|
||||
{
|
||||
//
|
||||
RemoveTrail(positions[0].ticket);
|
||||
|
||||
//
|
||||
string message = "EQM Close Max In Profit (" + ToString(positions[0].ticket) + ") for new Signal ...";
|
||||
|
||||
//
|
||||
mAlert.Alert(message);
|
||||
|
||||
//
|
||||
AddRef(
|
||||
iSignal,
|
||||
signals //
|
||||
);
|
||||
|
||||
//
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(signals);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Request for Support Signals using Guard ...
|
||||
bool RequestForSupport(
|
||||
@@ -487,6 +696,12 @@ public:
|
||||
{
|
||||
//
|
||||
// TODO: Implement this ...
|
||||
|
||||
//
|
||||
// Support Senario ...
|
||||
// Check Support Position Exists or not ...
|
||||
// Check Positions for Support based on Types ...
|
||||
// Update Untriggered Positions ...
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -544,22 +759,39 @@ private:
|
||||
// Trails Holding ...
|
||||
|
||||
//
|
||||
XTrail mTrails[];
|
||||
XTrail mSLTrails[];
|
||||
XTrail mTPTrails[];
|
||||
|
||||
//
|
||||
int CountTrails()
|
||||
int CountSLTrails()
|
||||
{
|
||||
return ArraySize(mTrails);
|
||||
return ArraySize(mSLTrails);
|
||||
}
|
||||
int CountTPTrails()
|
||||
{
|
||||
return ArraySize(mTPTrails);
|
||||
}
|
||||
|
||||
//
|
||||
bool RemoveTrail(ulong ticket)
|
||||
{
|
||||
//
|
||||
bool isSLRemoved = RemoveSLTrail(ticket);
|
||||
bool isTPRemoved = RemoveTPTrail(ticket);
|
||||
|
||||
//
|
||||
bool result = isSLRemoved || isTPRemoved;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
bool RemoveSLTrail(ulong ticket)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
int idx = FindTrailIndex(ticket);
|
||||
int idx = FindSLTrailIndex(ticket);
|
||||
result = idx >= 0;
|
||||
if (!result)
|
||||
{
|
||||
@@ -568,7 +800,30 @@ private:
|
||||
|
||||
//
|
||||
result = ArrayRemove(
|
||||
mTrails,
|
||||
mSLTrails,
|
||||
idx,
|
||||
1 //
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
bool RemoveTPTrail(ulong ticket)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
int idx = FindTPTrailIndex(ticket);
|
||||
result = idx >= 0;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = ArrayRemove(
|
||||
mTPTrails,
|
||||
idx,
|
||||
1 //
|
||||
);
|
||||
@@ -578,13 +833,13 @@ private:
|
||||
}
|
||||
|
||||
//
|
||||
int FindTrailIndex(ulong ticket)
|
||||
int FindSLTrailIndex(ulong ticket)
|
||||
{
|
||||
//
|
||||
int result = -1;
|
||||
|
||||
//
|
||||
int trailsCount = CountTrails();
|
||||
int trailsCount = CountSLTrails();
|
||||
if (ticket <= 0 || trailsCount <= 0)
|
||||
{
|
||||
return result;
|
||||
@@ -594,7 +849,37 @@ private:
|
||||
for (int i = 0; i < trailsCount; i++)
|
||||
{
|
||||
//
|
||||
XTrail iTrail = mTrails[i];
|
||||
XTrail iTrail = mSLTrails[i];
|
||||
|
||||
//
|
||||
if (iTrail.ticket == ticket)
|
||||
{
|
||||
//
|
||||
result = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
int FindTPTrailIndex(ulong ticket)
|
||||
{
|
||||
//
|
||||
int result = -1;
|
||||
|
||||
//
|
||||
int trailsCount = CountTPTrails();
|
||||
if (ticket <= 0 || trailsCount <= 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
for (int i = 0; i < trailsCount; i++)
|
||||
{
|
||||
//
|
||||
XTrail iTrail = mTPTrails[i];
|
||||
|
||||
//
|
||||
if (iTrail.ticket == ticket)
|
||||
@@ -610,7 +895,7 @@ private:
|
||||
}
|
||||
|
||||
//
|
||||
bool GetTrail(
|
||||
bool GetSLTrail(
|
||||
ulong ticket,
|
||||
XTrail &trail //
|
||||
)
|
||||
@@ -619,7 +904,7 @@ private:
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
int idx = FindTrailIndex(ticket);
|
||||
int idx = FindSLTrailIndex(ticket);
|
||||
result = idx >= 0;
|
||||
if (!result)
|
||||
{
|
||||
@@ -627,14 +912,36 @@ private:
|
||||
}
|
||||
|
||||
//
|
||||
trail = mTrails[idx];
|
||||
trail = mSLTrails[idx];
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
bool GetTPTrail(
|
||||
ulong ticket,
|
||||
XTrail &trail //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
int idx = FindTPTrailIndex(ticket);
|
||||
result = idx >= 0;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
trail = mTPTrails[idx];
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
void AddTrail(
|
||||
void AddSLTrail(
|
||||
XTrail &trail //
|
||||
)
|
||||
{
|
||||
@@ -647,7 +954,23 @@ private:
|
||||
//
|
||||
AddRef(
|
||||
trail,
|
||||
mTrails //
|
||||
mSLTrails //
|
||||
);
|
||||
}
|
||||
void AddTPTrail(
|
||||
XTrail &trail //
|
||||
)
|
||||
{
|
||||
//
|
||||
if (!trail.IsValid())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
AddRef(
|
||||
trail,
|
||||
mTPTrails //
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,14 @@
|
||||
// Define On Signal Event Handler Type ...
|
||||
typedef void (*TOnSignal)(XSignal &signals[]);
|
||||
|
||||
//
|
||||
// Model Account Profits ...
|
||||
struct XProfitTracker {
|
||||
//
|
||||
int count; // Number of Positions ...
|
||||
|
||||
};
|
||||
|
||||
//
|
||||
// Class Definition ...
|
||||
|
||||
@@ -535,7 +543,7 @@ public:
|
||||
//
|
||||
// Draw On Chart if anything is required ...
|
||||
virtual void Draw() {}
|
||||
|
||||
|
||||
//
|
||||
// Check For any Guard Actions ...
|
||||
virtual bool CheckForGuard(XGuard &guards[])
|
||||
@@ -566,6 +574,19 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// Regulary Filtered Signals passed to this
|
||||
// and here we can do Additional Signal Filtering
|
||||
// for Signal Management such as (Providers and etc) ...
|
||||
virtual int HandleSignalManagement(XSignal &signals[])
|
||||
{
|
||||
//
|
||||
int result = ArraySize(signals);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Here we Have to Check Market based
|
||||
// on our Strategy for Trading ...
|
||||
@@ -623,6 +644,13 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
int managedSignalsCount = HandleSignalManagement(filteredSignals);
|
||||
if (managedSignalsCount <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Try to Execute Signals ...
|
||||
ENUM_X_SIGNAL_EXECUTION_RESULT reasons[];
|
||||
|
||||
+10
-10
@@ -34,14 +34,14 @@ long x121EAMagicNumber = 78692110; // Magic Number
|
||||
int x121EASlippage = 10; // Slippgae
|
||||
string x121EASymbols = "EURUSDb"; // Symbols
|
||||
//
|
||||
bool x121EAAllowLong = true; // Allow Long Trades
|
||||
bool x121EAAllowShort = true; // Allow Short Trades
|
||||
int x121EAManageInterval = 5; // Manager Check Intervals Seconds
|
||||
int x121EAMaxAllowedPositions = 0; // Max Allowed Positions
|
||||
double x121EAMaxAllowedSpread = 0; // Max Allowed Spred for Opening Trades
|
||||
double x121EAMinProfitPerTrade = 0; // Min Profit Per Trade based On Volume Factor (Hedge)
|
||||
double x121EAMinProfitPerVolumeFactor = 0; // Min Volume Factor for Calculating Profit (Hedge)
|
||||
double x121EAMaxAllowedDrawdownFactor = 0; // Max Allowed Drawdown Factor
|
||||
bool x121EAAllowLong = true; // Allow Long Trades
|
||||
bool x121EAAllowShort = true; // Allow Short Trades
|
||||
int x121EAManageInterval = 5; // Manager Check Intervals Seconds
|
||||
int x121EAMaxAllowedPositions = 5; // Max Allowed Positions
|
||||
double x121EAMaxAllowedSpread = 0; // Max Allowed Spred for Opening Trades
|
||||
double x121EAMinProfitPerTrade = 0.4; // Min Profit Per Trade based On Volume Factor (Hedge)
|
||||
double x121EAMinProfitPerVolumeFactor = 0.01; // Min Volume Factor for Calculating Profit (Hedge)
|
||||
double x121EAMaxAllowedDrawdownFactor = 0.015; // Max Allowed Drawdown Factor
|
||||
//
|
||||
double x121EAVolume = 0.01;
|
||||
|
||||
@@ -313,8 +313,8 @@ bool InitialEA()
|
||||
string fontName = "Arial";
|
||||
ENUM_ANCHOR_POINT fontAnchor = ANCHOR_LEFT_UPPER;
|
||||
|
||||
//false
|
||||
// Hind Market ...
|
||||
//
|
||||
// Hind Market ...
|
||||
iDescriptor.inputs.hMarketPeriod = NULL;
|
||||
iDescriptor.inputs.hMarketMethod = X_PERIOD_AUTO;
|
||||
iDescriptor.inputs.hMarketInputs.drawLabels = false;
|
||||
|
||||
@@ -314,6 +314,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameUpperO(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
upperOBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Lower ...
|
||||
|
||||
@@ -367,6 +385,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameLowerO(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
lowerOBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Close ...
|
||||
|
||||
@@ -423,6 +459,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameUpperC(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
upperCBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Lower ...
|
||||
|
||||
@@ -476,6 +530,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameLowerC(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
lowerCBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// High ...
|
||||
|
||||
@@ -532,6 +604,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameUpperH(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
upperHBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Lower ...
|
||||
|
||||
@@ -585,6 +675,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameLowerH(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
lowerHBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Low ...
|
||||
|
||||
@@ -641,6 +749,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameUpperL(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
upperLBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Lower ...
|
||||
|
||||
@@ -694,6 +820,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameLowerL(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
lowerLBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
void GetUppers(
|
||||
double &result[],
|
||||
|
||||
@@ -362,6 +362,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameTenkanSen(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
tenkanSenBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// KijunSen ...
|
||||
|
||||
@@ -408,6 +426,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameKijunSen(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
kijunSenBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// ChikouSpan ...
|
||||
|
||||
@@ -518,6 +554,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameSenkouSpanA(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
senkouSpanABuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// SenkouSpanB ...
|
||||
|
||||
@@ -573,6 +627,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameSenkouSpanB(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
senkouSpanBBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Future SenkouSpanA ...
|
||||
|
||||
|
||||
@@ -477,6 +477,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSamePeak(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
peaksBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Vales ...
|
||||
|
||||
@@ -530,6 +548,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameVale(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
valesBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Resistance ...
|
||||
|
||||
@@ -692,6 +728,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameFib1(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
fib1Buffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Level 2 ...
|
||||
|
||||
@@ -745,6 +799,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameFib2(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
fib2Buffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Level 3 ...
|
||||
|
||||
@@ -798,6 +870,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameFib3(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
fib3Buffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Level 4 ...
|
||||
|
||||
@@ -851,6 +941,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameFib4(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
fib4Buffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Level 5 ...
|
||||
|
||||
@@ -904,6 +1012,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameFib5(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
fib5Buffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Cycles ...
|
||||
|
||||
@@ -963,6 +1089,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameSCHH(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
scHHBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// LL ...
|
||||
|
||||
@@ -1016,6 +1160,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameSCLL(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
scLLBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Medium ...
|
||||
|
||||
@@ -1072,6 +1234,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameMCHH(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
mcHHBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// LL ...
|
||||
|
||||
@@ -1125,6 +1305,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameMCLL(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
mcLLBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Long ...
|
||||
|
||||
@@ -1181,6 +1379,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameLCHH(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
lcHHBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// LL ...
|
||||
|
||||
@@ -1234,6 +1450,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameLCLL(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
lcLLBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Hind ...
|
||||
|
||||
@@ -1290,6 +1524,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameHCHH(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
hcHHBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// LL ...
|
||||
|
||||
@@ -1343,6 +1595,24 @@ public:
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSameHCLL(
|
||||
int barIndex, // Start Bar Index
|
||||
int verifier = 71 // Number of Verifiers
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate();
|
||||
|
||||
//
|
||||
return IsSame(
|
||||
hcLLBuffer,
|
||||
verifier,
|
||||
barIndex //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Protected ...
|
||||
protected:
|
||||
|
||||
@@ -3630,8 +3630,9 @@ MqlDateTime GetBarTimeStruct(
|
||||
//
|
||||
template <typename T>
|
||||
bool IsSame(
|
||||
T &buffer[], // Search Buffer
|
||||
int count = 5 // Number of Searchs
|
||||
T &buffer[], // Search Buffer
|
||||
int count = 5, // Number of Searchs
|
||||
int start = 0 // Start ...
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -3647,15 +3648,15 @@ bool IsSame(
|
||||
|
||||
//
|
||||
// Validate Count ...
|
||||
result = count < bufferSize;
|
||||
result = start + count < bufferSize;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
T iTem = buffer[0];
|
||||
for (int i = 0; i < count; i++)
|
||||
T iTem = buffer[start];
|
||||
for (int i = start; i < start + count; i++)
|
||||
{
|
||||
//
|
||||
if (iTem != buffer[i])
|
||||
|
||||
Reference in New Issue
Block a user