last refactor ...
This commit is contained in:
@@ -100,27 +100,48 @@ input double eaHedgeBEMinProfitPerVolumeStep = 0.1; // Minimum Required Profit F
|
||||
//
|
||||
// Protector > In Profit Positions Protecting ...
|
||||
input group "In Profit Positions Protecting";
|
||||
input bool eaAllowTrailStopInProfits = true; // Allow Trail Stops for In Profit Positions
|
||||
input bool eaOnlyTrailUnprotectedPositions = true; // Only Trail UnProtected Positions
|
||||
input double eaTrailStopStepsInPoint = 10; // Trail Stop Steps in Point
|
||||
input int eaRmoveTPOnTrailStep = 5; // Remove Position TP if Trailed specific times
|
||||
input double eaPartialCloseOnSpecificPointOfProfit = 0; // Partial Close Position on Specific Points of Profit
|
||||
input double eaPartialCloseVolumeInProfit = 0; // Partial Close Volume
|
||||
|
||||
//
|
||||
// Trail ...
|
||||
input group "Trail";
|
||||
input bool eaAllowTrail = true; // Allow Trail Stop for Positions
|
||||
input double eaTrailStartDistance = 35; // Specify Trail Start in Point
|
||||
input double eaTrailStep = 10; // Trail Step in Point
|
||||
input bool eaOnlyTrailUnprotected = true; // Only Trail Unprotected Positionss
|
||||
|
||||
//
|
||||
// Partial Close (In Profit) ...
|
||||
input group "Partial Close";
|
||||
input double eaPartialCloseInProfitDistance = 0; // Specify Partial Close Profit in Point
|
||||
input double eaPartialCloseInProfitVolume = 0; // Specify Partial Close in Profit Volume
|
||||
|
||||
//
|
||||
// Protector > In Drawdown Positions Protecting ...
|
||||
input group "In Drawdown Positions Protecting";
|
||||
input bool eaFreezeInDrawdon = true; // Freeze In Drawdown Position by Lock it
|
||||
input double eaFreezePoint = 100; // Freezing Drawdown Point
|
||||
input double eaFreezeVolume = 2; // Freezing Volume Multiplier
|
||||
input bool eaRemoveFreezedPositionsTPSL = true; // Removes Freezed Positions TP and SL
|
||||
input bool eaAllowRecoverInDrawdowns = false; // Allow Recovery For In Drawdown Positions
|
||||
input double eaRecoveryMultiplier = 1; // Recovery Volume Multiplier
|
||||
input bool eaApplyRecoveryLevelOnVolume = false; // Apply Recovery Level on Volume Calculation
|
||||
input int eaRecoveryDelayInMinute = 1; // Delay Between Two Recovery in Minutes
|
||||
input double eaRecoveryDistanceInPoint = 30; // Distance Between Two Recovery in Point
|
||||
input double eaPartialCloseOnSpecificPointOfDrawdown = 0; // Partial Close Position on Specific Points of Drawdown
|
||||
input double eaPartialCloseVolumeInDrawdown = 0; // Partial Close Volume
|
||||
|
||||
//
|
||||
// Freeze ...
|
||||
input group "Freeze";
|
||||
input bool eaAllowFreeze = false; // Allow Freezing
|
||||
input double eaFreezeDistance = 100; // Specify Freeze Start Drawdown in Point
|
||||
input bool eaRemoveFreezedPositionTPSL = true; // Remove Freezed Positions TPSL
|
||||
input bool eaDisableTrailWhenFreezedPosition = true; // Disable Trail when has Freezed Position
|
||||
|
||||
//
|
||||
// Support ...
|
||||
input group "Support";
|
||||
input bool eaAllowSupport = false; // Allow Support
|
||||
input double eaSupportStartDistance = 0; // Specify Start Support Drawdown in Point
|
||||
input double eaSupportVolumeMultiplier = 1; // Specify Support Volume Multiplier
|
||||
input bool eaMultiplySupportLevelOnVolume = false; // Multiply Support Level on Volume Multiplier
|
||||
input bool eaDoSupportOnConditions = true; // Do Support on Conditions
|
||||
input int eaDelayBetweenTwoSupport = 60; // Delay Between To Support in Second
|
||||
|
||||
//
|
||||
// Partial Close (In Drawdown) ...
|
||||
input group "Partial Close";
|
||||
input double eaPartialCloseInDrawdownDistance = 0; // Specify Partial Close Drawdown in Point
|
||||
input double eaPartialCloseInDrawdownVolume = 0; // Specify Partial Close in Drawdown Volume
|
||||
|
||||
//
|
||||
// Alert ...
|
||||
@@ -483,7 +504,6 @@ bool InitialEA()
|
||||
|
||||
//
|
||||
eaTradeHandler.DelayBarBetweenTwoSameSignal(eaDelayBarBetweenTwoSameSignal);
|
||||
eaTradeHandler.ProtectorStartDistanceInPoint(eaProtectorStartDistanceInPoint);
|
||||
|
||||
//
|
||||
// Configure Hedging ...
|
||||
@@ -495,29 +515,42 @@ bool InitialEA()
|
||||
|
||||
//
|
||||
// In Profit Position Protecting ...
|
||||
eaTradeHandler.AllowTrailStopInProfits(eaAllowTrailStopInProfits);
|
||||
eaTradeHandler.OnlyTrailUnprotectedPositions(eaOnlyTrailUnprotectedPositions);
|
||||
eaTradeHandler.TrailStopStepsInPoint(eaTrailStopStepsInPoint);
|
||||
eaTradeHandler.RmoveTPOnTrailStep(eaRmoveTPOnTrailStep);
|
||||
eaTradeHandler.PartialCloseOnSpecificPointOfProfit(eaPartialCloseOnSpecificPointOfProfit);
|
||||
eaTradeHandler.PartialCloseVolumeInProfit(eaPartialCloseVolumeInProfit);
|
||||
|
||||
//
|
||||
// Protector > In Drawdown Positions Protecting ...
|
||||
eaTradeHandler.FreezeInDrawdon(eaFreezeInDrawdon);
|
||||
eaTradeHandler.FreezePoint(eaFreezePoint);
|
||||
eaTradeHandler.FreezeVolume(eaFreezeVolume);
|
||||
eaTradeHandler.RemoveFreezedPositionsTPSL(eaRemoveFreezedPositionsTPSL);
|
||||
eaTradeHandler.AllowRecoverInDrawdowns(eaAllowRecoverInDrawdowns);
|
||||
eaTradeHandler.RecoveryMultiplier(eaRecoveryMultiplier);
|
||||
eaTradeHandler.ApplyRecoveryLevelOnVolume(eaApplyRecoveryLevelOnVolume);
|
||||
eaTradeHandler.RecoveryDelayInMinute(eaRecoveryDelayInMinute);
|
||||
eaTradeHandler.RecoveryDistanceInPoint(eaRecoveryDistanceInPoint);
|
||||
eaTradeHandler.PartialCloseOnSpecificPointOfDrawdown(eaPartialCloseOnSpecificPointOfDrawdown);
|
||||
eaTradeHandler.PartialCloseVolumeInDrawdown(eaPartialCloseVolumeInDrawdown);
|
||||
// Trail ...
|
||||
eaTradeHandler.AllowTrail(eaAllowTrail);
|
||||
eaTradeHandler.TrailStartDistance(eaTrailStartDistance);
|
||||
eaTradeHandler.TrailStep(eaTrailStep);
|
||||
eaTradeHandler.OnlyTrailUnprotected(eaOnlyTrailUnprotected);
|
||||
|
||||
//
|
||||
// TODO: Implement ...
|
||||
// Partial Close (In Profit) ...
|
||||
eaTradeHandler.PartialCloseInProfitDistance(eaPartialCloseInProfitDistance);
|
||||
eaTradeHandler.PartialCloseInProfitVolume(eaPartialCloseInProfitVolume);
|
||||
|
||||
//
|
||||
// In Drawdown Positions Protecting ...
|
||||
|
||||
//
|
||||
// Freeze ...
|
||||
eaTradeHandler.AllowFreeze(eaAllowFreeze);
|
||||
eaTradeHandler.FreezeDistance(eaFreezeDistance);
|
||||
eaTradeHandler.RemoveFreezedPositionTPSL(eaRemoveFreezedPositionTPSL);
|
||||
eaTradeHandler.DisableTrailWhenFreezedPosition(eaDisableTrailWhenFreezedPosition);
|
||||
|
||||
//
|
||||
// Support ...
|
||||
eaTradeHandler.AllowSupport(eaAllowSupport);
|
||||
eaTradeHandler.SupportStartDistance(eaSupportStartDistance);
|
||||
eaTradeHandler.SupportVolumeMultiplier(eaSupportVolumeMultiplier);
|
||||
eaTradeHandler.MultiplySupportLevelOnVolume(eaMultiplySupportLevelOnVolume);
|
||||
eaTradeHandler.DoSupportOnConditions(eaDoSupportOnConditions);
|
||||
eaTradeHandler.DelayBetweenTwoSupport(eaDelayBetweenTwoSupport);
|
||||
|
||||
//
|
||||
// Partial Close (In Profit) ...
|
||||
eaTradeHandler.PartialCloseInDrawdownDistance(eaPartialCloseInDrawdownDistance);
|
||||
eaTradeHandler.PartialCloseInDrawdownVolume(eaPartialCloseInDrawdownVolume);
|
||||
|
||||
//
|
||||
// Configure Strategies ...
|
||||
@@ -906,6 +939,10 @@ void OnSignalRecieved(
|
||||
{
|
||||
signal.volume = dVolume;
|
||||
}
|
||||
else
|
||||
{
|
||||
signal.volume = eaVolume;
|
||||
}
|
||||
|
||||
//
|
||||
eaTradeHandler.UpdateSignal(signal);
|
||||
|
||||
Reference in New Issue
Block a user