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