495 lines
14 KiB
Plaintext
495 lines
14 KiB
Plaintext
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
// Draw ...
|
|
//
|
|
|
|
//
|
|
XCBaseObject *drawnObjects[];
|
|
|
|
//
|
|
if (hasBullishOBs)
|
|
{
|
|
//
|
|
for (int i = 0; i < bullishOBsCount; i++)
|
|
{
|
|
//
|
|
XCOrderBlock *iOb = conditions.bullishOBs[i];
|
|
|
|
//
|
|
XCBullishOrderBlockObject *iObObj;
|
|
bool isCreated = visionCycleHelper
|
|
.mPOIDrawer
|
|
.CreateBullishOrderBlock(
|
|
iOb,
|
|
iObObj //
|
|
);
|
|
if (isCreated)
|
|
{
|
|
//
|
|
Add(
|
|
(XCBaseObject *)iObObj,
|
|
drawnObjects //
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
//
|
|
if (hasBearishOBs)
|
|
{
|
|
//
|
|
for (int i = 0; i < bearishOBsCount; i++)
|
|
{
|
|
//
|
|
XCOrderBlock *iOb = conditions.bearishOBs[i];
|
|
|
|
//
|
|
XCBearishOrderBlockObject *iObObj;
|
|
bool isCreated = visionCycleHelper
|
|
.mPOIDrawer
|
|
.CreateBearishOrderBlock(
|
|
iOb,
|
|
iObObj //
|
|
);
|
|
if (isCreated)
|
|
{
|
|
//
|
|
Add(
|
|
(XCBaseObject *)iObObj,
|
|
drawnObjects //
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
//
|
|
if (hasBullishFVGs)
|
|
{
|
|
//
|
|
for (int i = 0; i < bullishFVGsCount; i++)
|
|
{
|
|
//
|
|
XCFVG *iFVG = conditions.bullishFVGs[i];
|
|
|
|
//
|
|
XCBullishFairValueGapObject *iFVGObj;
|
|
bool isCreated = visionCycleHelper
|
|
.mPOIDrawer
|
|
.CreateBullishFairValueGap(
|
|
iFVG,
|
|
iFVGObj //
|
|
);
|
|
if (isCreated)
|
|
{
|
|
//
|
|
Add(
|
|
(XCBaseObject *)iFVGObj,
|
|
drawnObjects //
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
//
|
|
if (hasBearishFVGs)
|
|
{
|
|
//
|
|
for (int i = 0; i < bearishFVGsCount; i++)
|
|
{
|
|
//
|
|
XCFVG *iFVG = conditions.bearishFVGs[i];
|
|
|
|
//
|
|
XCBearishFairValueGapObject *iFVGObj;
|
|
bool isCreated = visionCycleHelper
|
|
.mPOIDrawer
|
|
.CreateBearishFairValueGap(
|
|
iFVG,
|
|
iFVGObj //
|
|
);
|
|
if (isCreated)
|
|
{
|
|
//
|
|
Add(
|
|
(XCBaseObject *)iFVGObj,
|
|
drawnObjects //
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
//
|
|
if (hasSupportZones)
|
|
{
|
|
//
|
|
for (int i = 0; i < supportZonesCount; i++)
|
|
{
|
|
//
|
|
XCSupportZoneObject *iObj;
|
|
bool isCreated = visionCycleHelper
|
|
.mPOIDrawer
|
|
.CreateSupportZone(
|
|
conditions.supportZones[i],
|
|
iObj //
|
|
);
|
|
|
|
//
|
|
if (isCreated)
|
|
{
|
|
//
|
|
Add(
|
|
(XCBaseObject *)iObj,
|
|
drawnObjects //
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
//
|
|
if (hasResistanceZones)
|
|
{
|
|
//
|
|
for (int i = 0; i < resistanceZonesCount; i++)
|
|
{
|
|
//
|
|
XCResistanceZoneObject *iObj;
|
|
bool isCreated = visionCycleHelper
|
|
.mPOIDrawer
|
|
.CreateResistanceZone(
|
|
conditions.resistanceZones[i],
|
|
iObj //
|
|
);
|
|
|
|
//
|
|
if (isCreated)
|
|
{
|
|
//
|
|
Add(
|
|
(XCBaseObject *)iObj,
|
|
drawnObjects //
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
//
|
|
if (hasDemandZones)
|
|
{
|
|
//
|
|
for (int i = 0; i < demandZonesCount; i++)
|
|
{
|
|
//
|
|
XCDemandZoneObject *iObj;
|
|
bool isCreated = visionCycleHelper
|
|
.mPOIDrawer
|
|
.CreateDemandZone(
|
|
conditions.demandZones[i],
|
|
iObj //
|
|
);
|
|
|
|
//
|
|
if (isCreated)
|
|
{
|
|
//
|
|
Add(
|
|
(XCBaseObject *)iObj,
|
|
drawnObjects //
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
//
|
|
if (hasSupplyZones)
|
|
{
|
|
//
|
|
for (int i = 0; i < supplyZonesCount; i++)
|
|
{
|
|
//
|
|
XCSupplyZoneObject *iObj;
|
|
bool isCreated = visionCycleHelper
|
|
.mPOIDrawer
|
|
.CreateSupplyZone(
|
|
conditions.supplyZones[i],
|
|
iObj //
|
|
);
|
|
|
|
//
|
|
if (isCreated)
|
|
{
|
|
//
|
|
Add(
|
|
(XCBaseObject *)iObj,
|
|
drawnObjects //
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
//
|
|
//
|
|
//
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
// if (hasPriceBox && hasYoungestOB)
|
|
// {
|
|
// //
|
|
// X121SMCCycleState iState;
|
|
// bool iHasState = visionCycleHelper.GetCycleState(iState);
|
|
// if (iHasState)
|
|
// {
|
|
// //
|
|
// // Retrieve Youngest Order Blocks ...
|
|
// XCOrderBlock *iYOB;
|
|
// bool iHasYoungestOB = iState.GetYoungestOB(iYOB);
|
|
// if (iHasYoungestOB)
|
|
// {
|
|
// //
|
|
// bool isCreate = false;
|
|
// bool isYoungestBullish = iYOB.IsBullish();
|
|
// if (isYoungestBullish)
|
|
// {
|
|
// //
|
|
// // XCBullishOrderBlockObject *iObj;
|
|
// // isCreate = visionCycleHelper.mPOIDrawer.CreateBullishOrderBlock(
|
|
// // iYOB,
|
|
// // iObj //
|
|
// // );
|
|
|
|
// // //
|
|
// // if (isCreate) {
|
|
// // //
|
|
// // iObj.ZoneColor(clrAqua);
|
|
// // iObj.ZoneWidth(4);
|
|
// // }
|
|
// }
|
|
// else
|
|
// {
|
|
// //
|
|
// // XCBearishOrderBlockObject *iObj;
|
|
// // isCreate = visionCycleHelper.mPOIDrawer.CreateBearishOrderBlock(
|
|
// // iYOB,
|
|
// // iObj //
|
|
// // );
|
|
|
|
// // //
|
|
// // if (isCreate) {
|
|
// // //
|
|
// // iObj.ZoneColor(clrMagenta);
|
|
// // iObj.ZoneWidth(4);
|
|
// // }
|
|
// }
|
|
|
|
// //
|
|
// // Compare it with current Condition PriceOB ...
|
|
// bool isSame =
|
|
// //
|
|
// conditions.priceOB.Upper() == iYOB.Upper() &&
|
|
// conditions.priceOB.Lower() == iYOB.Lower() &&
|
|
// conditions.priceOB.From() == iYOB.From() &&
|
|
// conditions.priceOB.Type() == iYOB.Type()
|
|
// //
|
|
// ;
|
|
// if (!isSame)
|
|
// {
|
|
// conditions.Clean();
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
//
|
|
// bool canReset =
|
|
// //
|
|
// hasPriceBox &&
|
|
// conditions.isPriceOBActed &&
|
|
// conditions.isPriceOBBreaked &&
|
|
// //
|
|
// (
|
|
// //
|
|
// IsBullish(conditions.priceBox.dir)
|
|
// ? pBar.high < lower &&
|
|
// cBar.high < lower
|
|
// : pBar.low > upper &&
|
|
// cBar.low > upper
|
|
// //
|
|
// )
|
|
// //
|
|
// ;
|
|
// if (canReset)
|
|
// {
|
|
// //
|
|
// Print("canReset");
|
|
// }
|
|
|
|
//
|
|
// Check Conditions Clean Senario ...
|
|
// bool canResetConditions =
|
|
// //
|
|
// hasPriceBox &&
|
|
// !isPriceOBValid &&
|
|
// conditions.priceOB != NULL &&
|
|
// conditions.priceOB.IsValid()
|
|
// //
|
|
// ;
|
|
// bool canReset2 =
|
|
// //
|
|
// conditions.priceOB != NULL &&
|
|
// (
|
|
// //
|
|
// (
|
|
// //
|
|
// conditions.priceOB.IsBullish()
|
|
// ? hh < conditions.priceOB.Lower()
|
|
// : ll > conditions.priceOB.Upper()
|
|
// //
|
|
// )
|
|
// //
|
|
// ||
|
|
// //
|
|
// (
|
|
// //
|
|
// conditions.priceOB.IsBullish()
|
|
// ? ll50 > conditions.priceOB.Upper()
|
|
// : hh50 < conditions.priceOB.Lower()
|
|
// //
|
|
// )
|
|
// //
|
|
// )
|
|
// //
|
|
// ;
|
|
|
|
// if (canResetConditions)
|
|
// {
|
|
// Print("canResetConditions");
|
|
// }
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
X121SMCCycleState iState;
|
|
bool iHasState = visionCycleHelper.GetCycleState(iState);
|
|
if (iHasState)
|
|
{
|
|
//
|
|
// Check Price Inside Box ...
|
|
XBoxZone iPriceBox;
|
|
XCOrderBlock *iPriceOB = NULL;
|
|
bool iHasPriceBox = DetectPriceInsideBox(
|
|
iPriceBox,
|
|
iPriceOB,
|
|
decisionXConditions,
|
|
iState //
|
|
);
|
|
|
|
//
|
|
if (iHasPriceBox) {
|
|
//
|
|
}
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// //
|
|
// // Draw ...
|
|
// XCBaseObject *drawnObjects[];
|
|
// int drawnObjectsCount = visionCycleHelper.DrawCycleState(
|
|
// conditions.state,
|
|
// drawnObjects //
|
|
// );
|
|
|
|
// //
|
|
// if (hasPriceBox)
|
|
// {
|
|
// //
|
|
// bool isBullish = IsBullish(conditions.priceBox.dir);
|
|
// color boxColor = isBullish ? clrYellow : clrOrange;
|
|
|
|
// //
|
|
// XCBoxObject *iObj;
|
|
// bool isCreated = visionCycleHelper.mPOIDrawer.CreateBox(
|
|
// conditions.priceBox,
|
|
// iObj,
|
|
// boxColor,
|
|
// 1,
|
|
// false,
|
|
// STYLE_DASHDOTDOT //
|
|
// );
|
|
|
|
// //
|
|
// if (isCreated)
|
|
// {
|
|
// //
|
|
// Add(
|
|
// (XCBaseObject *)iObj,
|
|
// drawnObjects //
|
|
// );
|
|
// }
|
|
|
|
// //
|
|
// XCBaseObject *priceOBObj = NULL;
|
|
// if (isBullish)
|
|
// {
|
|
// //
|
|
// XCBullishOrderBlockObject *iObj;
|
|
// isCreated = visionCycleHelper
|
|
// .mPOIDrawer
|
|
// .CreateBullishOrderBlock(
|
|
// conditions.priceOB,
|
|
// iObj //
|
|
// );
|
|
|
|
// //
|
|
// if (isCreated)
|
|
// {
|
|
// //
|
|
// iObj.ZoneWidth(2);
|
|
// iObj.ZoneColor(boxColor);
|
|
// iObj.ZoneStyle(STYLE_SOLID);
|
|
|
|
// //
|
|
// priceOBObj = (XCBaseObject *)iObj;
|
|
// }
|
|
// }
|
|
// else
|
|
// {
|
|
// //
|
|
// XCBearishOrderBlockObject *iObj;
|
|
// isCreated = visionCycleHelper
|
|
// .mPOIDrawer
|
|
// .CreateBearishOrderBlock(
|
|
// conditions.priceOB,
|
|
// iObj //
|
|
// );
|
|
|
|
// //
|
|
// if (isCreated)
|
|
// {
|
|
// //
|
|
// iObj.ZoneWidth(2);
|
|
// iObj.ZoneColor(boxColor);
|
|
// iObj.ZoneStyle(STYLE_SOLID);
|
|
|
|
// //
|
|
// priceOBObj = (XCBaseObject *)iObj;
|
|
// }
|
|
// }
|
|
|
|
// //
|
|
// if (isCreated)
|
|
// {
|
|
// //
|
|
// Add(
|
|
// priceOBObj,
|
|
// drawnObjects //
|
|
// );
|
|
// }
|
|
// }
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
|