last preparation ...
This commit is contained in:
@@ -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 ...
|
||||
|
||||
Reference in New Issue
Block a user