This commit is contained in:
2025-04-13 22:16:17 +03:30
parent 1d91d3be1b
commit ab6ddf0b43
6 changed files with 1768 additions and 55 deletions
+103 -13
View File
@@ -37,8 +37,6 @@ class XCXSTRCCISignaller : XCBase
//
// Props ...
bool useGuards;
double rfReward;
bool isPassedBoxes;
XSTRCCIInputs inputs;
XBarTracker barTraker;
XCXSTRCCIHelper *helper;
@@ -123,10 +121,6 @@ class XCXSTRCCISignaller : XCBase
datetime cTime = TimeCurrent();
double points = GetPoints(symbol);
//
mConditions.symbol = symbol;
mConditions.period = period;
//
XOHCL zBar;
XOHCL cBar;
@@ -160,11 +154,6 @@ class XCXSTRCCISignaller : XCBase
//
// Setup Conditions ...
double sls[];
double sl = 0;
double pivot = 0;
double point = 0;
double targets[];
XBoxZone signalBox;
bool hasSignalBox = false;
ENUM_X_DIRECTION signalBoxDir = X_DIRECTION_NONE;
@@ -173,7 +162,9 @@ class XCXSTRCCISignaller : XCBase
// Checking Conditions ...
//
XSTRCCIConditions conditions;
hasSignalBox = DetectXSTRCCIConditions(
conditions,
signalBox,
signalBoxDir,
helper,
@@ -197,6 +188,103 @@ class XCXSTRCCISignaller : XCBase
//
// Do What we Want ...
barTraker.Waits();
//
// Draw Signal Box ...
XCBoxObject *iObj;
bool isCreated = helper.poiDrawer.DrawBox(
signalBox,
iObj //
);
if (isCreated)
{
//
mObjects.Add(iObj);
ZeroMemory(iObj);
//
Print("Signal Box ...");
}
//
// Prepare Conditions ...
mConditions.symbol = symbol;
mConditions.period = period;
//
double spread = GetSpread(symbol);
//
double entry =
isBullish
? signalBox.upper
: signalBox.lower;
//
double sl =
isBullish
? signalBox.lower
: signalBox.upper;
//
double risk =
isBullish
? entry - sl
: sl - entry;
risk += spread;
//
double rewardTP = risk * tpReward;
//
double tp =
isBullish
? entry + rewardTP
: entry - rewardTP;
//
// Filling ...
mConditions.sl = sl;
mConditions.tp = tp;
mConditions.pivot =
isBullish
? sl
: entry;
mConditions.point =
isBullish
? entry
: sl;
mConditions.dir = signalBoxDir;
mConditions.provider = "XSTRCCI";
mConditions.signalBox = signalBox;
mConditions.setupTime = zBar.time;
mConditions.conditions = conditions;
//
// Select RF Rewards ...
if (continuesRFTillTarget)
{
//
double rfReward = 1;
while (rfReward < tpReward)
{
//
double rewardRF = risk * rfReward;
double rfTP =
isBullish
? entry + rewardRF
: entry - rewardRF;
//
Add(
rfTP,
mConditions.targets //
);
//
rfReward++;
}
}
}
//
@@ -208,6 +296,10 @@ class XCXSTRCCISignaller : XCBase
pBar.Clean();
pPBar.Clean();
//
signalBox.Clean();
conditions.Clean();
//
return result;
}
@@ -410,9 +502,7 @@ class XCXSTRCCISignaller : XCBase
void Init()
{
//
rfReward = 2;
useGuards = false;
isPassedBoxes = false;
continuesRFTillTarget = true;
//