last works ...
must Fix Refactoring X_POSITION_TYPE side affects ...
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user