This commit is contained in:
2024-06-24 21:46:41 +03:30
parent e41548979e
commit 5d12ff7958
7 changed files with 1608 additions and 49 deletions
+20 -10
View File
@@ -1070,13 +1070,17 @@ struct X121SignalGenerator
bool HasLongConditions(
X121SetupConditions &conditions, // Conditions
int &pusher, // Pushers
string &provider // Provider
string &provider, // Provider
double &tp, // Provided TP
double &sl // Provided SL
)
{
//
bool result = false;
//
tp = 0;
sl = 0;
pusher = 0;
//
@@ -1669,8 +1673,6 @@ struct X121SignalGenerator
result =
//
pusher >= 1 &&
// !isOSCShortVerified &&
// bullishScore > bearishScore * 2 &&
(
//
long1
@@ -1764,13 +1766,17 @@ struct X121SignalGenerator
bool HasShortConditions(
X121SetupConditions &conditions, // Conditions
int &pusher, // Pushers
string &provider // Provider
string &provider, // Provider
double &tp, // Provided TP
double &sl // Provided SL
)
{
//
bool result = false;
//
tp = 0;
sl = 0;
pusher = 0;
//
@@ -2363,8 +2369,6 @@ struct X121SignalGenerator
result =
//
pusher >= 1 &&
// !isOSCLongVerified &&
// bearishScore > bullishScore * 2 &&
(
//
short1
@@ -2688,7 +2692,7 @@ struct X121SignalGenerator
//
bool IsConditionsValidForLong(
X121SetupConditions &conditions, // Conditions
int verifications = 4 // Number of Verifications
int verifications = 2 // Number of Verifications
)
{
//
@@ -2944,7 +2948,7 @@ struct X121SignalGenerator
//
bool IsConditionsValidForShort(
X121SetupConditions &conditions, // Conditions
int verifications = 4 // Number of Verifications
int verifications = 2 // Number of Verifications
)
{
//
@@ -3011,6 +3015,8 @@ struct X121SignalGenerator
XSignal &signal, // Signal if Exists
int &pusher, // Pushers
string &provider, // Signal Provider Name
double &tp, // Provided TP
double &sl, // Provided SL
bool _useSupport, // Generate Support Signals
bool _allowLong, // Allow Long Signals
bool _allowShort, // Allow Short Signals
@@ -3046,7 +3052,9 @@ struct X121SignalGenerator
HasLongConditions(
conditions,
pusher,
provider //
provider,
tp,
sl //
);
//
@@ -3069,7 +3077,9 @@ struct X121SignalGenerator
HasShortConditions(
conditions,
pusher,
provider //
provider,
tp,
sl //
);
//
@@ -709,6 +709,8 @@ public:
X121SetupConditions &conditions,
int &pushers,
string &provider,
double &tp,
double &sl,
ENUM_X_MARKET_CYCLES cycle = X_MARKET_CYCLE_UNKNOWN,
bool allowSupports = false, // Allow Support Signal Generating ...
bool allowLong = false,
@@ -753,6 +755,8 @@ public:
signal,
pushers,
provider,
tp,
sl,
allowSupports,
allowLong,
allowShort,
+168 -10
View File
@@ -3578,6 +3578,8 @@ public:
//
// Current ...
double cTP = 0;
double cSL = 0;
XSignal cSignal;
int cPusher = 0;
bool cHasSignal = false;
@@ -3586,6 +3588,8 @@ public:
//
// Short ...
double sTP = 0;
double sSL = 0;
XSignal sSignal;
int sPusher = 0;
bool sHasSignal = false;
@@ -3594,6 +3598,8 @@ public:
//
// Medium ...
double mTP = 0;
double mSL = 0;
XSignal mSignal;
int mPusher = 0;
bool mHasSignal = false;
@@ -3602,6 +3608,8 @@ public:
//
// Long ...
double lTP = 0;
double lSL = 0;
XSignal lSignal;
int lPusher = 0;
bool lHasSignal = false;
@@ -3610,6 +3618,8 @@ public:
//
// Hind ...
double hTP = 0;
double hSL = 0;
XSignal hSignal;
int hPusher = 0;
bool hHasSignal = false;
@@ -3647,10 +3657,10 @@ public:
//
bool useCMarket = true;
bool useSMarket = false;
bool useMMarket = false;
bool useLMarket = false;
bool useHMarket = false;
bool useSMarket = true;
bool useMMarket = true;
bool useLMarket = true;
bool useHMarket = true;
//
for (int i = 0; i < count; i++)
@@ -3674,6 +3684,8 @@ public:
cConditions,
cPusher,
cProvider,
cTP,
cSL,
X_MARKET_CYCLE_UNKNOWN,
canSupport,
allowLong,
@@ -3706,6 +3718,8 @@ public:
sConditions,
sPusher,
sProvider,
sTP,
sSL,
X_MARKET_CYCLE_SHORT,
canSupport,
allowLong,
@@ -3738,6 +3752,8 @@ public:
mConditions,
mPusher,
mProvider,
mTP,
mSL,
X_MARKET_CYCLE_MEDIUM,
canSupport,
allowLong,
@@ -3770,6 +3786,8 @@ public:
lConditions,
lPusher,
lProvider,
lTP,
lSL,
X_MARKET_CYCLE_LONG,
canSupport,
allowLong,
@@ -3802,6 +3820,8 @@ public:
hConditions,
hPusher,
hProvider,
hTP,
hSL,
X_MARKET_CYCLE_HIND,
canSupport,
allowLong,
@@ -4089,6 +4109,13 @@ public:
//
bool isSignalValid = false;
//
isSignalValid = IsSignalDelayPassed(iSignal);
if (!isSignalValid)
{
continue;
}
//
// Handle Close All Positions when Opposit Signal Recieved ...
if (mCloseOnOpposit)
@@ -4188,21 +4215,149 @@ public:
}
//
// Only Accept Next Same Type when Previous in Profit ...
if (isSignalValid)
{
//
// Check Delay Between Two Signals ...
bool isDelayPassed = IsSignalDelayPassed(iSignal);
ENUM_X_POSITION_TYPES iType =
ToPositionType(iSignal.type);
XPosition iSymbolsPositions[];
int iSymbolsPositionsCount = mTrader.GetPositions(
iSymbolsPositions,
iSignal.symbol,
NULL, // Provider
NULL, // Period
iType, // Type
true //
);
//
if (isDelayPassed)
int iSupportsCount = 0;
if (IsValidSize(iSymbolsPositionsCount))
{
//
AddRef(
iSignal,
eSignals //
// Filter Support Positions ...
XPosition iSupports[];
iSupportsCount = ExtractSupports(
iSymbolsPositions,
iSupports //
);
//
// Filter Support Positions ...
if (IsValidSize(iSupportsCount))
{
//
XPosition tmpPositions[];
Copy(
iSymbolsPositions,
tmpPositions //
);
//
Clean(iSymbolsPositions);
//
for (int i = 0; i < iSymbolsPositionsCount; i++)
{
//
XPosition iPosition = tmpPositions[i];
//
bool isSupport = IsSupport(iPosition.comment);
if (isSupport)
{
continue;
}
//
AddRef(
iPosition,
iSymbolsPositions //
);
}
//
iSymbolsPositionsCount = ArraySize(iSymbolsPositions);
}
}
//
if (IsValidSize(iSymbolsPositionsCount))
{
//
XPosition youngest;
int youngestAge = GetYoungest(
youngest,
iSymbolsPositions //
);
//
isSignalValid = youngest.profit > 0.1;
}
//
if (!isSignalValid)
{
continue;
}
}
//
// Multiply Signal Volume ...
if (isSignalValid)
{
//
XPosition iSymbolsPositions[];
int iSymbolsPositionsCount = mTrader.GetPositions(
iSymbolsPositions,
iSignal.symbol,
NULL, // Provider
NULL, // Period
NULL, // Type
true //
);
//
int iSupportsCount = 0;
if (IsValidSize(iSymbolsPositionsCount))
{
//
// Filter Support Positions ...
XPosition iSupports[];
iSupportsCount = ExtractSupports(
iSymbolsPositions,
iSupports //
);
}
//
int multiplier =
iSupportsCount <= 0
? iSymbolsPositionsCount
: iSymbolsPositionsCount - iSupportsCount;
if (multiplier <= 0)
{
multiplier = 1;
}
else
{
multiplier++;
}
//
iSignal.volume = iSignal.volume * multiplier;
}
//
// Handle Signal ...
if (isSignalValid)
{
//
AddRef(
iSignal,
eSignals //
);
}
}
@@ -4885,6 +5040,9 @@ private:
// Handle Force State Management ...
void EQMHandleForceState()
{
//
return;
//
XPosition positions[];
int positionsCount = mTrader.GetPositions(positions);
+1 -2
View File
@@ -328,7 +328,6 @@ public:
bool isSlept = IsSlept();
if (isSlept)
{
Print("Slept");
return;
}
@@ -1166,7 +1165,7 @@ protected:
//
if (mRestingAfterHedge > 0)
{
Sleep(mRestingAfterHedge * 1000);
Sleeping(mRestingAfterHedge);
}
//
File diff suppressed because it is too large Load Diff
+14 -14
View File
@@ -44,15 +44,15 @@ input group "Signals";
//,USDCHFb,EURCHFb,USDJPYb,EURJPYb,GBPUSDb
// EURUSDb,USDCHFb,EURCHFb,USDJPYb,EURJPYb,GBPUSDb
// EURUSDb,USDCHFb,EURCHFb,USDJPYb,EURJPYb,GBPUSDb,XAUUSDb,NZDUSDb,AUDUSDb,USDCADb,BTCUSD,ETHUSD
input string x121EASymbols = "EURUSDb"; // Symbols
input bool x121EAUseAllSymbols = false; // Use All Available Symbols
input bool x121EAUseAllWatchListSymbols = false; // Use All WatchList Symbols
input bool x121EAAllowLong = true; // Allow Long Trades
input bool x121EAAllowShort = true; // Allow Short Trades
input bool x121EAExecuteSignalsOnBreakout = true; // Execute Signals On Breakouts
input int x121EADelayBetweenTwoSignal = 5; // Delay Between two Same Signals
input int x121EAReuiredSignalVerifications = 3; // Required Verifications for Signals
input bool x121EAGetVerificationFromOtherTimeFrames = false; // Get Verifications from Other Time Frames
input string x121EASymbols = "EURUSDb,USDCHFb,USDJPYb,GBPUSDb"; // Symbols
input bool x121EAUseAllSymbols = false; // Use All Available Symbols
input bool x121EAUseAllWatchListSymbols = false; // Use All WatchList Symbols
input bool x121EAAllowLong = true; // Allow Long Trades
input bool x121EAAllowShort = true; // Allow Short Trades
input bool x121EAExecuteSignalsOnBreakout = false; // Execute Signals On Breakouts
input int x121EADelayBetweenTwoSignal = 5; // Delay Between two Same Signals
input int x121EAReuiredSignalVerifications = 1; // Required Verifications for Signals
input bool x121EAGetVerificationFromOtherTimeFrames = false; // Get Verifications from Other Time Frames
//
// Risk Management ...
@@ -60,7 +60,7 @@ input group "Risk Management";
input double x121EAVolume = 0.01; // Static Volume
input double x121EATPPoint = 1000; // TP Point
input double x121EASLPoint = 1000; // SL Point
input int x121EAMaxAllowedTrades = 1; // Max Allowed Positions Per Symbol
input int x121EAMaxAllowedTrades = 0; // Max Allowed Positions Per Symbol
input bool x121EAUseMaxAllowedPerDirection = true; // Use Max Allowed Positions Per Direction
input bool x121EAIgnoreSL = true; // Ignore Calculated SL
input bool x121EAIgnoreTP = false; // Ignore Calculated TP
@@ -94,7 +94,7 @@ input double x121EAMaxAllowedSupportVolume = 0.04; // Max Allowed Support Signal
//
input group "Grid";
input bool x121EAAllowGrid = false; // Allow Grid Signals
input bool x121EAGridOnlyForces = false; // Grid Only Force Signals
input bool x121EAGridOnlyForces = true; // Grid Only Force Signals
input int x121EAMaxNumberOfGrids = 5; // Max Number of Grid Signals
input double x121EAGridDistance = 100; // Grid Distance
input double x121EAGridVolumeMultiplier = 2.0; // Grid Volume Multiplier
@@ -111,8 +111,8 @@ input double x121EAMaxAllowedRecoveryVolume = 0.08; // Max Allowed Recovery Sign
//
input group "Hedging";
input int x121EARestingAfterHedge = 0; // Resting Seconds After Hedge
input double x121EAMinRequiredProfitPerTrade = 0.2; // Minimum Required Profit for Hedging
input int x121EARestingAfterHedge = 1000; // Resting Seconds After Hedge
input double x121EAMinRequiredProfitPerTrade = 0.5; // Minimum Required Profit for Hedging
input double x121EAMinRequiredProfitPerVolumeFactor = 0.01; // Minimum Required Profit for Hedging Per Volume
//
@@ -436,7 +436,7 @@ void X121PreConfigureStyles(X121SetupInputs &inputs)
//
// XATSL ...
inputs.atslInputs.show = false;
inputs.atslInputs.show = true;
//
// XSLN ...
+14 -13
View File
@@ -181,38 +181,38 @@ struct XMRBInputs
{
//
// Ribbon 1 ...
fast1Length = 20; // Fast
slow1Length = 50; // Slow
fast1Length = 50; // Fast
slow1Length = 100; // Slow
r1AppliedTo = PRICE_HIGH; // AppliedTo
//
// Ribbon 2 ...
fast2Length = 20; // Fast
slow2Length = 50; // Slow
fast2Length = 50; // Fast
slow2Length = 100; // Slow
r2AppliedTo = PRICE_OPEN; // AppliedTo
//
// Ribbon 3 ...
fast3Length = 20; // Fast
slow3Length = 50; // Slow
fast3Length = 50; // Fast
slow3Length = 100; // Slow
r3AppliedTo = PRICE_CLOSE; // AppliedTo
//
// Ribbon 4 ...
fast4Length = 20; // Fast
slow4Length = 50; // Slow
fast4Length = 50; // Fast
slow4Length = 100; // Slow
r4AppliedTo = PRICE_MEDIAN; // AppliedTo
//
// Ribbon 5 ...
fast5Length = 20; // Fast
slow5Length = 50; // Slow
fast5Length = 50; // Fast
slow5Length = 100; // Slow
r5AppliedTo = PRICE_TYPICAL; // AppliedTo
//
// Ribbon 6 ...
fast6Length = 20; // Fast
slow6Length = 50; // Slow
fast6Length = 50; // Fast
slow6Length = 100; // Slow
r6AppliedTo = PRICE_LOW; // AppliedTo
//
@@ -1453,7 +1453,8 @@ private:
{
//
int totalBars = CountBars();
if (totalBars > 1000) {
if (totalBars > 1000)
{
totalBars = 1000;
}