last works ...

must Fix Refactoring X_POSITION_TYPE side affects ...
This commit is contained in:
2024-06-05 08:48:31 +03:30
parent 6b05f48cde
commit 46fda23346
9 changed files with 225 additions and 127 deletions
+29 -3
View File
@@ -111,6 +111,15 @@ enum ENUM_X_GUARD_ACTIONS
X_GUARD_ACTION_CANCEL_PENDING_ORDERS, // Cancel Pending Orders
};
//
enum ENUM_X_POSITION_TYPE
{
X_POSITION_TYPE_NONE = 0,
X_POSITION_TYPE_ALL = 1,
X_POSITION_TYPE_LONG = 2,
X_POSITION_TYPE_SHORT = 3,
};
//
// Structs ...
@@ -3523,9 +3532,26 @@ bool IsTypeFilterPassed(
)
{
//
return type == NULL
? true
: type == item.type;
bool result = type == item.type;
//
return result;
}
template <typename T>
bool IsTypeFilterPassed(
ENUM_X_POSITION_TYPE type,
T &item
//
)
{
//
bool result = type == NULL || type == X_POSITION_TYPE_ALL
? true
: ((type == X_POSITION_TYPE_LONG && item.type == POSITION_TYPE_BUY) ||
(type == X_POSITION_TYPE_SHORT && item.type == POSITION_TYPE_SELL));
//
return result;
}
template <typename T>
bool IsTypeFilterPassed(