last ...
This commit is contained in:
@@ -651,7 +651,7 @@ double mSameValeGolden = 0;
|
||||
|
||||
//
|
||||
bool mDrawLiquidities = false;
|
||||
bool mDrawRangeBreakes = false;
|
||||
bool mDrawRangeBreakes = true;
|
||||
|
||||
//
|
||||
bool mDetectLiquidities = true;
|
||||
@@ -3663,6 +3663,9 @@ void DoProcess(
|
||||
// Detecting Trigger Bar ...
|
||||
|
||||
//
|
||||
bool hasSignal = false;
|
||||
bool isBullish = false;
|
||||
bool isBearish = false;
|
||||
string namePrefix = NULL;
|
||||
int triggerBarPushers = 0;
|
||||
ENUM_X_DIRECTION triggerDir;
|
||||
@@ -3898,11 +3901,7 @@ void DoProcess(
|
||||
;
|
||||
|
||||
//
|
||||
// Validating Trigger Bar ...
|
||||
if (isTriggerBar)
|
||||
{
|
||||
//
|
||||
// Reading Required Info ...
|
||||
// Reading Required Condiions ...
|
||||
|
||||
//
|
||||
// HK Signal Bar ...
|
||||
@@ -4042,62 +4041,69 @@ void DoProcess(
|
||||
iBar.high < iHKSMin;
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
// KI ...
|
||||
|
||||
//
|
||||
// Validate Bullish Trigger Bar ...
|
||||
isBullishTriggerBar =
|
||||
//
|
||||
isBullishTriggerBar &&
|
||||
//
|
||||
(
|
||||
//
|
||||
// isHKSBullish &&
|
||||
// isTrendBullish
|
||||
//
|
||||
// isRSICrossedOverOS
|
||||
//
|
||||
isHKSSwitchedToBullish
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
bool isKIBullish = kiStateBuffer[barIndex] > 0;
|
||||
bool isPKIBullish = kiStateBuffer[barIndex + 1] > 0;
|
||||
|
||||
//
|
||||
// Validate Bearish Trigger Bar ...
|
||||
isBearishTriggerBar =
|
||||
//
|
||||
isBearishTriggerBar &&
|
||||
//
|
||||
(
|
||||
//
|
||||
// isHKSBearish &&
|
||||
// isTrendBearish
|
||||
//
|
||||
// isRSICrossedUnderOB
|
||||
//
|
||||
isHKSSwitchedToBearish
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
bool isKIBearish = kiStateBuffer[barIndex] < 0;
|
||||
bool isPKIBearish = kiStateBuffer[barIndex = 1] < 0;
|
||||
|
||||
//
|
||||
// Summarizing Result ...
|
||||
isTriggerBar =
|
||||
//
|
||||
isBullishTriggerBar ||
|
||||
isBearishTriggerBar
|
||||
//
|
||||
;
|
||||
bool isKISwitchedToBullish =
|
||||
isKIBullish &&
|
||||
!isPKIBullish;
|
||||
|
||||
//
|
||||
bool isKISwitchedToBearish =
|
||||
isKIBearish &&
|
||||
!isPKIBearish;
|
||||
|
||||
//
|
||||
// Validating Trigger Bar based on Conditions ...
|
||||
if (isTriggerBar)
|
||||
{
|
||||
//
|
||||
// TODO: Remove this if required ...
|
||||
isTriggerBar = false;
|
||||
isBullishTriggerBar = false;
|
||||
isBearishTriggerBar = false;
|
||||
}
|
||||
|
||||
//
|
||||
// Detecting Signal ...
|
||||
|
||||
//
|
||||
// Bullish ...
|
||||
isBullish =
|
||||
//
|
||||
isHKSBullish &&
|
||||
isKISwitchedToBullish &&
|
||||
iBar.close > kiBuffer[barIndex]
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// Bearish ...
|
||||
isBearish =
|
||||
//
|
||||
isHKSBearish &&
|
||||
isKISwitchedToBearish &&
|
||||
iBar.close < kiBuffer[barIndex]
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// Summarizing Signal ...
|
||||
hasSignal =
|
||||
isBullish ||
|
||||
isBearish;
|
||||
|
||||
//
|
||||
// Draw Requirements ...
|
||||
|
||||
//
|
||||
// Draw Trigger Bar ...
|
||||
if (isTriggerBar)
|
||||
@@ -4209,6 +4215,104 @@ void DoProcess(
|
||||
//
|
||||
}
|
||||
|
||||
//
|
||||
// Draw Signal ...
|
||||
if (hasSignal)
|
||||
{
|
||||
//
|
||||
int bullishArrowCode = 225;
|
||||
int bearishArrowCode = 226;
|
||||
|
||||
//
|
||||
color bullishColor = clrLime;
|
||||
color bearishColor = clrRed;
|
||||
|
||||
//
|
||||
ENUM_ARROW_ANCHOR bullishAnchor = ANCHOR_TOP;
|
||||
ENUM_ARROW_ANCHOR bearishAnchor = ANCHOR_BOTTOM;
|
||||
|
||||
//
|
||||
int arrowWidth = 3;
|
||||
int arrowCode =
|
||||
isBullish
|
||||
? bullishArrowCode
|
||||
: bearishArrowCode;
|
||||
ENUM_X_PRICE arrowPriceType =
|
||||
isBullish
|
||||
? X_PRICE_LOW
|
||||
: X_PRICE_HIGH;
|
||||
color arrowColor =
|
||||
isBullish
|
||||
? bullishColor
|
||||
: bearishColor;
|
||||
ENUM_ARROW_ANCHOR arrowAnchor =
|
||||
isBullish
|
||||
? bullishAnchor
|
||||
: bearishAnchor;
|
||||
|
||||
//
|
||||
XCBarArrowObject *iObj;
|
||||
has = mDrawer.CreateBarArrow(
|
||||
iBar,
|
||||
iObj,
|
||||
arrowPriceType,
|
||||
arrowCode,
|
||||
arrowColor,
|
||||
arrowWidth,
|
||||
arrowAnchor,
|
||||
namePrefix //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
mObjects.Add(iObj);
|
||||
}
|
||||
|
||||
//
|
||||
// Converts to Box ...
|
||||
XBoxZone iBox;
|
||||
iBox.type = "XSG";
|
||||
iBox.to = iBar.time;
|
||||
iBox.symbol = _Symbol;
|
||||
iBox.period = _Period;
|
||||
iBox.lower = iPBar.low;
|
||||
iBox.from = iPBar.time;
|
||||
iBox.upper = iPBar.high;
|
||||
iBox.dir =
|
||||
isBullish
|
||||
? X_DIRECTION_BULLISH
|
||||
: X_DIRECTION_BEARISH;
|
||||
if (iBox.IsValid())
|
||||
{
|
||||
//
|
||||
XSignal iSignal;
|
||||
double iRewardRatios[] = {
|
||||
1,
|
||||
1.5,
|
||||
2 //
|
||||
};
|
||||
has = ToSignal(
|
||||
iBox,
|
||||
iSignal,
|
||||
iRewardRatios,
|
||||
0 // Additional SL ...
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
XCSignalObject *iObj;
|
||||
has = mDrawer.DrawSignal(
|
||||
iSignal,
|
||||
iObj,
|
||||
4 //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
mObjects.Add(iObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Cleanup Resources ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user