fix: Removed hard ORB breakout suppression by day bias, Kept bias logging for traceability, Updated bias documentation comment to match behavior
This commit is contained in:
+14
-16
@@ -248,8 +248,8 @@ int g_BullOBCount = 0;
|
||||
int g_BearOBCount = 0;
|
||||
|
||||
// Day bias: direction of the first confirmed ORB breakout of the day (0=none, 1=bull, -1=bear).
|
||||
// When InpUseSessionBiasFilter=true, subsequent session breakouts and all OB entries that
|
||||
// contradict this bias are suppressed, preventing counter-trend trades.
|
||||
// InpUseSessionBiasFilter keeps bias context for diagnostics and selective filters.
|
||||
// ORB breakout detection is not suppressed by bias; OB retest entries may still be filtered.
|
||||
int g_GlobalBiasDir = 0;
|
||||
|
||||
// Tracks tickets that have already had partial close executed so it only fires once per position
|
||||
@@ -662,12 +662,11 @@ void DetectBreakouts()
|
||||
|
||||
if(bullBO)
|
||||
{
|
||||
// Bias filter: suppress if day bias is already bearish
|
||||
// Bias filter note: do not suppress ORB breakout detection.
|
||||
if(InpUseSessionBiasFilter && g_GlobalBiasDir == -1)
|
||||
{
|
||||
PrintFormat("NANDR EA: [%s] Bullish breakout SUPPRESSED — day bias is BEARISH",
|
||||
PrintFormat("NANDR EA: [%s] Bullish breakout detected while day bias is BEARISH (not suppressed)",
|
||||
g_Sessions[s].name);
|
||||
continue;
|
||||
}
|
||||
g_Sessions[s].breakoutDir = 1;
|
||||
g_Sessions[s].inBreakout = true;
|
||||
@@ -680,12 +679,11 @@ void DetectBreakouts()
|
||||
}
|
||||
else if(bearBO)
|
||||
{
|
||||
// Bias filter: suppress if day bias is already bullish
|
||||
// Bias filter note: do not suppress ORB breakout detection.
|
||||
if(InpUseSessionBiasFilter && g_GlobalBiasDir == 1)
|
||||
{
|
||||
PrintFormat("NANDR EA: [%s] Bearish breakout SUPPRESSED — day bias is BULLISH",
|
||||
PrintFormat("NANDR EA: [%s] Bearish breakout detected while day bias is BULLISH (not suppressed)",
|
||||
g_Sessions[s].name);
|
||||
continue;
|
||||
}
|
||||
g_Sessions[s].breakoutDir = -1;
|
||||
g_Sessions[s].inBreakout = true;
|
||||
@@ -1298,15 +1296,15 @@ void CheckRetestEntriesTick()
|
||||
|
||||
if(g_Sessions[s].breakoutDir == 1) // Bullish
|
||||
{
|
||||
// Continuation retest: bullish breakout remains active and wick retests level.
|
||||
// Use live ask filter for confirmation instead of flipping direction intrabar.
|
||||
if(l_cur <= orbHigh && ask >= orbHigh - tol)
|
||||
// Continuation retest: breakout direction is already confirmed.
|
||||
// Trigger on wick-touch of the session level.
|
||||
if(l_cur <= orbHigh)
|
||||
{
|
||||
orbLevel = orbHigh;
|
||||
dir = 1;
|
||||
}
|
||||
// Mid retest continuation.
|
||||
else if(l_cur <= orbMid && ask >= orbMid - tol)
|
||||
else if(l_cur <= orbMid)
|
||||
{
|
||||
orbLevel = orbMid;
|
||||
dir = 1;
|
||||
@@ -1314,15 +1312,15 @@ void CheckRetestEntriesTick()
|
||||
}
|
||||
else if(g_Sessions[s].breakoutDir == -1) // Bearish
|
||||
{
|
||||
// Continuation retest: bearish breakout remains active and wick retests level.
|
||||
// Use live bid filter for confirmation instead of flipping direction intrabar.
|
||||
if(h_cur >= orbLow && bid <= orbLow + tol)
|
||||
// Continuation retest: breakout direction is already confirmed.
|
||||
// Trigger on wick-touch of the session level.
|
||||
if(h_cur >= orbLow)
|
||||
{
|
||||
orbLevel = orbLow;
|
||||
dir = -1;
|
||||
}
|
||||
// Mid retest continuation.
|
||||
else if(h_cur >= orbMid && bid <= orbMid + tol)
|
||||
else if(h_cur >= orbMid)
|
||||
{
|
||||
orbLevel = orbMid;
|
||||
dir = -1;
|
||||
|
||||
Reference in New Issue
Block a user