This commit is contained in:
2024-06-24 18:28:48 +03:30
parent ba23e2d9e9
commit e41548979e
2 changed files with 137 additions and 62 deletions
+136 -61
View File
@@ -1991,83 +1991,158 @@ public:
for (int i = 0; i < count; i++)
{
//
double iEntry = data[i].entry;
string iSymbol = data[i].symbol;
ENUM_TIMEFRAMES iPeriod = data[i].period;
ENUM_X_POSITION_TYPES iType = data[i].type;
//
double hotLevels[];
bool isLong = IsLong(iType);
ENUM_POSITION_TYPE iPType = isLong
? POSITION_TYPE_BUY
: POSITION_TYPE_SELL;
//
AddSpecific(
0.25,
hotLevels //
);
//
AddSpecific(
0.20,
hotLevels //
);
//
AddSpecific(
0.12,
hotLevels //
);
//
XSCZonesInput zonesInput;
zonesInput.length = 71;
zonesInput.numberOfZones = 10;
XSCZones *zones = new XSCZones(
double cEntry = GetEntry(
iSymbol,
_Period //
iPType //
);
//
zonesInput.AddLevelColor(
hotLevels[0],
clrRed //
);
zonesInput.AddLevelColor(
hotLevels[1],
clrOrange //
);
zonesInput.AddLevelColor(
hotLevels[2],
clrLightCoral //
);
bool canUseZones = zones.Init(zonesInput);
//
XSCCFInput cfInputs;
cfInputs.Default();
XSCCF *cf = new XSCCF(
XOHCL cBar;
bool isInited = cBar.Init(
iSymbol,
_Period //
iPeriod,
1 //
);
bool canUseCF = cf.Init(cfInputs);
if (!isInited)
{
continue;
}
//
XSCTrendInput tInputs;
tInputs.Default();
XSCTrend *trend = new XSCTrend(
iSymbol,
_Period //
);
bool canUseTrend = trend.Init(tInputs);
bool isBullish = cBar.IsBullish();
bool isBreakUp = cBar.IsBreakUp(iEntry);
if (canUseCF && canUseTrend && canUseZones)
//
bool isBearish = cBar.IsBearish();
bool isBreakDown = cBar.IsBreakDown(iEntry);
//
bool isBreaked =
isLong
? isBullish && isBreakUp && cEntry > iEntry
: isBearish && isBreakDown && cEntry < iEntry;
//
if (isBreaked)
{
//
// cf.Draw();
trend.Draw();
// zones.Draw();
Print("Use CF ...");
// cf.Remove();
// trend.Remove();
// zones.Remove();
// Update Date of TradeInfo ...
data[i].entry = cEntry;
data[i].time = TimeCurrent();
//
// Generate Signal ...
XSignal iSignal;
bool isPrepared = iSignal.Prepare(
data[i].symbol,
data[i].provider,
data[i].period,
iPType,
X_ORDER_MODE_MARKET,
data[i].entry,
data[i].volume,
0,
0 //
);
//
// Add Signal to Result ...
if (isPrepared)
{
//
AddRef(
iSignal,
signals //
);
}
}
// //
// double hotLevels[];
// //
// AddSpecific(
// 0.25,
// hotLevels //
// );
// //
// AddSpecific(
// 0.20,
// hotLevels //
// );
// //
// AddSpecific(
// 0.12,
// hotLevels //
// );
// //
// XSCZonesInput zonesInput;
// zonesInput.length = 71;
// zonesInput.numberOfZones = 10;
// XSCZones *zones = new XSCZones(
// iSymbol,
// _Period //
// );
// //
// zonesInput.AddLevelColor(
// hotLevels[0],
// clrRed //
// );
// zonesInput.AddLevelColor(
// hotLevels[1],
// clrOrange //
// );
// zonesInput.AddLevelColor(
// hotLevels[2],
// clrLightCoral //
// );
// bool canUseZones = zones.Init(zonesInput);
// //
// XSCCFInput cfInputs;
// cfInputs.Default();
// XSCCF *cf = new XSCCF(
// iSymbol,
// _Period //
// );
// bool canUseCF = cf.Init(cfInputs);
// //
// XSCTrendInput tInputs;
// tInputs.Default();
// XSCTrend *trend = new XSCTrend(
// iSymbol,
// _Period //
// );
// bool canUseTrend = trend.Init(tInputs);
// if (canUseCF && canUseTrend && canUseZones)
// {
// //
// // cf.Draw();
// trend.Draw();
// // zones.Draw();
// Print("Use CF ...");
// // cf.Remove();
// // trend.Remove();
// // zones.Remove();
// }
}
//
@@ -3571,8 +3646,8 @@ public:
bool allowShort = AllowShort();
//
bool useCMarket = false;
bool useSMarket = true;
bool useCMarket = true;
bool useSMarket = false;
bool useMMarket = false;
bool useLMarket = false;
bool useHMarket = false;