last preparation ...

This commit is contained in:
2024-12-13 05:47:05 +03:30
parent 9a4281b99e
commit fe54432fa2
9 changed files with 104 additions and 13 deletions
+2 -2
View File
@@ -49,8 +49,8 @@ input bool eaUseDynamicVolume = false; // Use Dynamic Volume
input double eaDynamicVolumeStep = 0.01; // Increase Volume Step
input double eaDynamicVolumeBalanceFactor = 200; // Balance Factor for Generate Dynamic Volume
input double eaVolume = 0.05; // Static Volume
input bool eaDynamicRiskManagement = true; // Dynamic Risk Management
input double eaRiskPercentPerBalance = 0.5; // Risk Percent Per Balance on Each Trade
input bool eaDynamicRiskManagement = false; // Dynamic Risk Management
input double eaRiskPercentPerBalance = 0; // Risk Percent Per Balance on Each Trade
//
// Signalling ...
+8 -4
View File
@@ -1192,10 +1192,14 @@ void CalculateBuffers(
);
//
CalculateValidPeaksAndVales(
bar_index,
prevCalculated //
);
// if (bar_index <= barsLimit + 576)
// {
// //
// CalculateValidPeaksAndVales(
// bar_index,
// prevCalculated //
// );
// }
//
CalculateFibonacci(
+42
View File
@@ -7722,6 +7722,27 @@ double GetEntry(
//
return result;
}
double GetEntry(
string mSymbol = NULL, // Trading Symbol
ENUM_X_DIRECTION type = X_DIRECTION_BULLISH // Get entry price for Which direction trade ...
)
{
//
double result = 0;
//
mSymbol = NormalizeSymbol(mSymbol);
//
result =
IsBullish(type)
? GetAsk(mSymbol)
: GetBid(mSymbol);
result = NormalizePrice(result, mSymbol);
//
return result;
}
//
// Retrieve Exit Price ...
@@ -7746,6 +7767,27 @@ double GetExit(
//
return result;
}
double GetExit(
string mSymbol = NULL, // Trading Symbol
ENUM_X_DIRECTION type = X_DIRECTION_BULLISH // Get entry price for Which direction trade ...
)
{
//
double result = 0;
//
mSymbol = NormalizeSymbol(mSymbol);
//
result =
IsBullish(type)
? GetBid(mSymbol)
: GetAsk(mSymbol);
result = NormalizePrice(result, mSymbol);
//
return result;
}
//
// Get 1 Pip in Price Value ...
@@ -242,12 +242,12 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
//
result = PrepareSignal(signal);
if (result)
{
//
// Print("PRV: ", provider);
// DrawSignal(signal);
}
// if (result)
// {
// //
// // Print("PRV: ", provider);
// // DrawSignal(signal);
// }
//
hasLong = false;
@@ -678,11 +678,56 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
//
// Selectiong SL ...
selectedSL = SelectSL(
double selectedSLRJ = SelectSL(
conditions,
conditions.signalDir,
X_121_SMC_SL_TYPE_REJECTION //
);
double selectedSLMN = SelectSL(
conditions,
conditions.signalDir,
X_121_SMC_SL_TYPE_MOMENTUM //
);
double selectedSLSW = SelectSL(
conditions,
conditions.signalDir,
X_121_SMC_SL_TYPE_SWING //
);
double selectedSLSR = SelectSL(
conditions,
conditions.signalDir,
X_121_SMC_SL_TYPE_CURRENT_SAR //
);
//
double slCandidates[4] = {
selectedSLRJ,
selectedSLMN,
selectedSLSW,
selectedSLSR //
};
selectedSL = isBullish
? GetMin(slCandidates)
: GetMax(slCandidates);
//
// Normalizing SL ...
double entry = GetEntry(
symbol,
conditions.signalDir //
);
double spread = GetSpread(symbol);
double pip = GetPipPrice(symbol);
//
if (isBullish && selectedSL <= entry)
{
selectedSL -= (pip * 3) - spread;
}
else if (isBearish && selectedSL >= entry)
{
selectedSL += pip * 3 + spread;
}
//
// Detect SL and TP ...