This commit is contained in:
2024-06-12 09:45:57 +03:30
parent 6da0c05cdf
commit a34d471d6e
6 changed files with 690 additions and 37 deletions
+47
View File
@@ -153,6 +153,7 @@ enum ENUM_X_POSITION_TYPE
X_POSITION_TYPE_SHORT = 3,
};
//
bool ToPositinType(
ENUM_POSITION_TYPE &dest,
ENUM_X_POSITION_TYPE source //
@@ -179,6 +180,31 @@ bool ToPositinType(
return result;
}
//
ENUM_X_POSITION_TYPE GetOppositXPositionType(ENUM_POSITION_TYPE type)
{
//
ENUM_X_POSITION_TYPE result = X_POSITION_TYPE_NONE;
//
bool isLong = IsLong(type);
bool isShort = IsShort(type);
//
result =
//
isLong
? X_POSITION_TYPE_SHORT
: isShort
? X_POSITION_TYPE_LONG
: X_POSITION_TYPE_NONE
//
;
//
return result;
}
//
// Structs ...
@@ -2710,6 +2736,27 @@ typedef void (*TOnTakeProfit)(const XDeal &deal);
//
typedef void (*TOnTradeStateChanged)(const XOnTradeHandlerState &state);
//
typedef void (*TOnForceClose)(
const ulong ticket,
const XPosition &position,
const string comment //
);
//
typedef void (*TOnPartialClose)(
const ulong ticket,
const double profit,
const string comment //
);
//
typedef void (*TOnModify)(
const ulong ticket,
const double profit,
const string comment //
);
//
// Classes ...