last ...
This commit is contained in:
@@ -65,7 +65,7 @@ input string eaCloseAllTradesAt = ""; // Enable Close All Trades on Signals on T
|
||||
//
|
||||
// Risk Management ...
|
||||
input group "Risk Management";
|
||||
input double eaR2R = 2; // Signallers Risk to Reward Ratio
|
||||
input double eaR2R = 4; // Signallers Risk to Reward Ratio
|
||||
input double eaVolume = 0; // Static Volume
|
||||
input double eaStaticBalance = 1000; // Static Balance
|
||||
input double eaBalancePerTrade = 10; // Balance Used in Each Trade
|
||||
|
||||
@@ -1665,6 +1665,7 @@ struct X121SMCStrategyXSupDemOBSSignalConditions
|
||||
X121SMCStrategyXSupDemOBSSignalConditions mX121SMCXSupDemOBSConditions;
|
||||
X121SMCStrategyXSupDemOBSSignalConditions mX121SMCXSupDemOBSConditionsCollection[];
|
||||
CArrayObj mX121SMCXSupDemOBSObjects;
|
||||
CArrayObj mX121SMCXSupDemOBSWorkingZoneObjects;
|
||||
|
||||
//
|
||||
// Extension Functions ...
|
||||
@@ -2296,6 +2297,14 @@ bool DetectX121SMCXSupDemOBSSignalSetup(
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Re Draw Working Zone ...
|
||||
RemoveX121SMCXSupDemOBSWorkingZoneDraws();
|
||||
DrawX121SMCXSupDemOBSWorkingZone(
|
||||
conditions,
|
||||
visionCycleHelper.mPOIDrawer //
|
||||
);
|
||||
|
||||
//
|
||||
// 3- Checking Price Inside Valid Quarters Based on Trend ...
|
||||
|
||||
@@ -2803,12 +2812,6 @@ bool DetectX121SMCXSupDemOBSSignalSetup(
|
||||
//
|
||||
// Now We Have to Wait for Price Inside Box ...
|
||||
|
||||
//
|
||||
DrawX121SMCXSupDemOBSConditions(
|
||||
conditions,
|
||||
visionCycleHelper.mPOIDrawer //
|
||||
);
|
||||
|
||||
//
|
||||
XCFVG *insideFVG = NULL;
|
||||
XCOrderBlock *insideOB = NULL;
|
||||
@@ -3140,6 +3143,10 @@ bool DetectX121SMCXSupDemOBSSignalSetup(
|
||||
|
||||
//
|
||||
RemoveX121SMCXSupDemOBSDraws();
|
||||
DrawX121SMCXSupDemOBSConditions(
|
||||
conditions,
|
||||
visionCycleHelper.mPOIDrawer //
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -3800,255 +3807,6 @@ void DrawX121SMCXSupDemOBSConditions(
|
||||
//
|
||||
bool isCreated = false;
|
||||
|
||||
//
|
||||
bool hasVisionHighestSupplyZone = conditions.HasVisionHighestSupplyZone();
|
||||
if (hasVisionHighestSupplyZone)
|
||||
{
|
||||
//
|
||||
XCSupplyZoneObject *ivhSupObj;
|
||||
isCreated = drawer.CreateSupplyZone(
|
||||
conditions.visionHighestSupplyZone,
|
||||
ivhSupObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
mX121SMCXSupDemOBSObjects.Add(ivhSupObj);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
bool hasConsolidationHighestSupplyZone = conditions.HasConsolidationHighestSupplyZone();
|
||||
if (hasConsolidationHighestSupplyZone)
|
||||
{
|
||||
//
|
||||
XCSupplyZoneObject *ichSupObj;
|
||||
isCreated = drawer.CreateSupplyZone(
|
||||
conditions.consolidationHighestSupplyZone,
|
||||
ichSupObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
mX121SMCXSupDemOBSObjects.Add(ichSupObj);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
bool hasVisionLowestDemandZone = conditions.HasVisionLowestDemandZone();
|
||||
if (hasVisionLowestDemandZone)
|
||||
{
|
||||
//
|
||||
XCDemandZoneObject *ivlSupObj;
|
||||
isCreated = drawer.CreateDemandZone(
|
||||
conditions.visionLowestDemandZone,
|
||||
ivlSupObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
mX121SMCXSupDemOBSObjects.Add(ivlSupObj);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
bool hasConsolidationLowestDemandZone = conditions.HasConsolidationLowestDemandZone();
|
||||
if (hasConsolidationLowestDemandZone)
|
||||
{
|
||||
//
|
||||
XCDemandZoneObject *iclSupObj;
|
||||
isCreated = drawer.CreateDemandZone(
|
||||
conditions.consolidationLowestDemandZone,
|
||||
iclSupObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
mX121SMCXSupDemOBSObjects.Add(iclSupObj);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
bool hasWorkingZone = conditions.workingZone.IsValid();
|
||||
if (hasWorkingZone)
|
||||
{
|
||||
//
|
||||
string zonePrefix = "X121_WZ_" + conditions.workingZone.symbol + "_" + ToString(conditions.workingZone.period);
|
||||
string fromStr = ToFormatString(conditions.workingZone.from);
|
||||
string fromMD5 = ToMD5(fromStr);
|
||||
|
||||
//
|
||||
string upperName = zonePrefix + "_Upper_" + fromMD5;
|
||||
string lowerName = zonePrefix + "_Lower_" + fromMD5;
|
||||
string zoneUpperName = zonePrefix + "_ZoneUpper_" + fromMD5;
|
||||
string zoneLowerName = zonePrefix + "_ZoneLower_" + fromMD5;
|
||||
|
||||
//
|
||||
string q1Name = zonePrefix + "_Q1_" + fromMD5;
|
||||
string q2Name = zonePrefix + "_Q2_" + fromMD5;
|
||||
string q3Name = zonePrefix + "_Q3_" + fromMD5;
|
||||
|
||||
//
|
||||
ulong chartID = drawer.ChartIdentification();
|
||||
int subWindow = drawer.SubWindowIdentification();
|
||||
|
||||
//
|
||||
bool isCreated = false;
|
||||
|
||||
//
|
||||
// Lower ...
|
||||
CChartObjectHLine *lowerHLine;
|
||||
lowerHLine = new CChartObjectHLine();
|
||||
isCreated = lowerHLine.Create(
|
||||
chartID,
|
||||
lowerName,
|
||||
subWindow,
|
||||
conditions.workingZone.lower //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
lowerHLine.Color(clrLime);
|
||||
mX121SMCXSupDemOBSObjects.Add(lowerHLine);
|
||||
}
|
||||
|
||||
//
|
||||
CChartObjectHLine *upperHLine;
|
||||
upperHLine = new CChartObjectHLine();
|
||||
isCreated = upperHLine.Create(
|
||||
chartID,
|
||||
upperName,
|
||||
subWindow,
|
||||
conditions.workingZone.upper //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
upperHLine.Color(clrLime);
|
||||
mX121SMCXSupDemOBSObjects.Add(upperHLine);
|
||||
}
|
||||
|
||||
//
|
||||
CChartObjectHLine *zoneLowerHLine;
|
||||
zoneLowerHLine = new CChartObjectHLine();
|
||||
isCreated = zoneLowerHLine.Create(
|
||||
chartID,
|
||||
zoneLowerName,
|
||||
subWindow,
|
||||
conditions.workingZone.zoneLower //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
zoneLowerHLine.Color(clrRed);
|
||||
mX121SMCXSupDemOBSObjects.Add(zoneLowerHLine);
|
||||
}
|
||||
|
||||
//
|
||||
CChartObjectHLine *zoneUpperHLine;
|
||||
zoneUpperHLine = new CChartObjectHLine();
|
||||
isCreated = zoneUpperHLine.Create(
|
||||
chartID,
|
||||
zoneUpperName,
|
||||
subWindow,
|
||||
conditions.workingZone.zoneUpper //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
zoneUpperHLine.Color(clrRed);
|
||||
mX121SMCXSupDemOBSObjects.Add(zoneUpperHLine);
|
||||
}
|
||||
|
||||
//
|
||||
CChartObjectHLine *quarter1HLine;
|
||||
quarter1HLine = new CChartObjectHLine();
|
||||
isCreated = quarter1HLine.Create(
|
||||
chartID,
|
||||
q1Name,
|
||||
subWindow,
|
||||
conditions.workingZone.quarter1 //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
quarter1HLine.Color(clrYellow);
|
||||
mX121SMCXSupDemOBSObjects.Add(quarter1HLine);
|
||||
}
|
||||
|
||||
//
|
||||
CChartObjectHLine *quarter2HLine;
|
||||
quarter2HLine = new CChartObjectHLine();
|
||||
isCreated = quarter2HLine.Create(
|
||||
chartID,
|
||||
q2Name,
|
||||
subWindow,
|
||||
conditions.workingZone.quarter2 //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
quarter2HLine.Color(clrYellow);
|
||||
mX121SMCXSupDemOBSObjects.Add(quarter2HLine);
|
||||
}
|
||||
|
||||
//
|
||||
CChartObjectHLine *quarter3HLine;
|
||||
quarter3HLine = new CChartObjectHLine();
|
||||
isCreated = quarter3HLine.Create(
|
||||
chartID,
|
||||
q3Name,
|
||||
subWindow,
|
||||
conditions.workingZone.quarter3 //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
quarter3HLine.Color(clrYellow);
|
||||
mX121SMCXSupDemOBSObjects.Add(quarter3HLine);
|
||||
}
|
||||
|
||||
// //
|
||||
// XCTicksZone *tZone;
|
||||
// tZone = new XCTicksZone();
|
||||
|
||||
// //
|
||||
// XOHCL fromBar;
|
||||
// bool isInitedFrom = fromBar.Init(
|
||||
// conditions.workingZone.symbol,
|
||||
// conditions.workingZone.period,
|
||||
// conditions.workingZone.from //
|
||||
// );
|
||||
|
||||
// //
|
||||
// XOHCL toBar;
|
||||
// bool isInitedTo = toBar.Init(
|
||||
// conditions.workingZone.symbol,
|
||||
// conditions.workingZone.period,
|
||||
// 1 //
|
||||
// );
|
||||
|
||||
// //
|
||||
// if (isInitedTo &&
|
||||
// isInitedFrom)
|
||||
// {
|
||||
// //
|
||||
// bool isZoneInited = tZone.Init(
|
||||
// fromBar,
|
||||
// toBar //
|
||||
// );
|
||||
// if (isZoneInited)
|
||||
// {
|
||||
// //
|
||||
// XCTicksZoneObject *tZoneObj;
|
||||
// bool isCreated = drawer.CreateTicksZone(
|
||||
// tZone,
|
||||
// tZoneObj //
|
||||
// );
|
||||
// if (isCreated)
|
||||
// {
|
||||
// mX121SMCXSupDemOBSObjects.Add(tZoneObj);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
//
|
||||
int obFVGsCount = ArraySize(conditions.obFVGs);
|
||||
bool hasOBFVGs = IsValidSize(obFVGsCount);
|
||||
@@ -4229,4 +3987,235 @@ void DrawX121SMCXSupDemOBSConditions(
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
void RemoveX121SMCXSupDemOBSWorkingZoneDraws()
|
||||
{
|
||||
mX121SMCXSupDemOBSWorkingZoneObjects.Clear();
|
||||
}
|
||||
|
||||
//
|
||||
void DrawX121SMCXSupDemOBSWorkingZone(
|
||||
X121SMCStrategyXSupDemOBSSignalConditions &conditions,
|
||||
XCPOIDrawer *drawer //
|
||||
)
|
||||
{
|
||||
//
|
||||
if (drawer == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
bool isCreated = false;
|
||||
|
||||
//
|
||||
bool hasVisionHighestSupplyZone = conditions.HasVisionHighestSupplyZone();
|
||||
if (hasVisionHighestSupplyZone)
|
||||
{
|
||||
//
|
||||
XCSupplyZoneObject *ivhSupObj;
|
||||
isCreated = drawer.CreateSupplyZone(
|
||||
conditions.visionHighestSupplyZone,
|
||||
ivhSupObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
mX121SMCXSupDemOBSWorkingZoneObjects.Add(ivhSupObj);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
bool hasConsolidationHighestSupplyZone = conditions.HasConsolidationHighestSupplyZone();
|
||||
if (hasConsolidationHighestSupplyZone)
|
||||
{
|
||||
//
|
||||
XCSupplyZoneObject *ichSupObj;
|
||||
isCreated = drawer.CreateSupplyZone(
|
||||
conditions.consolidationHighestSupplyZone,
|
||||
ichSupObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
mX121SMCXSupDemOBSWorkingZoneObjects.Add(ichSupObj);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
bool hasVisionLowestDemandZone = conditions.HasVisionLowestDemandZone();
|
||||
if (hasVisionLowestDemandZone)
|
||||
{
|
||||
//
|
||||
XCDemandZoneObject *ivlSupObj;
|
||||
isCreated = drawer.CreateDemandZone(
|
||||
conditions.visionLowestDemandZone,
|
||||
ivlSupObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
mX121SMCXSupDemOBSWorkingZoneObjects.Add(ivlSupObj);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
bool hasConsolidationLowestDemandZone = conditions.HasConsolidationLowestDemandZone();
|
||||
if (hasConsolidationLowestDemandZone)
|
||||
{
|
||||
//
|
||||
XCDemandZoneObject *iclSupObj;
|
||||
isCreated = drawer.CreateDemandZone(
|
||||
conditions.consolidationLowestDemandZone,
|
||||
iclSupObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
mX121SMCXSupDemOBSWorkingZoneObjects.Add(iclSupObj);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
bool hasWorkingZone = conditions.workingZone.IsValid();
|
||||
if (hasWorkingZone)
|
||||
{
|
||||
//
|
||||
string zonePrefix = "X121_WZ_" + conditions.workingZone.symbol + "_" + ToString(conditions.workingZone.period);
|
||||
string fromStr = ToFormatString(conditions.workingZone.from);
|
||||
string fromMD5 = ToMD5(fromStr);
|
||||
|
||||
//
|
||||
string upperName = zonePrefix + "_Upper_" + fromMD5;
|
||||
string lowerName = zonePrefix + "_Lower_" + fromMD5;
|
||||
string zoneUpperName = zonePrefix + "_ZoneUpper_" + fromMD5;
|
||||
string zoneLowerName = zonePrefix + "_ZoneLower_" + fromMD5;
|
||||
|
||||
//
|
||||
string q1Name = zonePrefix + "_Q1_" + fromMD5;
|
||||
string q2Name = zonePrefix + "_Q2_" + fromMD5;
|
||||
string q3Name = zonePrefix + "_Q3_" + fromMD5;
|
||||
|
||||
//
|
||||
ulong chartID = drawer.ChartIdentification();
|
||||
int subWindow = drawer.SubWindowIdentification();
|
||||
|
||||
//
|
||||
bool isCreated = false;
|
||||
|
||||
//
|
||||
// Lower ...
|
||||
CChartObjectHLine *lowerHLine;
|
||||
lowerHLine = new CChartObjectHLine();
|
||||
isCreated = lowerHLine.Create(
|
||||
chartID,
|
||||
lowerName,
|
||||
subWindow,
|
||||
conditions.workingZone.lower //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
lowerHLine.Color(clrLime);
|
||||
mX121SMCXSupDemOBSWorkingZoneObjects.Add(lowerHLine);
|
||||
}
|
||||
|
||||
//
|
||||
CChartObjectHLine *upperHLine;
|
||||
upperHLine = new CChartObjectHLine();
|
||||
isCreated = upperHLine.Create(
|
||||
chartID,
|
||||
upperName,
|
||||
subWindow,
|
||||
conditions.workingZone.upper //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
upperHLine.Color(clrLime);
|
||||
mX121SMCXSupDemOBSWorkingZoneObjects.Add(upperHLine);
|
||||
}
|
||||
|
||||
//
|
||||
CChartObjectHLine *zoneLowerHLine;
|
||||
zoneLowerHLine = new CChartObjectHLine();
|
||||
isCreated = zoneLowerHLine.Create(
|
||||
chartID,
|
||||
zoneLowerName,
|
||||
subWindow,
|
||||
conditions.workingZone.zoneLower //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
zoneLowerHLine.Color(clrRed);
|
||||
mX121SMCXSupDemOBSWorkingZoneObjects.Add(zoneLowerHLine);
|
||||
}
|
||||
|
||||
//
|
||||
CChartObjectHLine *zoneUpperHLine;
|
||||
zoneUpperHLine = new CChartObjectHLine();
|
||||
isCreated = zoneUpperHLine.Create(
|
||||
chartID,
|
||||
zoneUpperName,
|
||||
subWindow,
|
||||
conditions.workingZone.zoneUpper //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
zoneUpperHLine.Color(clrRed);
|
||||
mX121SMCXSupDemOBSWorkingZoneObjects.Add(zoneUpperHLine);
|
||||
}
|
||||
|
||||
//
|
||||
CChartObjectHLine *quarter1HLine;
|
||||
quarter1HLine = new CChartObjectHLine();
|
||||
isCreated = quarter1HLine.Create(
|
||||
chartID,
|
||||
q1Name,
|
||||
subWindow,
|
||||
conditions.workingZone.quarter1 //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
quarter1HLine.Color(clrYellow);
|
||||
mX121SMCXSupDemOBSWorkingZoneObjects.Add(quarter1HLine);
|
||||
}
|
||||
|
||||
//
|
||||
CChartObjectHLine *quarter2HLine;
|
||||
quarter2HLine = new CChartObjectHLine();
|
||||
isCreated = quarter2HLine.Create(
|
||||
chartID,
|
||||
q2Name,
|
||||
subWindow,
|
||||
conditions.workingZone.quarter2 //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
quarter2HLine.Color(clrYellow);
|
||||
mX121SMCXSupDemOBSWorkingZoneObjects.Add(quarter2HLine);
|
||||
}
|
||||
|
||||
//
|
||||
CChartObjectHLine *quarter3HLine;
|
||||
quarter3HLine = new CChartObjectHLine();
|
||||
isCreated = quarter3HLine.Create(
|
||||
chartID,
|
||||
q3Name,
|
||||
subWindow,
|
||||
conditions.workingZone.quarter3 //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
quarter3HLine.Color(clrYellow);
|
||||
mX121SMCXSupDemOBSWorkingZoneObjects.Add(quarter3HLine);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
@@ -122,6 +122,10 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
delete mVerificationCycleHelper;
|
||||
delete mConsolidationCycleHelper;
|
||||
delete mVisionCycleHelper;
|
||||
|
||||
//
|
||||
RemoveX121SMCXSupDemOBSDraws();
|
||||
RemoveX121SMCXSupDemOBSWorkingZoneDraws();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -343,6 +347,31 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
// XCSignalObject *iObj;
|
||||
// mPOIDrawer.DrawSignal(signal, iObj);
|
||||
// Print("");
|
||||
|
||||
//
|
||||
if (useXSupDemOBSSignal &&
|
||||
hasXSupDemOBSSignal)
|
||||
{
|
||||
//
|
||||
// double sR2R = signal.GetRiskRewardRatio();
|
||||
// double risk = signal.GetRisk();
|
||||
|
||||
//
|
||||
// double tp = signal.tp;
|
||||
// double target = signal.tp + (risk * sR2R);
|
||||
|
||||
//
|
||||
// signal.tp = target;
|
||||
// signal.target = tp;
|
||||
|
||||
//
|
||||
signal.trailSL = true;
|
||||
signal.fullTPLevel = r2r;
|
||||
signal.partialCloseOnTPLevel = 0;
|
||||
signal.partialCloseMultiplier = 0;
|
||||
signal.trailSLStartOnReachTPLevel = 3;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -862,9 +891,6 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
1 //
|
||||
);
|
||||
|
||||
//
|
||||
RemoveX121SMCXSupDemOBSDraws();
|
||||
|
||||
//
|
||||
// Check Signal Direction ...
|
||||
isBullish = IsBullish(mConditions.dir);
|
||||
|
||||
Reference in New Issue
Block a user