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
@@ -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 ...