Files
xMQL5/MQLTestWorkspace/BKPS/BKP/guard.checking.mq5
T
2024-04-27 01:16:17 +03:30

87 lines
2.0 KiB
Plaintext

//
bool x786CanTrailLongStop =
//
false
// ll1 > ll2 &&
// c0Price > ll2
// mConditions.xcheInfo.longExit2 > mConditions2.xcheInfo.longExit2
//
;
if (x786CanTrailLongStop)
{
//
XGuard guard;
//
guard.symbol = mSymbol;
guard.period = mPeriod;
guard.provider = ToString(X786);
guard.action = X_GUARD_ACTION_TRAIL_STOP;
//
guard.type = POSITION_TYPE_BUY;
guard.dblPayLoad = mConditions.xcheInfo.longExit2;
//
Add(
guard,
guards);
}
//
bool x786CanTrailShortStop =
//
mConditions.xcheInfo.shortExit2 < mConditions2.xcheInfo.shortExit2
//
;
if (x786CanTrailShortStop)
{
//
XGuard guard;
//
guard.symbol = mSymbol;
guard.period = mPeriod;
guard.provider = ToString(X786);
guard.action = X_GUARD_ACTION_TRAIL_STOP;
//
guard.type = POSITION_TYPE_SELL;
guard.dblPayLoad = mConditions.xcheInfo.shortExit2;
//
Add(
guard,
guards);
}
//
// X128 Guard ...
//
bool x128HasLongForceCloseGuard =
//
// isXAMACrossedUnderXTM
false
//
;
if (x128HasLongForceCloseGuard)
{
//
XGuard guard;
//
guard.symbol = mSymbol;
guard.period = mPeriod;
guard.provider = ToString(X128);
guard.action = X_GUARD_ACTION_FORCE_CLOSE;
//
guard.type = POSITION_TYPE_BUY;
//
Add(
guard,
guards);
}