apply long and short 1 conditions on xch che strategy ...
This commit is contained in:
@@ -348,16 +348,128 @@ public:
|
||||
!chvwapConditions.hasBullishPower);
|
||||
|
||||
//
|
||||
// Detecting Signals ...
|
||||
|
||||
//
|
||||
bool isCHHKFullSwitchedToBullish =
|
||||
bool isCHHKFullSwitchedToBullish =
|
||||
chhkHelper.IsSwitchedToBullish(cIndex);
|
||||
|
||||
//
|
||||
bool isCHHKFullSwitchedToBearish =
|
||||
bool isCHHKFullSwitchedToBearish =
|
||||
chhkHelper.IsSwitchedToBearish(cIndex);
|
||||
|
||||
//
|
||||
bool isBearishPowerDecreasing =
|
||||
//
|
||||
conditions.chhkConditions.isBearishPowerDecreasing &&
|
||||
conditions.chcheConditions.isBearishPowerDecreasing
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isBullishPowerDecreasing =
|
||||
//
|
||||
conditions.chhkConditions.isBullishPowerDecreasing &&
|
||||
conditions.chcheConditions.isBullishPowerDecreasing
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool hasBearishDecision =
|
||||
//
|
||||
cBar.IsBearishDecision()
|
||||
//
|
||||
||
|
||||
//
|
||||
pBar.IsBearishDecision()
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool hasBullishDecision =
|
||||
//
|
||||
cBar.IsBullishDecision()
|
||||
//
|
||||
||
|
||||
//
|
||||
pBar.IsBullishDecision()
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
double long1SL =
|
||||
(cBar.IsBullishDecision()
|
||||
? cBar.low
|
||||
: pBar.low) -
|
||||
(10 * points);
|
||||
|
||||
//
|
||||
double short1SL =
|
||||
(cBar.IsBearishDecision()
|
||||
? cBar.high
|
||||
: pBar.high) -
|
||||
(10 * points);
|
||||
|
||||
//
|
||||
// Detecting Signals ...
|
||||
|
||||
//
|
||||
bool hasLong1 =
|
||||
//
|
||||
hasBullishDecision &&
|
||||
notHaveBearishPower &&
|
||||
isBearishPowerDecreasing &&
|
||||
isCHHKFullSwitchedToBullish
|
||||
//
|
||||
;
|
||||
if (hasLong1)
|
||||
{
|
||||
//
|
||||
pushers++;
|
||||
Add(
|
||||
"XCHHKE",
|
||||
signallers //
|
||||
);
|
||||
|
||||
//
|
||||
sl = long1SL;
|
||||
type = POSITION_TYPE_BUY;
|
||||
}
|
||||
|
||||
//
|
||||
bool hasShort1 =
|
||||
//
|
||||
hasBearishDecision &&
|
||||
notHaveBullishPower &&
|
||||
isBullishPowerDecreasing &&
|
||||
isCHHKFullSwitchedToBearish
|
||||
//
|
||||
;
|
||||
if (hasShort1)
|
||||
{
|
||||
//
|
||||
pushers++;
|
||||
Add(
|
||||
"XCHHKE",
|
||||
signallers //
|
||||
);
|
||||
|
||||
//
|
||||
sl = short1SL;
|
||||
type = POSITION_TYPE_SELL;
|
||||
}
|
||||
|
||||
//
|
||||
hasLong =
|
||||
//
|
||||
hasLong1
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
hasShort =
|
||||
//
|
||||
hasShort1
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
result = hasLong || hasShort;
|
||||
if (!result)
|
||||
|
||||
Reference in New Issue
Block a user