Last ...
This commit is contained in:
@@ -100,6 +100,7 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
double entry = 0;
|
||||
double reward = 0;
|
||||
double r2r = R2R();
|
||||
string provider = "";
|
||||
double volume = Volume();
|
||||
ENUM_POSITION_TYPE type = POSITION_TYPE_BUY;
|
||||
ENUM_X_ORDER_MODES mode = X_ORDER_MODE_MARKET;
|
||||
@@ -245,6 +246,15 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
//
|
||||
bool isOrderFlowBullish = IsBullish(mOrderFlowDir);
|
||||
|
||||
//
|
||||
// Check Parabolic Sar is in Order of Order Flow ...
|
||||
bool isPSarInDirectionOfOrderFlow =
|
||||
isOrderFlowBullish
|
||||
? conditions.xchsarConditions.cSars[0] < cBar.low &&
|
||||
conditions.xchsarConditions.cSars[1] >= pBar.low
|
||||
: conditions.xchsarConditions.cSars[0] > cBar.high &&
|
||||
conditions.xchsarConditions.cSars[1] <= pBar.high;
|
||||
|
||||
//
|
||||
// Check BOS or CHOCH Happens ...
|
||||
bool hasBOS =
|
||||
@@ -282,35 +292,23 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
if (hasBOS || hasCHOCH)
|
||||
{
|
||||
//
|
||||
RedrawOrderFlow();
|
||||
|
||||
//
|
||||
string mTitle =
|
||||
hasBOS ? "BOS"
|
||||
: "CHOCH";
|
||||
|
||||
//
|
||||
Print(mTitle);
|
||||
|
||||
//
|
||||
// Here We Have to Decide How to Act Based On
|
||||
// Conditions for Updating Order Flow ...
|
||||
// Do on CHOCH ...
|
||||
if (hasCHOCH)
|
||||
{
|
||||
//
|
||||
|
||||
hasLong =
|
||||
//
|
||||
!isOrderFlowBullish &&
|
||||
cBar.IsBullish() &&
|
||||
(isCBullishMomentumBar ||
|
||||
isCBullishRejectionBar) &&
|
||||
isCBullishRejectionBar) &&
|
||||
conditions.xchsarConditions.cSars[0] < cBar.low
|
||||
//
|
||||
;
|
||||
if (hasLong) {
|
||||
if (hasLong)
|
||||
{
|
||||
//
|
||||
// selectedSL = conditions.xpvConditions.peaks[1];
|
||||
// selectedSL = conditions.xchsarConditions.cSars[1];
|
||||
provider = "CHOCH-Long";
|
||||
selectedSL = cBar.low;
|
||||
}
|
||||
|
||||
@@ -320,80 +318,60 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
isOrderFlowBullish &&
|
||||
cBar.IsBearish() &&
|
||||
(isCBearishMomentumBar ||
|
||||
isCBearishRejectionBar) &&
|
||||
isCBearishRejectionBar) &&
|
||||
conditions.xchsarConditions.cSars[0] > cBar.high
|
||||
//
|
||||
;
|
||||
if (hasShort) {
|
||||
if (hasShort)
|
||||
{
|
||||
//
|
||||
// selectedSL = conditions.xpvConditions.vales[1];
|
||||
// selectedSL = conditions.xchsarConditions.cSars[1];
|
||||
provider = "CHOCH-Short";
|
||||
selectedSL = cBar.high;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Do on BOS ...
|
||||
if (hasBOS)
|
||||
{
|
||||
//
|
||||
hasLong =
|
||||
//
|
||||
isOrderFlowBullish &&
|
||||
cBar.IsBullish() &&
|
||||
(isCBullishMomentumBar ||
|
||||
isCBullishRejectionBar) &&
|
||||
conditions.xchsarConditions.cSars[0] < cBar.low
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
if (hasLong)
|
||||
{
|
||||
//
|
||||
provider = "BOS-Long";
|
||||
selectedSL = cBar.low;
|
||||
}
|
||||
|
||||
//
|
||||
hasShort =
|
||||
//
|
||||
!isOrderFlowBullish &&
|
||||
cBar.IsBearish() &&
|
||||
(isCBearishMomentumBar ||
|
||||
isCBearishRejectionBar) &&
|
||||
conditions.xchsarConditions.cSars[0] > cBar.high
|
||||
//
|
||||
;
|
||||
if (hasShort)
|
||||
{
|
||||
//
|
||||
provider = "BOS-Short";
|
||||
selectedSL = cBar.high;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Check Parabolic Sar is in Order of Order Flow ...
|
||||
bool isPSarInDirectionOfOrderFlow =
|
||||
isOrderFlowBullish
|
||||
? conditions.xchsarConditions.cSars[0] < cBar.low &&
|
||||
conditions.xchsarConditions.cSars[1] >= pBar.low
|
||||
: conditions.xchsarConditions.cSars[0] > cBar.high &&
|
||||
conditions.xchsarConditions.cSars[1] <= pBar.high;
|
||||
|
||||
//
|
||||
if (isPSarInDirectionOfOrderFlow)
|
||||
{
|
||||
RedrawOrderFlow();
|
||||
Print("");
|
||||
}
|
||||
else
|
||||
{
|
||||
ClearDraws();
|
||||
}
|
||||
|
||||
//
|
||||
bool long1 =
|
||||
//
|
||||
false
|
||||
//
|
||||
;
|
||||
if (long1)
|
||||
{
|
||||
//
|
||||
CustomStateDrawing(mTriggerPOIState);
|
||||
selectedSL = conditions.xpvConditions.vales[cIndex];
|
||||
}
|
||||
|
||||
//
|
||||
// Works by WVAP and PSar ...
|
||||
bool short1 =
|
||||
//
|
||||
false
|
||||
//
|
||||
;
|
||||
if (short1)
|
||||
{
|
||||
//
|
||||
CustomStateDrawing(mTriggerPOIState);
|
||||
selectedSL = conditions.xpvConditions.peaks[cIndex];
|
||||
}
|
||||
|
||||
// //
|
||||
// hasLong =
|
||||
// //
|
||||
// long1
|
||||
// //
|
||||
// ;
|
||||
|
||||
// //
|
||||
// hasShort =
|
||||
// //
|
||||
// short1
|
||||
// //
|
||||
// ;
|
||||
|
||||
//
|
||||
result = hasLong ||
|
||||
hasShort;
|
||||
@@ -449,6 +427,7 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
: entry - reward;
|
||||
|
||||
//
|
||||
Print("PRV: ", provider);
|
||||
ClearDraws();
|
||||
|
||||
//
|
||||
@@ -466,6 +445,10 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
|
||||
//
|
||||
result = PrepareSignal(signal);
|
||||
if (result)
|
||||
{
|
||||
ResetOrderFlow();
|
||||
}
|
||||
|
||||
//
|
||||
hasLong = false;
|
||||
@@ -1156,6 +1139,16 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* When a BOS Happens ...
|
||||
* we have to Update Order Flow ...
|
||||
*/
|
||||
void UpdateOrderFlowOnBOS()
|
||||
{
|
||||
//
|
||||
Print("UpdateOrderFlowOnBOS");
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill Pivot Tick Zone ...
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user