complete X786 ...
This commit is contained in:
@@ -265,6 +265,7 @@ public:
|
|||||||
// Current ...
|
// Current ...
|
||||||
cMarketInputs.pvInputs = this.pvInputs;
|
cMarketInputs.pvInputs = this.pvInputs;
|
||||||
cMarketInputs.zgInputs = this.zgInputs;
|
cMarketInputs.zgInputs = this.zgInputs;
|
||||||
|
cMarketInputs.tdInputs = this.tdInputs;
|
||||||
cMarketInputs.mcInputs = this.mcInputs;
|
cMarketInputs.mcInputs = this.mcInputs;
|
||||||
cMarketInputs.hkInputs = this.hkInputs;
|
cMarketInputs.hkInputs = this.hkInputs;
|
||||||
cMarketInputs.mrbInputs = this.mrbInputs;
|
cMarketInputs.mrbInputs = this.mrbInputs;
|
||||||
@@ -291,6 +292,7 @@ public:
|
|||||||
// Short ...
|
// Short ...
|
||||||
sMarketInputs.pvInputs = this.pvInputs;
|
sMarketInputs.pvInputs = this.pvInputs;
|
||||||
sMarketInputs.zgInputs = this.zgInputs;
|
sMarketInputs.zgInputs = this.zgInputs;
|
||||||
|
sMarketInputs.tdInputs = this.tdInputs;
|
||||||
sMarketInputs.mcInputs = this.mcInputs;
|
sMarketInputs.mcInputs = this.mcInputs;
|
||||||
sMarketInputs.hkInputs = this.hkInputs;
|
sMarketInputs.hkInputs = this.hkInputs;
|
||||||
sMarketInputs.mrbInputs = this.mrbInputs;
|
sMarketInputs.mrbInputs = this.mrbInputs;
|
||||||
@@ -317,6 +319,7 @@ public:
|
|||||||
// Medium ...
|
// Medium ...
|
||||||
mMarketInputs.pvInputs = this.pvInputs;
|
mMarketInputs.pvInputs = this.pvInputs;
|
||||||
mMarketInputs.zgInputs = this.zgInputs;
|
mMarketInputs.zgInputs = this.zgInputs;
|
||||||
|
mMarketInputs.tdInputs = this.tdInputs;
|
||||||
mMarketInputs.mcInputs = this.mcInputs;
|
mMarketInputs.mcInputs = this.mcInputs;
|
||||||
mMarketInputs.hkInputs = this.hkInputs;
|
mMarketInputs.hkInputs = this.hkInputs;
|
||||||
mMarketInputs.mrbInputs = this.mrbInputs;
|
mMarketInputs.mrbInputs = this.mrbInputs;
|
||||||
@@ -343,6 +346,7 @@ public:
|
|||||||
// Long ...
|
// Long ...
|
||||||
lMarketInputs.pvInputs = this.pvInputs;
|
lMarketInputs.pvInputs = this.pvInputs;
|
||||||
lMarketInputs.zgInputs = this.zgInputs;
|
lMarketInputs.zgInputs = this.zgInputs;
|
||||||
|
lMarketInputs.tdInputs = this.tdInputs;
|
||||||
lMarketInputs.mcInputs = this.mcInputs;
|
lMarketInputs.mcInputs = this.mcInputs;
|
||||||
lMarketInputs.hkInputs = this.hkInputs;
|
lMarketInputs.hkInputs = this.hkInputs;
|
||||||
lMarketInputs.mrbInputs = this.mrbInputs;
|
lMarketInputs.mrbInputs = this.mrbInputs;
|
||||||
@@ -369,6 +373,7 @@ public:
|
|||||||
// Hind ...
|
// Hind ...
|
||||||
hMarketInputs.pvInputs = this.pvInputs;
|
hMarketInputs.pvInputs = this.pvInputs;
|
||||||
hMarketInputs.zgInputs = this.zgInputs;
|
hMarketInputs.zgInputs = this.zgInputs;
|
||||||
|
hMarketInputs.tdInputs = this.tdInputs;
|
||||||
hMarketInputs.mcInputs = this.mcInputs;
|
hMarketInputs.mcInputs = this.mcInputs;
|
||||||
hMarketInputs.hkInputs = this.hkInputs;
|
hMarketInputs.hkInputs = this.hkInputs;
|
||||||
hMarketInputs.mrbInputs = this.mrbInputs;
|
hMarketInputs.mrbInputs = this.mrbInputs;
|
||||||
@@ -3091,17 +3096,19 @@ public:
|
|||||||
? entry - risk
|
? entry - risk
|
||||||
: entry + risk;
|
: entry + risk;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
//
|
{
|
||||||
// TODOO: Remove this ...
|
//
|
||||||
sl = hasLong
|
// TODOO: Remove this ...
|
||||||
? sMarket.pv.GetMCLL(0)
|
sl = hasLong
|
||||||
: sMarket.pv.GetMCHH(0);
|
? sMarket.pv.GetMCLL(0)
|
||||||
double risk = MathAbs(entry - sl);
|
: sMarket.pv.GetMCHH(0);
|
||||||
double reward = risk * r2r;
|
double risk = MathAbs(entry - sl);
|
||||||
tp = hasLong
|
double reward = risk * r2r;
|
||||||
? entry + reward
|
tp = hasLong
|
||||||
: entry - reward;
|
? entry + reward
|
||||||
|
: entry - reward;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
result = mSignal.Prepare(
|
result = mSignal.Prepare(
|
||||||
@@ -7570,422 +7577,6 @@ private:
|
|||||||
//
|
//
|
||||||
bool result = false;
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -8003,86 +7594,85 @@ private:
|
|||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isCMStrLong =
|
int zIndex = 0;
|
||||||
//
|
int cIndex = zIndex + 1;
|
||||||
mConditions.cMarketConditions.isTrendSwitchedToBullish &&
|
int pIndex = cIndex + 1;
|
||||||
(mConditions.hMarketConditions.isTrendBullish &&
|
|
||||||
mConditions.lMarketConditions.isTrendBullish &&
|
|
||||||
mConditions.mMarketConditions.isTrendBullish &&
|
|
||||||
mConditions.sMarketConditions.isTrendBullish)
|
|
||||||
//
|
|
||||||
;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isSMStrLong =
|
// Current Market ...
|
||||||
//
|
double cLowerHigh = cMarket.don.GetLowerH(cIndex);
|
||||||
mConditions.sMarketConditions.isTrendSwitchedToBullish &&
|
bool cHasX786 = cMarket.HasX786LongConditions();
|
||||||
(mConditions.hMarketConditions.isTrendBullish &&
|
if (cHasX786)
|
||||||
mConditions.lMarketConditions.isTrendBullish &&
|
{
|
||||||
mConditions.mMarketConditions.isTrendBullish &&
|
sl = cLowerHigh;
|
||||||
mConditions.cMarketConditions.isTrendBullish)
|
}
|
||||||
//
|
|
||||||
;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isMMStrLong =
|
// Short Market ...
|
||||||
//
|
double sLowerHigh = sMarket.don.GetLowerH(cIndex);
|
||||||
mConditions.mMarketConditions.isTrendSwitchedToBullish &&
|
bool sHasX786 = sMarket.HasX786LongConditions();
|
||||||
(mConditions.hMarketConditions.isTrendBullish &&
|
if (sHasX786)
|
||||||
mConditions.lMarketConditions.isTrendBullish &&
|
{
|
||||||
mConditions.sMarketConditions.isTrendBullish &&
|
sl = sLowerHigh;
|
||||||
mConditions.cMarketConditions.isTrendBullish)
|
}
|
||||||
//
|
|
||||||
;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isLMStrLong =
|
// Medium Market ...
|
||||||
//
|
double mLowerHigh = mMarket.don.GetLowerH(cIndex);
|
||||||
mConditions.lMarketConditions.isTrendSwitchedToBullish &&
|
bool mHasX786 = mMarket.HasX786LongConditions();
|
||||||
(mConditions.hMarketConditions.isTrendBullish &&
|
if (mHasX786)
|
||||||
mConditions.mMarketConditions.isTrendBullish &&
|
{
|
||||||
mConditions.sMarketConditions.isTrendBullish &&
|
sl = mLowerHigh;
|
||||||
mConditions.cMarketConditions.isTrendBullish)
|
}
|
||||||
//
|
|
||||||
;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isHMStrLong =
|
// Long Market ...
|
||||||
//
|
double lLowerHigh = lMarket.don.GetLowerH(cIndex);
|
||||||
mConditions.hMarketConditions.isTrendSwitchedToBullish &&
|
bool lHasX786 = lMarket.HasX786LongConditions();
|
||||||
(mConditions.lMarketConditions.isTrendBullish &&
|
if (lHasX786)
|
||||||
mConditions.mMarketConditions.isTrendBullish &&
|
{
|
||||||
mConditions.sMarketConditions.isTrendBullish &&
|
sl = lLowerHigh;
|
||||||
mConditions.cMarketConditions.isTrendBullish)
|
}
|
||||||
//
|
|
||||||
;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// bool isScorePassed = IsScorePassedForLong();
|
// Hind Market ...
|
||||||
|
double hLowerHigh = hMarket.don.GetLowerH(cIndex);
|
||||||
|
bool hHasX786 = hMarket.HasX786LongConditions();
|
||||||
|
if (hHasX786)
|
||||||
|
{
|
||||||
|
sl = hLowerHigh;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
result =
|
result =
|
||||||
//
|
//
|
||||||
// isCMStrLong
|
cHasX786
|
||||||
// //
|
|
||||||
// ||
|
|
||||||
// //
|
|
||||||
// isSMStrLong
|
|
||||||
// //
|
|
||||||
// ||
|
|
||||||
//
|
|
||||||
isMMStrLong
|
|
||||||
//
|
//
|
||||||
||
|
||
|
||||||
//
|
//
|
||||||
isLMStrLong
|
sHasX786
|
||||||
//
|
//
|
||||||
||
|
||
|
||||||
//
|
//
|
||||||
isHMStrLong
|
mHasX786
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
lHasX786
|
||||||
|
//
|
||||||
|
// ||
|
||||||
|
// //
|
||||||
|
// hHasX786
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
r2r = 2;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -9155,83 +8745,85 @@ private:
|
|||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isCMStrShort =
|
int zIndex = 0;
|
||||||
//
|
int cIndex = zIndex + 1;
|
||||||
mConditions.cMarketConditions.isTrendSwitchedToBearish &&
|
int pIndex = cIndex + 1;
|
||||||
(mConditions.hMarketConditions.isTrendBearish &&
|
|
||||||
mConditions.lMarketConditions.isTrendBearish &&
|
|
||||||
mConditions.mMarketConditions.isTrendBearish &&
|
|
||||||
mConditions.sMarketConditions.isTrendBearish)
|
|
||||||
//
|
|
||||||
;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isSMStrShort =
|
// Current Market ...
|
||||||
//
|
double cUpperLow = cMarket.don.GetUpperL(cIndex);
|
||||||
mConditions.sMarketConditions.isTrendSwitchedToBearish &&
|
bool cHasX786 = cMarket.HasX786ShortConditions();
|
||||||
(mConditions.hMarketConditions.isTrendBearish &&
|
if (cHasX786)
|
||||||
mConditions.lMarketConditions.isTrendBearish &&
|
{
|
||||||
mConditions.mMarketConditions.isTrendBearish &&
|
sl = cUpperLow;
|
||||||
mConditions.cMarketConditions.isTrendBearish)
|
}
|
||||||
//
|
|
||||||
;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isMMStrShort =
|
// Short Market ...
|
||||||
//
|
double sUpperLow = sMarket.don.GetUpperL(cIndex);
|
||||||
mConditions.mMarketConditions.isTrendSwitchedToBearish &&
|
bool sHasX786 = sMarket.HasX786ShortConditions();
|
||||||
(mConditions.hMarketConditions.isTrendBearish &&
|
if (sHasX786)
|
||||||
mConditions.lMarketConditions.isTrendBearish &&
|
{
|
||||||
mConditions.sMarketConditions.isTrendBearish &&
|
sl = sUpperLow;
|
||||||
mConditions.cMarketConditions.isTrendBearish)
|
}
|
||||||
//
|
|
||||||
;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isLMStrShort =
|
// Medium Market ...
|
||||||
//
|
double mUpperLow = mMarket.don.GetUpperL(cIndex);
|
||||||
mConditions.lMarketConditions.isTrendSwitchedToBearish &&
|
bool mHasX786 = mMarket.HasX786ShortConditions();
|
||||||
(mConditions.hMarketConditions.isTrendBearish &&
|
if (mHasX786)
|
||||||
mConditions.mMarketConditions.isTrendBearish &&
|
{
|
||||||
mConditions.sMarketConditions.isTrendBearish &&
|
sl = mUpperLow;
|
||||||
mConditions.cMarketConditions.isTrendBearish)
|
}
|
||||||
//
|
|
||||||
;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isHMStrShort =
|
// Long Market ...
|
||||||
//
|
double lUpperLow = lMarket.don.GetUpperL(cIndex);
|
||||||
mConditions.hMarketConditions.isTrendSwitchedToBearish &&
|
bool lHasX786 = lMarket.HasX786ShortConditions();
|
||||||
(mConditions.lMarketConditions.isTrendBearish &&
|
if (lHasX786)
|
||||||
mConditions.mMarketConditions.isTrendBearish &&
|
{
|
||||||
mConditions.sMarketConditions.isTrendBearish &&
|
sl = lUpperLow;
|
||||||
mConditions.cMarketConditions.isTrendBearish)
|
}
|
||||||
//
|
|
||||||
;
|
//
|
||||||
|
// Hind Market ...
|
||||||
|
double hUpperLow = hMarket.don.GetUpperL(cIndex);
|
||||||
|
bool hHasX786 = hMarket.HasX786ShortConditions();
|
||||||
|
if (hHasX786)
|
||||||
|
{
|
||||||
|
sl = hUpperLow;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
result =
|
result =
|
||||||
//
|
//
|
||||||
// isCMStrShort
|
cHasX786
|
||||||
// //
|
|
||||||
// ||
|
|
||||||
// //
|
|
||||||
// isSMStrShort
|
|
||||||
// //
|
|
||||||
// ||
|
|
||||||
//
|
|
||||||
isMMStrShort
|
|
||||||
//
|
//
|
||||||
||
|
||
|
||||||
//
|
//
|
||||||
isLMStrShort
|
sHasX786
|
||||||
//
|
//
|
||||||
||
|
||
|
||||||
//
|
//
|
||||||
isHMStrShort
|
mHasX786
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
lHasX786
|
||||||
|
//
|
||||||
|
// ||
|
||||||
|
// //
|
||||||
|
// hHasX786
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
r2r = 2;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -730,16 +730,16 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
void HandleTrailManagement(XPosition &positions[])
|
void HandleTrailManagement(XPosition &positions[])
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// TODO:
|
// TODO:
|
||||||
// Make them Configurable ...
|
// Make them Configurable ...
|
||||||
int maxTrailTPs = 5;
|
int maxTrailTPs = 5;
|
||||||
// int levelsOnClose = 6;
|
// int levelsOnClose = 6;
|
||||||
int riskFreeLevel = 4;
|
int riskFreeLevel = 0;
|
||||||
int requiredAgeForTrail = 0;
|
int requiredAgeForTrail = 0;
|
||||||
int requiredDistanceForTrail = 10;
|
int requiredDistanceForTrail = 50;
|
||||||
|
|
||||||
//
|
//
|
||||||
int positionsCount = ArraySize(positions);
|
int positionsCount = ArraySize(positions);
|
||||||
@@ -811,13 +811,19 @@ public:
|
|||||||
|
|
||||||
//
|
//
|
||||||
double slDiff = PointToPrice(priceDistance, iPosition.symbol);
|
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 =
|
double sl =
|
||||||
IsLong(iPosition.type)
|
IsLong(iPosition.type)
|
||||||
? iPosition.sl + appliedSL
|
? iPosition.entry + appliedSL
|
||||||
: iPosition.sl - appliedSL;
|
: iPosition.entry - appliedSL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// double sl =
|
// 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 x121EAManageInterval = 0; // Manager Check Intervals Seconds
|
||||||
int x121EAMaxAllowedPositions = 5; // Max Allowed Positions
|
int x121EAMaxAllowedPositions = 5; // Max Allowed Positions
|
||||||
double x121EAMaxAllowedSpread = 0; // Max Allowed Spred for Opening Trades
|
double x121EAMaxAllowedSpread = 0; // Max Allowed Spred for Opening Trades
|
||||||
double x121EAMinProfitPerTrade = 3; // Min Profit Per Trade based On Volume Factor (Hedge)
|
double x121EAMinProfitPerTrade = 0; // Min Profit Per Trade based On Volume Factor (Hedge)
|
||||||
double x121EAMinProfitPerVolumeFactor = 0.01; // Min Volume Factor for Calculating Profit (Hedge)
|
double x121EAMinProfitPerVolumeFactor = 0.0; // Min Volume Factor for Calculating Profit (Hedge)
|
||||||
double x121EAMaxAllowedDrawdownFactor = 0.002; // Max Allowed Drawdown Factor
|
double x121EAMaxAllowedDrawdownFactor = 0.002; // Max Allowed Drawdown Factor
|
||||||
//
|
//
|
||||||
double x121EAVolume = 0.01; // Static Volume
|
double x121EAVolume = 0.01; // Static Volume
|
||||||
@@ -191,12 +191,12 @@ bool InitialEA()
|
|||||||
//
|
//
|
||||||
// Define Signallers ...
|
// Define Signallers ...
|
||||||
ENUM_X121_SIGNAL_PROVIDERS signallers[];
|
ENUM_X121_SIGNAL_PROVIDERS signallers[];
|
||||||
// Add(X786, signallers);
|
Add(X786, signallers);
|
||||||
// Add(X110, signallers);
|
// Add(X110, signallers);
|
||||||
// Add(X121, signallers);
|
// Add(X121, signallers);
|
||||||
// Add(X128, signallers);
|
// Add(X128, signallers);
|
||||||
// Add(X92, signallers);
|
// Add(X92, signallers);
|
||||||
Add(XTEST, signallers);
|
// Add(XTEST, signallers);
|
||||||
// GetAllX121SignalProviders(signallers);
|
// GetAllX121SignalProviders(signallers);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -300,7 +300,7 @@ void ConfigureDescriptor(
|
|||||||
//
|
//
|
||||||
// XHK ...
|
// XHK ...
|
||||||
iDescriptor.inputs.hkInputs.drawHikenAshi = false;
|
iDescriptor.inputs.hkInputs.drawHikenAshi = false;
|
||||||
iDescriptor.inputs.hkInputs.drawSmoothedHikenAshi = false;
|
iDescriptor.inputs.hkInputs.drawSmoothedHikenAshi = true;
|
||||||
|
|
||||||
//
|
//
|
||||||
// XMRB ...
|
// XMRB ...
|
||||||
@@ -351,13 +351,13 @@ void ConfigureDescriptor(
|
|||||||
//
|
//
|
||||||
// XDON ...
|
// XDON ...
|
||||||
iDescriptor.inputs.donInputs.showOpen = false;
|
iDescriptor.inputs.donInputs.showOpen = false;
|
||||||
iDescriptor.inputs.donInputs.showHigh = false;
|
iDescriptor.inputs.donInputs.showHigh = true;
|
||||||
iDescriptor.inputs.donInputs.showClose = false;
|
iDescriptor.inputs.donInputs.showClose = false;
|
||||||
iDescriptor.inputs.donInputs.showLow = false;
|
iDescriptor.inputs.donInputs.showLow = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// XSTR ...
|
// XSTR ...
|
||||||
iDescriptor.inputs.strInputs.showTrends = false;
|
iDescriptor.inputs.strInputs.showTrends = true;
|
||||||
iDescriptor.inputs.strInputs.fillTrends = false;
|
iDescriptor.inputs.strInputs.fillTrends = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user