backup and do some cleanup strategies ...

This commit is contained in:
2024-07-23 10:04:06 +03:30
parent 5529e12b25
commit 23d25e3e58
8 changed files with 37 additions and 12 deletions
+14
View File
@@ -4100,6 +4100,12 @@ public:
mSaveTrades = value;
}
//
int MaxSameTimeTrades()
{
return maxSameTimeTrades;
}
//
// Trailling ...
@@ -4424,6 +4430,13 @@ public:
mData[idx].Update(iPosition);
}
}
//
count = Count();
if (count > maxSameTimeTrades)
{
maxSameTimeTrades = count;
}
}
//
@@ -4727,6 +4740,7 @@ protected:
private:
//
// Props ...
int maxSameTimeTrades; // Max Same Time Trades
//
// Count Data ...
+19 -8
View File
@@ -126,6 +126,10 @@ void OnDeinit(const int reason)
// REASON_INITFAILED 8 The OnInit() handler returned a non-zero value
// REASON_CLOSE 9 Terminal closed
//
string msg = "MaxSameTimeTrades: " + ToString(eaTradeHandler.MaxSameTimeTrades());
eaAlert.Alert(msg);
//
// De Initialize XSampleEA Providers ...
delete mCTHelper;
@@ -234,16 +238,23 @@ bool InitialEA()
eaTrader.AddOnForceClosePositionEventHandler(OnPositionForceClosed);
//
// Initialize Trade Handler ...
eaTradeHandler = new XSCXTradeHandler(eaTrader);
eaTradeHandler.SetAlertPrefix(ShortName + "> TradeHandler");
eaTradeHandler.SaveTrades(true);
eaTradeHandler.SaveSignals(true);
//
// Configure Hedging ...
eaTradeHandler.AllowHedging(true);
eaTradeHandler.HedgeVolumeFactor(eaVolume);
eaTradeHandler.HedgeMinProfitPerVolumeFactor(0.2);
//
// Configure Trailing ...
eaTradeHandler.AllowTrailStops(false);
eaTradeHandler.TrailStepInPoint(10);
eaTradeHandler.TrailStartInPoint(30);
eaTradeHandler.TrailStepInPoint(15);
eaTradeHandler.TrailStartInPoint(60);
eaTradeHandler.IgnoreTPOnTrail(true);
eaTradeHandler.TrailBasedOnProfit(true);
@@ -284,18 +295,18 @@ bool InitialEA()
XSCXTestStrategy *eurusdTestStrategy;
eurusdTestStrategy = new XSCXTestStrategy(
eurusdSymbol,
PERIOD_M5,
PERIOD_M15,
eaVolume,
eaR2R, // R2R ...
eaSlippage,
magicNumber,
true, // Ignore Signal Execution
true, // Use TP SL Point
false, // Use Max
50, // eaTPPoint, // TP
true, // Ignore Signal Execution
true, // Use TP SL Point
false, // Use Max
eaTPPoint, // TP
eaSLPoint, // SL
eaIgnoreTP,
true, // eaIgnoreSL,
eaIgnoreSL,
eaAllowLong,
eaAllowShort,
eaMaxAllowedLongs, // Max Longs
+4 -4
View File
@@ -588,8 +588,8 @@ public:
//
hasLong =
//
isBullishTrend &&
cBar.IsBullish() &&
// isBullishTrend &&
// cBar.IsBullish() &&
hasBullishPattern &&
hkConditions.isSMHKBullish &&
chmaConditions.isFastOverSlow
@@ -641,8 +641,8 @@ public:
//
hasShort =
//
isBearishTrend &&
cBar.IsBearish() &&
// isBearishTrend &&
// cBar.IsBearish() &&
hasBearishPattern &&
hkConditions.isSMHKBearish &&
chmaConditions.isFastUnderSlow