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