last changes on XEU5 and apply fix on ticks handling ...

This commit is contained in:
2024-01-31 16:13:07 -08:00
parent 732b6bba35
commit a098550391
41 changed files with 51912 additions and 40 deletions
@@ -85,10 +85,21 @@ input bool xEU5XCHMAMNAllowLongSignals = true; // Enable Long Signals
input bool xEU5XCHMAMNAllowShortSignals = true; // Enable Short Signals
//
bool xEU5IsTestMode = true;
// Check in Test Mode or not ...
bool xEU5IsTestMode = false;
//
// Detect max Input Length of Indicators ...
int xEU5MaxLengthOfInputs = 0;
//
// Detect Calculated Bars ...
int xEU5CalculatedBars = 0;
//
// Check prevent Double Signalling on Same Candle ...
bool waitUntilNextCandle = false;
//
// Signaller Variables ...
//
@@ -297,7 +308,7 @@ bool XEU5InitIndicators()
//
// Make it Enable when we need to Log Market Conditions ...
// xEU5IsTestMode = false; // IsRunningOnTestMode();
xEU5IsTestMode = IsRunningOnTestMode();
//
// Check and Calculate Max Length in Inputs ...
@@ -865,7 +876,7 @@ bool XEU5HasLongSignal(
{
//
// Only Log Signals Time Market Conditions if is in Testing Mode ...
if (xEU5IsTestMode)
if (xEU5IsTestMode || xEU5EnableSignalAlerts)
{
//
XMarketConditions mConditions = xEU5Provider.GetLastMarketCondition();
@@ -1021,7 +1032,7 @@ bool XEU5HasShortSignal(
{
//
// Only Log Signals Time Market Conditions if is in Testing Mode ...
if (xEU5IsTestMode)
if (xEU5IsTestMode || xEU5EnableSignalAlerts)
{
//
XMarketConditions mConditions = xEU5Provider.GetLastMarketCondition();
@@ -38,14 +38,14 @@ input int xEU5NumberOfItemsPerTick = 30; // Number Of items Readed In Each Tick
// Alerts ...
input bool xEU5EnableAlerts = true; // Enable Events Alert
input bool xEU5EnableHourlyAlerts = false; // Send Alert on each new Hour
input bool xEU5EnableDailyAlerts = false; // Send Alert on each new Day
input bool xEU5EnableWeeklyAlerts = false; // Send Alert on each new Week
input bool xEU5EnableDailyAlerts = true; // Send Alert on each new Day
input bool xEU5EnableWeeklyAlerts = true; // Send Alert on each new Week
input bool xEU5EnableMonthlyAlerts = true; // Send Alert on each new Month
//
// Reports ...
input bool xEU5EnableDailyReports = false; // Send Report on each new Day
input bool xEU5EnableWeeklyReports = false; // Send Report on each new Week
input bool xEU5EnableMonthlyReports = true; // Send Report on each new Month
input bool xEU5EnableMonthlyReports = false; // Send Report on each new Month
//
// Trader and Expert Specific Configurations ...
@@ -63,18 +63,16 @@ input bool xEU5AllowShortTrades = true; // Allow Short Trades
// Risk Management Configurations ...
input group "XEU5 Risk Management";
//
input bool xEU5UseVirtualTPSl = false; // Use Virtual TP SL
//
// Trade Count ...
input int xEU5MaxAllowedTrades = 10; // Max Allowed Trades at Same Time
input ENUM_X_CROSS_SIGNAL_METHOD xEU5CrossSignalsMethod = X_CROSS_SIGNAL_REGULAR; // Handle Cross Signals Method
//
// Max Allowed Trade Age ...
input int xEU5MaxAllowedTradeAge = 1500; // Detect Long Time Trades
input int xEU5MaxAllowedTradeAge = 1800; // Detect Long Time Trades
input ENUM_X_GUARD_ACTIONS xEU5OldTradesAction = X_GUARD_PARTIAL_CLOSE_MAX_IN_DD_1; // What to do with Old Trades
//
// Trade Volume Specific Configurations ...
input double xEU5StaticVolumeFactor = 0.0002; // Static Volume baesd on Balance
input double xEU5StaticVolumeFactor = 0.0004; // Static Volume baesd on Balance
input ENUM_STATIC_VOLUME_METHODS xEU5StaticVolumeMethod = X_STATIC_VOLUME_BASED_ON_BALANCE; // How to Calculate Static Volume
input double xEU5VolumeMultiplier = 0; // Volume Increase Multiplier
input double xEU5ApplyVolumeMultiplierFactor = 0; // Apply Volume Multiplier Rate based on Balance
@@ -87,17 +85,22 @@ input double xEU5RiskFreeStepInPips = 6; // Make Trades Risk Free Steps in Pips
input double xEU5RiskFreeRate = 0.6; // Volume Multiplier for Risk Free Trades
//
// Guard Riskable Money and Profits ...
input double xEU5CriticalDrawDownFactor = 0.40; // Critical Allowed Drawdown Factor based on Balance
input ENUM_X_GUARD_ACTIONS xEU5CriticalGuardAction = X_GUARD_PARTIAL_CLOSE_MAX_IN_DD_5; // Specify Guard Action on Critical Drawdown
input double xEU5MaxAllowedDrawDownFactor = 0.45; // Max Allowed Drawdown Factor based on Balance
input ENUM_X_GUARD_ACTIONS xEU5MaxAllowedGuardAction = X_GUARD_PARTIAL_CLOSE_MAX_IN_DD_10; // Specify Guard Action on Max Allowed Drawdown
input int xEU5GuardStopoutFiredAfterTouches = 5; // Guard Stopout all Trades if Max Allowed Drawdown touched
input double xEU5CriticalDrawDownFactor = 0.30; // Critical Allowed Drawdown Factor based on Balance
input ENUM_X_GUARD_ACTIONS xEU5CriticalGuardAction = X_GUARD_PARTIAL_CLOSE_MAX_IN_DD_1; // Specify Guard Action on Critical Drawdown
input double xEU5MaxAllowedDrawDownFactor = 0.40; // Max Allowed Drawdown Factor based on Balance
input ENUM_X_GUARD_ACTIONS xEU5MaxAllowedGuardAction = X_GUARD_PARTIAL_CLOSE_MAX_IN_DD_5; // Specify Guard Action on Max Allowed Drawdown
input int xEU5GuardStopoutFiredAfterTouches = 5; // Guard Stopout all Trades if Max Allowed Drawdown touched
//
// Account Conditions for Trading ...
input double xEU5BalanceFactorForOpenTrades = 0.5; // Minimum Balance for Open Trades
input double xEU5FreeMarginFactorForOpenTrades = 0.8; // Minimum Free Margin for Open Trades
//
// May be Used Later as Input Params ...
bool xEU5UseVirtualTPSl = false; // Use Virtual TP SL
bool xEU5EnableSignalAlerts = false; // Send Signal Alert
//
// Validate Inputs before Initialization ...
bool XEU5ValidateInputs()
@@ -513,6 +513,9 @@ void XEU5HandleOpenTrades()
// Update Reports ...
XEU5UpdateReports();
//
waitUntilNextCandle = true;
//
// Open Long Trades ...
if (