complete X786 ...
This commit is contained in:
@@ -265,6 +265,7 @@ public:
|
||||
// Current ...
|
||||
cMarketInputs.pvInputs = this.pvInputs;
|
||||
cMarketInputs.zgInputs = this.zgInputs;
|
||||
cMarketInputs.tdInputs = this.tdInputs;
|
||||
cMarketInputs.mcInputs = this.mcInputs;
|
||||
cMarketInputs.hkInputs = this.hkInputs;
|
||||
cMarketInputs.mrbInputs = this.mrbInputs;
|
||||
@@ -291,6 +292,7 @@ public:
|
||||
// Short ...
|
||||
sMarketInputs.pvInputs = this.pvInputs;
|
||||
sMarketInputs.zgInputs = this.zgInputs;
|
||||
sMarketInputs.tdInputs = this.tdInputs;
|
||||
sMarketInputs.mcInputs = this.mcInputs;
|
||||
sMarketInputs.hkInputs = this.hkInputs;
|
||||
sMarketInputs.mrbInputs = this.mrbInputs;
|
||||
@@ -317,6 +319,7 @@ public:
|
||||
// Medium ...
|
||||
mMarketInputs.pvInputs = this.pvInputs;
|
||||
mMarketInputs.zgInputs = this.zgInputs;
|
||||
mMarketInputs.tdInputs = this.tdInputs;
|
||||
mMarketInputs.mcInputs = this.mcInputs;
|
||||
mMarketInputs.hkInputs = this.hkInputs;
|
||||
mMarketInputs.mrbInputs = this.mrbInputs;
|
||||
@@ -343,6 +346,7 @@ public:
|
||||
// Long ...
|
||||
lMarketInputs.pvInputs = this.pvInputs;
|
||||
lMarketInputs.zgInputs = this.zgInputs;
|
||||
lMarketInputs.tdInputs = this.tdInputs;
|
||||
lMarketInputs.mcInputs = this.mcInputs;
|
||||
lMarketInputs.hkInputs = this.hkInputs;
|
||||
lMarketInputs.mrbInputs = this.mrbInputs;
|
||||
@@ -369,6 +373,7 @@ public:
|
||||
// Hind ...
|
||||
hMarketInputs.pvInputs = this.pvInputs;
|
||||
hMarketInputs.zgInputs = this.zgInputs;
|
||||
hMarketInputs.tdInputs = this.tdInputs;
|
||||
hMarketInputs.mcInputs = this.mcInputs;
|
||||
hMarketInputs.hkInputs = this.hkInputs;
|
||||
hMarketInputs.mrbInputs = this.mrbInputs;
|
||||
@@ -3091,7 +3096,8 @@ public:
|
||||
? entry - risk
|
||||
: entry + risk;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//
|
||||
// TODOO: Remove this ...
|
||||
sl = hasLong
|
||||
@@ -3102,6 +3108,7 @@ public:
|
||||
tp = hasLong
|
||||
? entry + reward
|
||||
: entry - reward;
|
||||
}
|
||||
|
||||
//
|
||||
result = mSignal.Prepare(
|
||||
@@ -7570,422 +7577,6 @@ private:
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
// XSTR
|
||||
// XPV
|
||||
// XHK
|
||||
// XCHE
|
||||
// XTD
|
||||
// XDON
|
||||
|
||||
//
|
||||
// Conditions ...
|
||||
// - [] XPV,XDON: XPV Vale and XDON LL (Low Lower) must be same;
|
||||
// - [] XDON: Candle Crossed Down XDON HL (High Lower);
|
||||
// - [] XDON: Candle Crossed Up XDON HL (High Lower);
|
||||
// - [] XTD: When Candle Crossed Up XTD Must in Bullish Mode;
|
||||
// - [] XCHE: Check CHE Long Exits Exists;
|
||||
// - [] XSTR: Check STR Trend is Bullish;
|
||||
// - [] XPV: Not In Fibo Section Changed;
|
||||
// - [] XPV: Fibo Level 5 Crossed Using Don HL Crosser Cndle;
|
||||
|
||||
//
|
||||
int zIndex = 0;
|
||||
int cIndex = zIndex + 1;
|
||||
int pIndex = cIndex + 1;
|
||||
|
||||
//
|
||||
// XSTR ...
|
||||
ENUM_XSTR_TREND_STATES cStrState = cMarket
|
||||
.str
|
||||
.GetState(cIndex);
|
||||
double cStrTrend = cMarket.str.GetTrend(cIndex);
|
||||
bool isCStrBullish = cStrState == X_STR_BULLISH;
|
||||
bool isCStrBearish = cStrState == X_STR_BEARISH;
|
||||
|
||||
//
|
||||
ENUM_XSTR_TREND_STATES pStrState = cMarket
|
||||
.str
|
||||
.GetState(pIndex);
|
||||
double pStrTrend = cMarket.str.GetTrend(pIndex);
|
||||
bool isPStrBullish = pStrState == X_STR_BULLISH;
|
||||
bool isPStrBearish = pStrState == X_STR_BEARISH;
|
||||
|
||||
//
|
||||
bool isTrendBullish = isCStrBullish;
|
||||
bool isTrendBearish = isCStrBearish;
|
||||
|
||||
//
|
||||
bool isTrendSwitchedToBullish =
|
||||
//
|
||||
isCStrBullish &&
|
||||
!isPStrBullish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isTrendSwitchedToBearish =
|
||||
//
|
||||
isCStrBearish &&
|
||||
!isPStrBearish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// XCHE ...
|
||||
|
||||
//
|
||||
double cCHELongExit1 = cMarket.che.GetLongExit1(cIndex);
|
||||
double cCHELongExit2 = cMarket.che.GetLongExit2(cIndex);
|
||||
|
||||
//
|
||||
double pCHELongExit1 = cMarket.che.GetLongExit1(pIndex);
|
||||
double pCHELongExit2 = cMarket.che.GetLongExit2(pIndex);
|
||||
|
||||
//
|
||||
double cCHEShortExit1 = cMarket.che.GetShortExit1(cIndex);
|
||||
double cCHEShortExit2 = cMarket.che.GetShortExit2(cIndex);
|
||||
|
||||
//
|
||||
double pCHEShortExit1 = cMarket.che.GetShortExit1(pIndex);
|
||||
double pCHEShortExit2 = cMarket.che.GetShortExit2(pIndex);
|
||||
|
||||
//
|
||||
bool CCHEHasLongExit1 = NotEmpty(cCHELongExit1);
|
||||
bool CCHEHasLongExit2 = NotEmpty(cCHELongExit2);
|
||||
|
||||
//
|
||||
bool CCHEHasShortExit1 = NotEmpty(cCHEShortExit1);
|
||||
bool CCHEHasShortExit2 = NotEmpty(cCHEShortExit2);
|
||||
|
||||
//
|
||||
bool PCHEHasLongExit1 = NotEmpty(pCHELongExit1);
|
||||
bool PCHEHasLongExit2 = NotEmpty(pCHELongExit2);
|
||||
|
||||
//
|
||||
bool PCHEHasShortExit1 = NotEmpty(pCHEShortExit1);
|
||||
bool PCHEHasShortExit2 = NotEmpty(pCHEShortExit2);
|
||||
|
||||
//
|
||||
bool isCCHEBullish =
|
||||
//
|
||||
CCHEHasLongExit1 &&
|
||||
CCHEHasLongExit2
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isCCHEBearish =
|
||||
//
|
||||
CCHEHasShortExit1 &&
|
||||
CCHEHasShortExit2
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isPCHEBullish =
|
||||
//
|
||||
PCHEHasLongExit1 &&
|
||||
PCHEHasLongExit2
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isPCHEBearish =
|
||||
//
|
||||
PCHEHasShortExit1 &&
|
||||
PCHEHasShortExit2
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isCHEBullish = isCCHEBullish;
|
||||
bool isCHEBearish = isCCHEBearish;
|
||||
bool isCHESwitchedToBullish =
|
||||
//
|
||||
isCCHEBullish &&
|
||||
!isPCHEBullish
|
||||
//
|
||||
;
|
||||
bool isCHESwitchedToBearish =
|
||||
//
|
||||
isCCHEBearish &&
|
||||
!isPCHEBearish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// XPV ...
|
||||
|
||||
double cPVPeak = cMarket.pv.GetPeak(cIndex);
|
||||
double cPVVale = cMarket.pv.GetVale(cIndex);
|
||||
|
||||
//
|
||||
double pPVPeak = cMarket.pv.GetPeak(pIndex);
|
||||
double pPVVale = cMarket.pv.GetVale(pIndex);
|
||||
|
||||
//
|
||||
double cPVSup = cMarket.pv.GetSupport(cIndex);
|
||||
double pPVSup = cMarket.pv.GetSupport(pIndex);
|
||||
|
||||
//
|
||||
double cPVRes = cMarket.pv.GetResistance(cIndex);
|
||||
double pPVRes = cMarket.pv.GetResistance(pIndex);
|
||||
|
||||
//
|
||||
double cPVFib1 = cMarket.pv.GetFib1(cIndex);
|
||||
double cPVFib2 = cMarket.pv.GetFib2(cIndex);
|
||||
double cPVFib3 = cMarket.pv.GetFib3(cIndex);
|
||||
double cPVFib4 = cMarket.pv.GetFib4(cIndex);
|
||||
double cPVFib5 = cMarket.pv.GetFib5(cIndex);
|
||||
|
||||
//
|
||||
double pPVFib1 = cMarket.pv.GetFib1(pIndex);
|
||||
double pPVFib2 = cMarket.pv.GetFib2(pIndex);
|
||||
double pPVFib3 = cMarket.pv.GetFib3(pIndex);
|
||||
double pPVFib4 = cMarket.pv.GetFib4(pIndex);
|
||||
double pPVFib5 = cMarket.pv.GetFib5(pIndex);
|
||||
|
||||
//
|
||||
bool isNewPeak = cPVPeak != pPVPeak;
|
||||
bool isNewPeakUnderLast =
|
||||
//
|
||||
isNewPeak &&
|
||||
cPVPeak < pPVPeak
|
||||
//
|
||||
;
|
||||
bool isNewPeakOverLast =
|
||||
//
|
||||
isNewPeak &&
|
||||
cPVPeak > pPVPeak
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isNewVale = cPVVale != pPVVale;
|
||||
bool isNewValeUnderLast =
|
||||
//
|
||||
isNewVale &&
|
||||
cPVVale < pPVVale
|
||||
//
|
||||
;
|
||||
bool isNewValeOverLast =
|
||||
//
|
||||
isNewVale &&
|
||||
cPVVale > pPVVale
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isFiboIncreased =
|
||||
//
|
||||
cPVFib1 > pPVFib1 &&
|
||||
cPVFib2 > pPVFib2 &&
|
||||
cPVFib3 > pPVFib3 &&
|
||||
cPVFib4 > pPVFib4 &&
|
||||
cPVFib5 > pPVFib5
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isFiboDecreased =
|
||||
//
|
||||
cPVFib1 < pPVFib1 &&
|
||||
cPVFib2 < pPVFib2 &&
|
||||
cPVFib3 < pPVFib3 &&
|
||||
cPVFib4 < pPVFib4 &&
|
||||
cPVFib5 < pPVFib5
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isFiboSectionChanged =
|
||||
//
|
||||
(isFiboDecreased &&
|
||||
isNewPeakUnderLast)
|
||||
//
|
||||
||
|
||||
//
|
||||
(isFiboIncreased &&
|
||||
isNewValeOverLast)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// XFI ...
|
||||
|
||||
//
|
||||
double cFI = fiHelper.GetMain(cIndex);
|
||||
double pFI = fiHelper.GetMain(pIndex);
|
||||
|
||||
//
|
||||
bool isCFIOverZero = cFI > 0;
|
||||
bool isCFIUnderZero = cFI > 0;
|
||||
|
||||
//
|
||||
bool isPFIOverZero = pFI > 0;
|
||||
bool isPFIUnderZero = pFI > 0;
|
||||
|
||||
//
|
||||
bool isFICrossedOverZero =
|
||||
//
|
||||
isCFIOverZero &&
|
||||
!isPFIOverZero
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isFICrossedUnderZero =
|
||||
//
|
||||
isCFIUnderZero &&
|
||||
!isPFIUnderZero
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// XHK ...
|
||||
|
||||
//
|
||||
XOHCL cSMHKBar;
|
||||
cMarket.hk.SMAsOHCL(
|
||||
cSMHKBar,
|
||||
cIndex //
|
||||
);
|
||||
|
||||
//
|
||||
XOHCL pSMHKBar;
|
||||
cMarket.hk.SMAsOHCL(
|
||||
pSMHKBar,
|
||||
pIndex //
|
||||
);
|
||||
|
||||
//
|
||||
bool isCSMHKBullish = cSMHKBar.IsBullish();
|
||||
bool isCSMHKBearish = cSMHKBar.IsBearish();
|
||||
|
||||
//
|
||||
bool isPSMHKBullish = pSMHKBar.IsBullish();
|
||||
bool isPSMHKBearish = pSMHKBar.IsBearish();
|
||||
|
||||
//
|
||||
bool isSMHKSwitchedToBullish =
|
||||
//
|
||||
isCSMHKBullish &&
|
||||
isPSMHKBearish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isSMHKSwitchedToBearish =
|
||||
//
|
||||
isCSMHKBearish &&
|
||||
isPSMHKBullish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// XTD ...
|
||||
|
||||
//
|
||||
double cTDBullish = tdHelper.GetBullish(cIndex);
|
||||
double pTDBullish = tdHelper.GetBullish(pIndex);
|
||||
|
||||
//
|
||||
double cTDBearish = tdHelper.GetBearish(cIndex);
|
||||
double pTDBearish = tdHelper.GetBearish(pIndex);
|
||||
|
||||
//
|
||||
bool isCTDBullish =
|
||||
//
|
||||
cTDBullish > cTDBearish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isCTDBearish =
|
||||
//
|
||||
cTDBearish > cTDBullish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isPTDBullish =
|
||||
//
|
||||
pTDBullish > pTDBearish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isPTDBearish =
|
||||
//
|
||||
pTDBearish > pTDBullish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isTDBullish = isCTDBullish;
|
||||
bool isTDBearish = isCTDBearish;
|
||||
bool isTDSwitchedToBullish =
|
||||
//
|
||||
isCTDBullish &&
|
||||
!isPTDBullish
|
||||
//
|
||||
;
|
||||
bool isTDSwitchedToBearsih =
|
||||
//
|
||||
isCTDBearish &&
|
||||
!isPTDBearish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// XDON ...
|
||||
|
||||
//
|
||||
XOHCL cBar = cMarket.GetBar(cIndex);
|
||||
XOHCL pBar = cMarket.GetBar(pIndex);
|
||||
|
||||
//
|
||||
double cDONUpperOpen = cMarket.don.GetUpperO(cIndex);
|
||||
double cDONUpperClose = cMarket.don.GetUpperC(cIndex);
|
||||
double cDONUpperHigh = cMarket.don.GetUpperH(cIndex);
|
||||
double cDONUpperLow = cMarket.don.GetUpperL(cIndex);
|
||||
|
||||
//
|
||||
double cDONLowerOpen = cMarket.don.GetLowerO(cIndex);
|
||||
double cDONLowerClose = cMarket.don.GetLowerC(cIndex);
|
||||
double cDONLowerHigh = cMarket.don.GetLowerH(cIndex);
|
||||
double cDONLowerLow = cMarket.don.GetLowerL(cIndex);
|
||||
|
||||
//
|
||||
double pDONUpperOpen = cMarket.don.GetUpperO(pIndex);
|
||||
double pDONUpperClose = cMarket.don.GetUpperC(pIndex);
|
||||
double pDONUpperHigh = cMarket.don.GetUpperH(pIndex);
|
||||
double pDONUpperLow = cMarket.don.GetUpperL(pIndex);
|
||||
|
||||
//
|
||||
double pDONLowerOpen = cMarket.don.GetLowerO(pIndex);
|
||||
double pDONLowerClose = cMarket.don.GetLowerC(pIndex);
|
||||
double pDONLowerHigh = cMarket.don.GetLowerH(pIndex);
|
||||
double pDONLowerLow = cMarket.don.GetLowerL(pIndex);
|
||||
|
||||
//
|
||||
bool isBarCrossedDownDONLowerHigh =
|
||||
//
|
||||
cBar.IsBreakDown(pDONLowerHigh)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
isTrendSwitchedToBullish
|
||||
//
|
||||
;
|
||||
if (result) {
|
||||
Print("Salam");
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
@@ -8003,86 +7594,85 @@ private:
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
bool isCMStrLong =
|
||||
//
|
||||
mConditions.cMarketConditions.isTrendSwitchedToBullish &&
|
||||
(mConditions.hMarketConditions.isTrendBullish &&
|
||||
mConditions.lMarketConditions.isTrendBullish &&
|
||||
mConditions.mMarketConditions.isTrendBullish &&
|
||||
mConditions.sMarketConditions.isTrendBullish)
|
||||
//
|
||||
;
|
||||
int zIndex = 0;
|
||||
int cIndex = zIndex + 1;
|
||||
int pIndex = cIndex + 1;
|
||||
|
||||
//
|
||||
bool isSMStrLong =
|
||||
//
|
||||
mConditions.sMarketConditions.isTrendSwitchedToBullish &&
|
||||
(mConditions.hMarketConditions.isTrendBullish &&
|
||||
mConditions.lMarketConditions.isTrendBullish &&
|
||||
mConditions.mMarketConditions.isTrendBullish &&
|
||||
mConditions.cMarketConditions.isTrendBullish)
|
||||
//
|
||||
;
|
||||
// Current Market ...
|
||||
double cLowerHigh = cMarket.don.GetLowerH(cIndex);
|
||||
bool cHasX786 = cMarket.HasX786LongConditions();
|
||||
if (cHasX786)
|
||||
{
|
||||
sl = cLowerHigh;
|
||||
}
|
||||
|
||||
//
|
||||
bool isMMStrLong =
|
||||
//
|
||||
mConditions.mMarketConditions.isTrendSwitchedToBullish &&
|
||||
(mConditions.hMarketConditions.isTrendBullish &&
|
||||
mConditions.lMarketConditions.isTrendBullish &&
|
||||
mConditions.sMarketConditions.isTrendBullish &&
|
||||
mConditions.cMarketConditions.isTrendBullish)
|
||||
//
|
||||
;
|
||||
// Short Market ...
|
||||
double sLowerHigh = sMarket.don.GetLowerH(cIndex);
|
||||
bool sHasX786 = sMarket.HasX786LongConditions();
|
||||
if (sHasX786)
|
||||
{
|
||||
sl = sLowerHigh;
|
||||
}
|
||||
|
||||
//
|
||||
bool isLMStrLong =
|
||||
//
|
||||
mConditions.lMarketConditions.isTrendSwitchedToBullish &&
|
||||
(mConditions.hMarketConditions.isTrendBullish &&
|
||||
mConditions.mMarketConditions.isTrendBullish &&
|
||||
mConditions.sMarketConditions.isTrendBullish &&
|
||||
mConditions.cMarketConditions.isTrendBullish)
|
||||
//
|
||||
;
|
||||
// Medium Market ...
|
||||
double mLowerHigh = mMarket.don.GetLowerH(cIndex);
|
||||
bool mHasX786 = mMarket.HasX786LongConditions();
|
||||
if (mHasX786)
|
||||
{
|
||||
sl = mLowerHigh;
|
||||
}
|
||||
|
||||
//
|
||||
bool isHMStrLong =
|
||||
//
|
||||
mConditions.hMarketConditions.isTrendSwitchedToBullish &&
|
||||
(mConditions.lMarketConditions.isTrendBullish &&
|
||||
mConditions.mMarketConditions.isTrendBullish &&
|
||||
mConditions.sMarketConditions.isTrendBullish &&
|
||||
mConditions.cMarketConditions.isTrendBullish)
|
||||
//
|
||||
;
|
||||
// Long Market ...
|
||||
double lLowerHigh = lMarket.don.GetLowerH(cIndex);
|
||||
bool lHasX786 = lMarket.HasX786LongConditions();
|
||||
if (lHasX786)
|
||||
{
|
||||
sl = lLowerHigh;
|
||||
}
|
||||
|
||||
//
|
||||
// bool isScorePassed = IsScorePassedForLong();
|
||||
// Hind Market ...
|
||||
double hLowerHigh = hMarket.don.GetLowerH(cIndex);
|
||||
bool hHasX786 = hMarket.HasX786LongConditions();
|
||||
if (hHasX786)
|
||||
{
|
||||
sl = hLowerHigh;
|
||||
}
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
// isCMStrLong
|
||||
// //
|
||||
// ||
|
||||
// //
|
||||
// isSMStrLong
|
||||
// //
|
||||
// ||
|
||||
//
|
||||
isMMStrLong
|
||||
cHasX786
|
||||
//
|
||||
||
|
||||
//
|
||||
isLMStrLong
|
||||
sHasX786
|
||||
//
|
||||
||
|
||||
//
|
||||
isHMStrLong
|
||||
mHasX786
|
||||
//
|
||||
||
|
||||
//
|
||||
lHasX786
|
||||
//
|
||||
// ||
|
||||
// //
|
||||
// hHasX786
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
r2r = 2;
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
@@ -9155,83 +8745,85 @@ private:
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
bool isCMStrShort =
|
||||
//
|
||||
mConditions.cMarketConditions.isTrendSwitchedToBearish &&
|
||||
(mConditions.hMarketConditions.isTrendBearish &&
|
||||
mConditions.lMarketConditions.isTrendBearish &&
|
||||
mConditions.mMarketConditions.isTrendBearish &&
|
||||
mConditions.sMarketConditions.isTrendBearish)
|
||||
//
|
||||
;
|
||||
int zIndex = 0;
|
||||
int cIndex = zIndex + 1;
|
||||
int pIndex = cIndex + 1;
|
||||
|
||||
//
|
||||
bool isSMStrShort =
|
||||
//
|
||||
mConditions.sMarketConditions.isTrendSwitchedToBearish &&
|
||||
(mConditions.hMarketConditions.isTrendBearish &&
|
||||
mConditions.lMarketConditions.isTrendBearish &&
|
||||
mConditions.mMarketConditions.isTrendBearish &&
|
||||
mConditions.cMarketConditions.isTrendBearish)
|
||||
//
|
||||
;
|
||||
// Current Market ...
|
||||
double cUpperLow = cMarket.don.GetUpperL(cIndex);
|
||||
bool cHasX786 = cMarket.HasX786ShortConditions();
|
||||
if (cHasX786)
|
||||
{
|
||||
sl = cUpperLow;
|
||||
}
|
||||
|
||||
//
|
||||
bool isMMStrShort =
|
||||
//
|
||||
mConditions.mMarketConditions.isTrendSwitchedToBearish &&
|
||||
(mConditions.hMarketConditions.isTrendBearish &&
|
||||
mConditions.lMarketConditions.isTrendBearish &&
|
||||
mConditions.sMarketConditions.isTrendBearish &&
|
||||
mConditions.cMarketConditions.isTrendBearish)
|
||||
//
|
||||
;
|
||||
// Short Market ...
|
||||
double sUpperLow = sMarket.don.GetUpperL(cIndex);
|
||||
bool sHasX786 = sMarket.HasX786ShortConditions();
|
||||
if (sHasX786)
|
||||
{
|
||||
sl = sUpperLow;
|
||||
}
|
||||
|
||||
//
|
||||
bool isLMStrShort =
|
||||
//
|
||||
mConditions.lMarketConditions.isTrendSwitchedToBearish &&
|
||||
(mConditions.hMarketConditions.isTrendBearish &&
|
||||
mConditions.mMarketConditions.isTrendBearish &&
|
||||
mConditions.sMarketConditions.isTrendBearish &&
|
||||
mConditions.cMarketConditions.isTrendBearish)
|
||||
//
|
||||
;
|
||||
// Medium Market ...
|
||||
double mUpperLow = mMarket.don.GetUpperL(cIndex);
|
||||
bool mHasX786 = mMarket.HasX786ShortConditions();
|
||||
if (mHasX786)
|
||||
{
|
||||
sl = mUpperLow;
|
||||
}
|
||||
|
||||
//
|
||||
bool isHMStrShort =
|
||||
// Long Market ...
|
||||
double lUpperLow = lMarket.don.GetUpperL(cIndex);
|
||||
bool lHasX786 = lMarket.HasX786ShortConditions();
|
||||
if (lHasX786)
|
||||
{
|
||||
sl = lUpperLow;
|
||||
}
|
||||
|
||||
//
|
||||
mConditions.hMarketConditions.isTrendSwitchedToBearish &&
|
||||
(mConditions.lMarketConditions.isTrendBearish &&
|
||||
mConditions.mMarketConditions.isTrendBearish &&
|
||||
mConditions.sMarketConditions.isTrendBearish &&
|
||||
mConditions.cMarketConditions.isTrendBearish)
|
||||
//
|
||||
;
|
||||
// Hind Market ...
|
||||
double hUpperLow = hMarket.don.GetUpperL(cIndex);
|
||||
bool hHasX786 = hMarket.HasX786ShortConditions();
|
||||
if (hHasX786)
|
||||
{
|
||||
sl = hUpperLow;
|
||||
}
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
// isCMStrShort
|
||||
// //
|
||||
// ||
|
||||
// //
|
||||
// isSMStrShort
|
||||
// //
|
||||
// ||
|
||||
//
|
||||
isMMStrShort
|
||||
cHasX786
|
||||
//
|
||||
||
|
||||
//
|
||||
isLMStrShort
|
||||
sHasX786
|
||||
//
|
||||
||
|
||||
//
|
||||
isHMStrShort
|
||||
mHasX786
|
||||
//
|
||||
||
|
||||
//
|
||||
lHasX786
|
||||
//
|
||||
// ||
|
||||
// //
|
||||
// hHasX786
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
r2r = 2;
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -737,9 +737,9 @@ public:
|
||||
// Make them Configurable ...
|
||||
int maxTrailTPs = 5;
|
||||
// int levelsOnClose = 6;
|
||||
int riskFreeLevel = 4;
|
||||
int riskFreeLevel = 0;
|
||||
int requiredAgeForTrail = 0;
|
||||
int requiredDistanceForTrail = 10;
|
||||
int requiredDistanceForTrail = 50;
|
||||
|
||||
//
|
||||
int positionsCount = ArraySize(positions);
|
||||
@@ -811,13 +811,19 @@ public:
|
||||
|
||||
//
|
||||
double slDiff = PointToPrice(priceDistance, iPosition.symbol);
|
||||
double appliedSL = slDiff;
|
||||
double appliedSL = slDiff / 2;
|
||||
|
||||
//
|
||||
// double sl =
|
||||
// IsLong(iPosition.type)
|
||||
// ? iPosition.sl + appliedSL
|
||||
// : iPosition.sl - appliedSL;
|
||||
|
||||
//
|
||||
double sl =
|
||||
IsLong(iPosition.type)
|
||||
? iPosition.sl + appliedSL
|
||||
: iPosition.sl - appliedSL;
|
||||
? iPosition.entry + appliedSL
|
||||
: iPosition.entry - appliedSL;
|
||||
|
||||
//
|
||||
// double sl =
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,415 @@
|
||||
//
|
||||
int zIndex = 0;
|
||||
int cIndex = zIndex + 1;
|
||||
int pIndex = cIndex + 1;
|
||||
|
||||
//
|
||||
// XSTR ...
|
||||
ENUM_XSTR_TREND_STATES cStrState = cMarket
|
||||
.str
|
||||
.GetState(cIndex);
|
||||
double cStrTrend = cMarket.str.GetTrend(cIndex);
|
||||
bool isCStrBullish = cStrState == X_STR_BULLISH;
|
||||
bool isCStrBearish = cStrState == X_STR_BEARISH;
|
||||
|
||||
//
|
||||
ENUM_XSTR_TREND_STATES pStrState = cMarket
|
||||
.str
|
||||
.GetState(pIndex);
|
||||
double pStrTrend = cMarket.str.GetTrend(pIndex);
|
||||
bool isPStrBullish = pStrState == X_STR_BULLISH;
|
||||
bool isPStrBearish = pStrState == X_STR_BEARISH;
|
||||
|
||||
//
|
||||
bool isTrendBullish = isCStrBullish;
|
||||
bool isTrendBearish = isCStrBearish;
|
||||
|
||||
//
|
||||
bool isTrendSwitchedToBullish =
|
||||
//
|
||||
isCStrBullish &&
|
||||
!isPStrBullish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isTrendSwitchedToBearish =
|
||||
//
|
||||
isCStrBearish &&
|
||||
!isPStrBearish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// XCHE ...
|
||||
|
||||
//
|
||||
double cCHELongExit1 = cMarket.che.GetLongExit1(cIndex);
|
||||
double cCHELongExit2 = cMarket.che.GetLongExit2(cIndex);
|
||||
|
||||
//
|
||||
double pCHELongExit1 = cMarket.che.GetLongExit1(pIndex);
|
||||
double pCHELongExit2 = cMarket.che.GetLongExit2(pIndex);
|
||||
|
||||
//
|
||||
double cCHEShortExit1 = cMarket.che.GetShortExit1(cIndex);
|
||||
double cCHEShortExit2 = cMarket.che.GetShortExit2(cIndex);
|
||||
|
||||
//
|
||||
double pCHEShortExit1 = cMarket.che.GetShortExit1(pIndex);
|
||||
double pCHEShortExit2 = cMarket.che.GetShortExit2(pIndex);
|
||||
|
||||
//
|
||||
bool CCHEHasLongExit1 = NotEmpty(cCHELongExit1);
|
||||
bool CCHEHasLongExit2 = NotEmpty(cCHELongExit2);
|
||||
|
||||
//
|
||||
bool CCHEHasShortExit1 = NotEmpty(cCHEShortExit1);
|
||||
bool CCHEHasShortExit2 = NotEmpty(cCHEShortExit2);
|
||||
|
||||
//
|
||||
bool PCHEHasLongExit1 = NotEmpty(pCHELongExit1);
|
||||
bool PCHEHasLongExit2 = NotEmpty(pCHELongExit2);
|
||||
|
||||
//
|
||||
bool PCHEHasShortExit1 = NotEmpty(pCHEShortExit1);
|
||||
bool PCHEHasShortExit2 = NotEmpty(pCHEShortExit2);
|
||||
|
||||
//
|
||||
bool isCCHEBullish =
|
||||
//
|
||||
CCHEHasLongExit1 &&
|
||||
CCHEHasLongExit2
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isCCHEBearish =
|
||||
//
|
||||
CCHEHasShortExit1 &&
|
||||
CCHEHasShortExit2
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isPCHEBullish =
|
||||
//
|
||||
PCHEHasLongExit1 &&
|
||||
PCHEHasLongExit2
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isPCHEBearish =
|
||||
//
|
||||
PCHEHasShortExit1 &&
|
||||
PCHEHasShortExit2
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isCHEBullish = isCCHEBullish;
|
||||
bool isCHEBearish = isCCHEBearish;
|
||||
bool isCHESwitchedToBullish =
|
||||
//
|
||||
isCCHEBullish &&
|
||||
!isPCHEBullish
|
||||
//
|
||||
;
|
||||
bool isCHESwitchedToBearish =
|
||||
//
|
||||
isCCHEBearish &&
|
||||
!isPCHEBearish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// XPV ...
|
||||
|
||||
double cPVPeak = cMarket.pv.GetPeak(cIndex);
|
||||
double cPVVale = cMarket.pv.GetVale(cIndex);
|
||||
|
||||
//
|
||||
double pPVPeak = cMarket.pv.GetPeak(pIndex);
|
||||
double pPVVale = cMarket.pv.GetVale(pIndex);
|
||||
|
||||
//
|
||||
double cPVSup = cMarket.pv.GetSupport(cIndex);
|
||||
double pPVSup = cMarket.pv.GetSupport(pIndex);
|
||||
|
||||
//
|
||||
double cPVRes = cMarket.pv.GetResistance(cIndex);
|
||||
double pPVRes = cMarket.pv.GetResistance(pIndex);
|
||||
|
||||
//
|
||||
double cPVFib1 = cMarket.pv.GetFib1(cIndex);
|
||||
double cPVFib2 = cMarket.pv.GetFib2(cIndex);
|
||||
double cPVFib3 = cMarket.pv.GetFib3(cIndex);
|
||||
double cPVFib4 = cMarket.pv.GetFib4(cIndex);
|
||||
double cPVFib5 = cMarket.pv.GetFib5(cIndex);
|
||||
|
||||
//
|
||||
double pPVFib1 = cMarket.pv.GetFib1(pIndex);
|
||||
double pPVFib2 = cMarket.pv.GetFib2(pIndex);
|
||||
double pPVFib3 = cMarket.pv.GetFib3(pIndex);
|
||||
double pPVFib4 = cMarket.pv.GetFib4(pIndex);
|
||||
double pPVFib5 = cMarket.pv.GetFib5(pIndex);
|
||||
|
||||
//
|
||||
bool isNewPeak = cPVPeak != pPVPeak;
|
||||
bool isNewPeakUnderLast =
|
||||
//
|
||||
isNewPeak &&
|
||||
cPVPeak < pPVPeak
|
||||
//
|
||||
;
|
||||
bool isNewPeakOverLast =
|
||||
//
|
||||
isNewPeak &&
|
||||
cPVPeak > pPVPeak
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isNewVale = cPVVale != pPVVale;
|
||||
bool isNewValeUnderLast =
|
||||
//
|
||||
isNewVale &&
|
||||
cPVVale < pPVVale
|
||||
//
|
||||
;
|
||||
bool isNewValeOverLast =
|
||||
//
|
||||
isNewVale &&
|
||||
cPVVale > pPVVale
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isFiboIncreased =
|
||||
//
|
||||
cPVFib1 > pPVFib1 &&
|
||||
cPVFib2 > pPVFib2 &&
|
||||
cPVFib3 > pPVFib3 &&
|
||||
cPVFib4 > pPVFib4 &&
|
||||
cPVFib5 > pPVFib5
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isFiboDecreased =
|
||||
//
|
||||
cPVFib1 < pPVFib1 &&
|
||||
cPVFib2 < pPVFib2 &&
|
||||
cPVFib3 < pPVFib3 &&
|
||||
cPVFib4 < pPVFib4 &&
|
||||
cPVFib5 < pPVFib5
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isFiboSectionChanged =
|
||||
//
|
||||
(isFiboDecreased &&
|
||||
isNewPeakUnderLast)
|
||||
//
|
||||
||
|
||||
//
|
||||
(isFiboIncreased &&
|
||||
isNewValeOverLast)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// XFI ...
|
||||
|
||||
//
|
||||
double cFI = fiHelper.GetMain(cIndex);
|
||||
double pFI = fiHelper.GetMain(pIndex);
|
||||
|
||||
//
|
||||
bool isCFIOverZero = cFI > 0;
|
||||
bool isCFIUnderZero = cFI > 0;
|
||||
|
||||
//
|
||||
bool isPFIOverZero = pFI > 0;
|
||||
bool isPFIUnderZero = pFI > 0;
|
||||
|
||||
//
|
||||
bool isFICrossedOverZero =
|
||||
//
|
||||
isCFIOverZero &&
|
||||
!isPFIOverZero
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isFICrossedUnderZero =
|
||||
//
|
||||
isCFIUnderZero &&
|
||||
!isPFIUnderZero
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// XHK ...
|
||||
|
||||
//
|
||||
XOHCL cSMHKBar;
|
||||
cMarket.hk.SMAsOHCL(
|
||||
cSMHKBar,
|
||||
cIndex //
|
||||
);
|
||||
|
||||
//
|
||||
XOHCL pSMHKBar;
|
||||
cMarket.hk.SMAsOHCL(
|
||||
pSMHKBar,
|
||||
pIndex //
|
||||
);
|
||||
|
||||
//
|
||||
bool isCSMHKBullish = cSMHKBar.IsBullish();
|
||||
bool isCSMHKBearish = cSMHKBar.IsBearish();
|
||||
|
||||
//
|
||||
bool isPSMHKBullish = pSMHKBar.IsBullish();
|
||||
bool isPSMHKBearish = pSMHKBar.IsBearish();
|
||||
|
||||
//
|
||||
bool isSMHKSwitchedToBullish =
|
||||
//
|
||||
isCSMHKBullish &&
|
||||
isPSMHKBearish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isSMHKSwitchedToBearish =
|
||||
//
|
||||
isCSMHKBearish &&
|
||||
isPSMHKBullish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// XTD ...
|
||||
|
||||
//
|
||||
double cTDBullish = tdHelper.GetBullish(cIndex);
|
||||
double pTDBullish = tdHelper.GetBullish(pIndex);
|
||||
|
||||
//
|
||||
double cTDBearish = tdHelper.GetBearish(cIndex);
|
||||
double pTDBearish = tdHelper.GetBearish(pIndex);
|
||||
|
||||
//
|
||||
bool isCTDBullish =
|
||||
//
|
||||
cTDBullish > cTDBearish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isCTDBearish =
|
||||
//
|
||||
cTDBearish > cTDBullish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isPTDBullish =
|
||||
//
|
||||
pTDBullish > pTDBearish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isPTDBearish =
|
||||
//
|
||||
pTDBearish > pTDBullish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isTDBullish = isCTDBullish;
|
||||
bool isTDBearish = isCTDBearish;
|
||||
bool isTDSwitchedToBullish =
|
||||
//
|
||||
isCTDBullish &&
|
||||
!isPTDBullish
|
||||
//
|
||||
;
|
||||
bool isTDSwitchedToBearsih =
|
||||
//
|
||||
isCTDBearish &&
|
||||
!isPTDBearish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// XDON ...
|
||||
|
||||
//
|
||||
XOHCL cBar = cMarket.GetBar(cIndex);
|
||||
XOHCL pBar = cMarket.GetBar(pIndex);
|
||||
|
||||
//
|
||||
double cDONUpperOpen = cMarket.don.GetUpperO(cIndex);
|
||||
double cDONUpperClose = cMarket.don.GetUpperC(cIndex);
|
||||
double cDONUpperHigh = cMarket.don.GetUpperH(cIndex);
|
||||
double cDONUpperLow = cMarket.don.GetUpperL(cIndex);
|
||||
|
||||
//
|
||||
double cDONLowerOpen = cMarket.don.GetLowerO(cIndex);
|
||||
double cDONLowerClose = cMarket.don.GetLowerC(cIndex);
|
||||
double cDONLowerHigh = cMarket.don.GetLowerH(cIndex);
|
||||
double cDONLowerLow = cMarket.don.GetLowerL(cIndex);
|
||||
|
||||
//
|
||||
double pDONUpperOpen = cMarket.don.GetUpperO(pIndex);
|
||||
double pDONUpperClose = cMarket.don.GetUpperC(pIndex);
|
||||
double pDONUpperHigh = cMarket.don.GetUpperH(pIndex);
|
||||
double pDONUpperLow = cMarket.don.GetUpperL(pIndex);
|
||||
|
||||
//
|
||||
double pDONLowerOpen = cMarket.don.GetLowerO(pIndex);
|
||||
double pDONLowerClose = cMarket.don.GetLowerC(pIndex);
|
||||
double pDONLowerHigh = cMarket.don.GetLowerH(pIndex);
|
||||
double pDONLowerLow = cMarket.don.GetLowerL(pIndex);
|
||||
|
||||
//
|
||||
bool isBarCrossedDownDONLowerHigh =
|
||||
//
|
||||
cBar.IsBreakDown(pDONLowerHigh)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isBarCrossedUpDONLowerHigh =
|
||||
//
|
||||
cBar.IsBreakUp(pDONLowerHigh)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
isSMHKSwitchedToBullish
|
||||
// isSMHKSwitchedToBearish
|
||||
// isBarCrossedUpDONLowerHigh
|
||||
//
|
||||
;
|
||||
if (result)
|
||||
{
|
||||
Print("Salam");
|
||||
}
|
||||
|
||||
//
|
||||
if (result) {
|
||||
r2r = 2;
|
||||
sl = cDONLowerHigh;
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -40,8 +40,8 @@ bool x121EAAllowShort = true; // Allow Short Trades
|
||||
int x121EAManageInterval = 0; // Manager Check Intervals Seconds
|
||||
int x121EAMaxAllowedPositions = 5; // Max Allowed Positions
|
||||
double x121EAMaxAllowedSpread = 0; // Max Allowed Spred for Opening Trades
|
||||
double x121EAMinProfitPerTrade = 3; // Min Profit Per Trade based On Volume Factor (Hedge)
|
||||
double x121EAMinProfitPerVolumeFactor = 0.01; // Min Volume Factor for Calculating Profit (Hedge)
|
||||
double x121EAMinProfitPerTrade = 0; // Min Profit Per Trade based On Volume Factor (Hedge)
|
||||
double x121EAMinProfitPerVolumeFactor = 0.0; // Min Volume Factor for Calculating Profit (Hedge)
|
||||
double x121EAMaxAllowedDrawdownFactor = 0.002; // Max Allowed Drawdown Factor
|
||||
//
|
||||
double x121EAVolume = 0.01; // Static Volume
|
||||
@@ -191,12 +191,12 @@ bool InitialEA()
|
||||
//
|
||||
// Define Signallers ...
|
||||
ENUM_X121_SIGNAL_PROVIDERS signallers[];
|
||||
// Add(X786, signallers);
|
||||
Add(X786, signallers);
|
||||
// Add(X110, signallers);
|
||||
// Add(X121, signallers);
|
||||
// Add(X128, signallers);
|
||||
// Add(X92, signallers);
|
||||
Add(XTEST, signallers);
|
||||
// Add(XTEST, signallers);
|
||||
// GetAllX121SignalProviders(signallers);
|
||||
|
||||
//
|
||||
@@ -300,7 +300,7 @@ void ConfigureDescriptor(
|
||||
//
|
||||
// XHK ...
|
||||
iDescriptor.inputs.hkInputs.drawHikenAshi = false;
|
||||
iDescriptor.inputs.hkInputs.drawSmoothedHikenAshi = false;
|
||||
iDescriptor.inputs.hkInputs.drawSmoothedHikenAshi = true;
|
||||
|
||||
//
|
||||
// XMRB ...
|
||||
@@ -351,13 +351,13 @@ void ConfigureDescriptor(
|
||||
//
|
||||
// XDON ...
|
||||
iDescriptor.inputs.donInputs.showOpen = false;
|
||||
iDescriptor.inputs.donInputs.showHigh = false;
|
||||
iDescriptor.inputs.donInputs.showHigh = true;
|
||||
iDescriptor.inputs.donInputs.showClose = false;
|
||||
iDescriptor.inputs.donInputs.showLow = false;
|
||||
|
||||
//
|
||||
// XSTR ...
|
||||
iDescriptor.inputs.strInputs.showTrends = false;
|
||||
iDescriptor.inputs.strInputs.showTrends = true;
|
||||
iDescriptor.inputs.strInputs.fillTrends = false;
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user