This commit is contained in:
2024-06-28 15:52:58 +03:30
parent a0437ad09b
commit 313e75988e
2 changed files with 84 additions and 82 deletions
+77 -77
View File
@@ -4543,7 +4543,7 @@ public:
}
}
//
//
// Multiply Signal Volume ...
if (isSignalValid)
{
@@ -4585,6 +4585,9 @@ public:
multiplier++;
}
//
IncreaseNextSignalsVolume
//
// Ignore ...
iSignal.volume = iSignal.volume * multiplier;
@@ -4637,10 +4640,6 @@ public:
// Make State of Signalling to Force State for Recieving
// Signal and Clear their Tp and SL for allowing hedges ...
EQMHandleForceState(signals);
if (mForce)
{
result = true;
}
//
DoHedge();
@@ -4953,6 +4952,7 @@ private:
double mTPPoint; // TP Point
double mSLPoint; // SL Point
int mMaxAllowedTrades; // Max Alloed Positions
bool mIncreaseNextSignalsVolume; // Increase Next Signals Volume
bool mUseMaxAllowedPerDirection; // Use Max Allowed Positions Per Direction
bool mIgnoreTP; // Ignore Calculated TP
bool mIgnoreSL; // Ignore Calculated SL
@@ -5243,91 +5243,91 @@ private:
{
//
// Validate Force Marigin ...
double marigin = mTrader.mAccount.GetMargin();
double minFreeMarigin = MinFreeMargingForOpenTrades();
double forceMargin = 3 * minFreeMarigin; // TODO: Make It Configurable
// double marigin = mTrader.mAccount.GetMargin();
// double minFreeMarigin = MinFreeMargingForOpenTrades();
// double forceMargin = 3 * minFreeMarigin; // TODO: Make It Configurable
//
// Retrieving Positions ...
XPosition positions[];
int positionsCount = mTrader.GetPositions(positions);
if (!IsValidSize(positionsCount))
{
//
mForce = false;
// XPosition positions[];
// int positionsCount = mTrader.GetPositions(positions);
// if (!IsValidSize(positionsCount))
// {
// //
// mForce = false;
//
datetime cTime = TimeCurrent();
string message = "Exit From Force State: " + ToString(cTime);
// //
// datetime cTime = TimeCurrent();
// string message = "Exit From Force State: " + ToString(cTime);
//
// Log(message);
return;
}
// //
// // Log(message);
// return;
// }
//
XPosition oldest;
int oldestAge = GetOldest(
oldest,
positions //
);
// //
// XPosition oldest;
// int oldestAge = GetOldest(
// oldest,
// positions //
// );
//
// Check Force State ...
bool isForce = marigin >= forceMargin && oldestAge >= 288;
if (!isForce)
{
//
if (mForce)
{
//
mForce = false;
// //
// // Check Force State ...
// bool isForce = marigin >= forceMargin && oldestAge >= 288;
// if (!isForce)
// {
// //
// if (mForce)
// {
// //
// mForce = false;
//
datetime cTime = TimeCurrent();
string message = "Exit From Force State: " + ToString(cTime);
// //
// datetime cTime = TimeCurrent();
// string message = "Exit From Force State: " + ToString(cTime);
//
// Log(message);
}
return;
}
else
{
mForce = true;
}
// //
// // Log(message);
// }
// return;
// }
// else
// {
// mForce = true;
// }
//
// Prevent Moving Forward From Non Force State ...
if (!mForce)
{
return;
}
// //
// // Prevent Moving Forward From Non Force State ...
// if (!mForce)
// {
// return;
// }
//
double minProfitPerTrade = MinProfitPerTrade();
double minProfitPerVolumeFactor = MinProfitPerVolumeFactor();
// //
// double minProfitPerTrade = MinProfitPerTrade();
// double minProfitPerVolumeFactor = MinProfitPerVolumeFactor();
//
double profit = SpecifiedCalculatePositionsProfit(positions);
double requiredProfit = SpecifiedCalculateRequiredProfitForHedge(
positions,
minProfitPerTrade,
minProfitPerVolumeFactor //
);
// //
// double profit = SpecifiedCalculatePositionsProfit(positions);
// double requiredProfit = SpecifiedCalculateRequiredProfitForHedge(
// positions,
// minProfitPerTrade,
// minProfitPerVolumeFactor //
// );
//
XSymbolPositions symbolPositions[];
int symbolPositionsCount = ExtractSymbolPositions(
positions,
symbolPositions,
minProfitPerTrade,
minProfitPerVolumeFactor //
);
if (!IsValidSize(symbolPositionsCount))
{
return;
}
// //
// XSymbolPositions symbolPositions[];
// int symbolPositionsCount = ExtractSymbolPositions(
// positions,
// symbolPositions,
// minProfitPerTrade,
// minProfitPerVolumeFactor //
// );
// if (!IsValidSize(symbolPositionsCount))
// {
// return;
// }
//
// Log("symbolPositionsCount: " + ToString(symbolPositionsCount));